Maven Error from Eclipse - maven

I had a maven project that worked fine in Eclipse 3.4.2 before I updated that project.
OS: Windows XP, SP2
Maven: maven-2.2.1
Java: jdk1.6.0_17
Eclipse: 3.4.2
m2e: 0.9.8
When I perform the following from Eclipse:
(1) maven clean, then
(2) maven install;
the installation fails. Here is a partial of the log.
[INFO] Installing C:\DLiao\Archive_Reconciler\R18\app\target\tsi-apex-reconciler-app-1.0.18.jar to C:\Documents and Settings\DLiao\.m2\repository\net\transolutions\apex\tsi-apex-reconciler-app\1.0.18\tsi-apex-reconciler-app-1.0.18.jar
[INFO] ------------------------------------------------------------------------
[INFO] Building Transolutions Apex Reconciler Web Application
[INFO]
[INFO] Id: net.transolutions.apex:tsi-apex-reconciler-web:war:1.0.18
[INFO] task-segment: [install]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] No sources to compile
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] No sources to compile
[INFO] [surefire:test]
[INFO] No tests to run.
[INFO] [war:war]
[INFO] Packaging webapp
[INFO] Assembling webapp[tsi-apex-reconciler-web] in [C:\DLiao\Archive_Reconciler\R18\web\target\tsi-apex-reconciler-web-1.0.18]
[INFO] Processing war project
[INFO]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] ------------------------------------------------------------------------
[INFO] Transolutions Apex Reconciler ......................... SUCCESS [0.672s]
[INFO] Transolutions Apex Reconciler Data Layer .............. SUCCESS [1.672s]
[INFO] Transolutions Apex Reconciler Render Service Client ... SUCCESS [0.188s]
[INFO] Transolutions Apex Reconciler Application Layer ....... SUCCESS [1.250s]
[INFO] Transolutions Apex Reconciler Web Application ......... FAILED [1.718s]
[INFO] ------------------------------------------------------------------------
[ERROR]
*The following mojo encountered an error while executing:
Group-Id: org.apache.maven.plugins
Artifact-Id: maven-war-plugin
Version: 2.1-alpha-1
Mojo: war
brought in via: packaging: war
While building project:
Group-Id: net.transolutions.apex
Artifact-Id: tsi-apex-reconciler-web
Version: 1.0.18
From file: C:\DLiao\Archive_Reconciler\R18\web\pom.xml
Reason: Failed to copy file for artifact[active project artifact:
artifact = net.transolutions.apex:tsi-apex-reconciler-app:jar:1.0.18:compile;
project: MavenProject: net.transolutions.apex:tsi-apex-reconciler-app:1.0.18 # C:\DLiao\Archive_Reconciler\
R18\app\pom.xml]*
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run with the -e flag
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILED
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5 seconds
[INFO] Finished at: Wed Jan 02 14:14:19 CST 2013
[INFO] Final Memory: 3M/20M
[INFO] ------------------------------------------------------------------------
However, if I run
mvn clean install
from DOS command line (Java JDK 1.6.0_17), everything is fine, and the .war fine is deployed under my ~/m2/...
Here is the log file from command line.
[INFO] Installing C:\DLiao\Archive_Reconciler\R18\app\target\tsi-apex-reconciler
-app-1.0.18.jar to C:\Documents and Settings\DLiao\.m2\repository\net\transoluti
ons\apex\tsi-apex-reconciler-app\1.0.18\tsi-apex-reconciler-app-1.0.18.jar
[INFO] ------------------------------------------------------------------------
[INFO] Building Transolutions Apex Reconciler Web Application
[INFO] task-segment: [clean, install]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean {execution: default-clean}]
[INFO] Deleting directory C:\DLiao\Archive_Reconciler\R18\web\target
[INFO] [resources:resources {execution: default-resources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 5 resources
[INFO] [compiler:compile {execution: default-compile}]
[INFO] No sources to compile
[INFO] [resources:testResources {execution: default-testResources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\DLiao\Archive_Reconciler\R18\web\s
rc\test\resources
[INFO] [compiler:testCompile {execution: default-testCompile}]
[INFO] No sources to compile
[INFO] [surefire:test {execution: default-test}]
[INFO] No tests to run.
[INFO] [war:war {execution: default-war}]
[INFO] Packaging webapp
[INFO] Assembling webapp[tsi-apex-reconciler-web] in [C:\DLiao\Archive_Reconcile
r\R18\web\target\tsi-apex-reconciler-web-1.0.18]
[INFO] Processing war project
[INFO] Copying webapp resources[C:\DLiao\Archive_Reconciler\R18\web\src\main\web
app]
[INFO] Webapp assembled in[1110 msecs]
[INFO] Building war: C:\DLiao\Archive_Reconciler\R18\web\target\tsi-apex-reconci
ler-web-1.0.18.war
[INFO] [install:install {execution: default-install}]
[INFO] Installing C:\DLiao\Archive_Reconciler\R18\web\target\tsi-apex-reconciler
-web-1.0.18.war to C:\Documents and Settings\DLiao\.m2\repository\net\transoluti
ons\apex\tsi-apex-reconciler-web\1.0.18\tsi-apex-reconciler-web-1.0.18.war
[INFO]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] ------------------------------------------------------------------------
[INFO] Transolutions Apex Reconciler ......................... SUCCESS [1.172s]
[INFO] Transolutions Apex Reconciler Data Layer .............. SUCCESS [2.406s]
[INFO] Transolutions Apex Reconciler Render Service Client ... SUCCESS [0.328s]
[INFO] Transolutions Apex Reconciler Application Layer ....... SUCCESS [3.547s]
[INFO] Transolutions Apex Reconciler Web Application ......... SUCCESS [10.282s]
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 17 seconds
[INFO] Finished at: Wed Jan 02 11:23:10 CST 2013
[INFO] Final Memory: 49M/254M
[INFO] ------------------------------------------------------------------------
Any suggestions, please advise.
Thanks
Dave

The parent POM file.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<properties>
<reconciler.version>1.0.19</reconciler.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<groupId>net.transolutions.apex</groupId>
<artifactId>tsi-apex-reconciler</artifactId>
<version>1.0.19</version>
<packaging>pom</packaging>
<name>Transolutions Apex Reconciler</name>
<description>Update and reimplementation of the classic reconciler web application.</description>
<modules>
<module>data</module>
<module>app</module>
<module>web</module>
<module>render-service</module>
</modules>
<build>
<defaultGoal>install</defaultGoal>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<verbose>true</verbose>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Portfolio Snapshot Repository</name>
<url>http://s3.amazonaws.com/maven.springframework.org/snapshot</url>
</repository>
<repository>
<id>maven.org</id>
<name>Maven 2 Repository</name>
<url>http://repo2.maven.org/maven2/</url>
</repository>
<repository>
<id>jboss-maven2</id>
<name>JBoss Maven 2 Repository</name>
<url>http://repository.jboss.org/nexus/content/groups/public/</url>
</repository>
<repository>
<id>java.net</id>
<name>Java.net Maven Repository</name>
<url>https://maven-repository.dev.java.net/nonav/repository/</url>
</repository>
</repositories>
</project>
The POM file for my web project, which generates the error message.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>net.transolutions.apex</groupId>
<artifactId>tsi-apex-reconciler</artifactId>
<version>1.0.19</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>net.transolutions.apex</groupId>
<artifactId>tsi-apex-reconciler-web</artifactId>
<packaging>war</packaging>
<name>Transolutions Apex Reconciler Web Application</name>
<description>Web application that assembles the data layer and application layer.</description>
<properties>
<icefaces.version>1.8.1</icefaces.version>
</properties>
<dependencies>
<dependency>
<groupId>net.transolutions.apex</groupId>
<artifactId>tsi-apex-reconciler-app</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.icefaces</groupId>
<artifactId>icefaces</artifactId>
<version>${icefaces.version}</version>
<exclusions>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
<exclusion>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.icefaces</groupId>
<artifactId>icefaces-facelets</artifactId>
<version>${icefaces.version}</version>
<exclusions>
<exclusion>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.icefaces</groupId>
<artifactId>icefaces-comps</artifactId>
<version>${icefaces.version}</version>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc14</artifactId>
<version>10.2.0.3.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.9</version>
<configuration>
<contextPath>/reconciler</contextPath>
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
<port>8080</port>
<maxIdleTime>3600000</maxIdleTime>
</connector>
<systemProperties>
<property>
<name>slf4j</name>
<value>false</value>
</property>
<property>
<name>log4j.configuration</name>
<value>file:${basedir}/src/main/webapp/WEB-INF/classes/log4j.properties</value>
</property>
<property>
<name>catalina.home</name>
<value>${basedir}/target/</value>
</property>
<property>
<name>catalina.base</name>
<value>${basedir}/target/</value>
</property>
</systemProperties>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<configuration>
<url>http://192.168.56.1:8080/manager/text</url>
<server>TomcatServer</server>
<path>/tsi-apex-reconciler-web-1.0.18</path>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>TEST</id>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<delete
file="${project.build.outputDirectory}/environment.properties" />
<copy file="src/main/resources/environment.test.properties"
tofile="${project.build.outputDirectory}/environment.properties" />
</tasks>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classifier>test</classifier>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>PROD</id>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>process-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<delete file="${project.build.outputDirectory}/PROD.jdbc.properties" />
<delete file="${project.build.outputDirectory}/PROD.jdbc.properties" />
<delete file="${project.build.outputDirectory}//TEST.renderer.properties" />
<delete file="${project.build.outputDirectory}//TEST.renderer.properties" />
<delete file="${project.build.outputDirectory}/jdbc.properties" />
<copy file="src/main/resources/PROD.jdbc.properties"
tofile="${project.build.outputDirectory}/jdbc.properties" />
<delete file="${project.build.outputDirectory}/renderer.properties" />
<copy file="src/main/resources/PROD.renderer.properties"
tofile="${project.build.outputDirectory}/renderer.properties" />
</tasks>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Hope these will help.
Best,
Dave

Related

maven-dependency-plugin usage to download dependency jars

Hoping someone can explain how to set the plugin options correctly.
I am looking to have a pom file that someone could execute an mvn command on to download all the jars of the dependencies (transitive included) defined in the pom (including their sources and javadoc jars) from Maven Central and copy them to a specified directory.
My question appears quite similar to maven-dependency-plugin ignores outputDirectory configuration but dwells on a slightly different aspect. Tried the approach advised in the accepted answer there but that didn't work.
pom file:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>gq.jetstream</groupId>
<artifactId>maven-download-sources-javadocs</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<org.springframework.version>5.2.22.RELEASE</org.springframework.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${org.springframework.version}</version>
</dependency>
</dependencies>
<build>
<!-- <sourceDirectory>src</sourceDirectory> -->
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<includeScope>runtime</includeScope>
<classifier>sources</classifier>
<classifier>javadoc</classifier>
<outputDirectory>${project.build.directory}/dependency-jars/</outputDirectory>
<includeClassifiers>sources,javadoc</includeClassifiers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Executing mvn package against this pom doesn't do anything. The output for the goal execution was empty.
Alt 1: Tried the following command. This copied the javadoc jars only and not the binary jars and sources jars of the dependencies.
mvn dependency:copy-dependencies#copy-dependencies
[INFO] Scanning for projects...
[INFO]
[INFO] ------------< gq.jetstream:maven-download-sources-javadocs >------------
[INFO] Building maven-download-sources-javadocs 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:3.3.0:copy-dependencies (copy-dependencies) # maven-download-sources-javadocs ---
[INFO] Copying spring-core-5.2.22.RELEASE-javadoc.jar to C:\projects\code\maven-download-sources-javadocs\target\dependency-jars\spring-core-5.2.22.RELEASE-javadoc.jar
[INFO] Copying spring-jcl-5.2.22.RELEASE-javadoc.jar to C:\projects\code\maven-download-sources-javadocs\target\dependency-jars\spring-jcl-5.2.22.RELEASE-javadoc.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.846 s
[INFO] Finished at: 2022-06-22T02:09:55+01:00
[INFO] ------------------------------------------------------------------------

azure-functions-maven-plugin final jar missing libraries in classpath

I am try to deploy Java Azure function app from my local machine. My tech stack is fallows,
Azure Function App OS: Linux
Azure Functions Core Tools (2.0.3)
Springboot 2.6.3
spring-boot-maven-plugin 2.6.3
azure-functions-maven-plugin 1.14.3
azure-functions-java-library 1.4.2
spring-cloud-function-adapter-azure 3.2.1
Here is my pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.3</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.avol.func</groupId>
<artifactId>springcloud-eh-func</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Azure Java Functions</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>11</java.version>
<azure.functions.maven.plugin.version>1.14.3</azure.functions.maven.plugin.version>
<azure.functions.java.library.version>1.4.2</azure.functions.java.library.version>
<functionAppName>poc-java-func-apsp</functionAppName>
<resource.groupname>AvolPOCs</resource.groupname>
<appserviceplan.name>ASP-AvolPOCs-84f2</appserviceplan.name>
<azure.region>southcentralus</azure.region>
<azure.subscriptionid>xxxxxx</azure.subscriptionid>
<stagingDirectory>${project.build.directory}/azure-functions/${functionAppName}</stagingDirectory>
<start-class>com.avol.func.SpringAppRunner</start-class>
</properties>
<dependencies>
<dependency>
<groupId>com.microsoft.azure.functions</groupId>
<artifactId>azure-functions-java-library</artifactId>
<version>${azure.functions.java.library.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-function-adapter-azure</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>applicationinsights-spring-boot-starter</artifactId>
<version>2.6.3</version>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>applicationinsights-logging-logback</artifactId>
<version>2.6.3</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.22</version>
</dependency>
<!-- Test -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.8.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>4.2.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-function-dependencies</artifactId>
<version>3.2.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.microsoft.azure.functions</groupId>
<artifactId>azure-functions-java-library</artifactId>
<version>${azure.functions.java.library.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<filesets>
<fileset>
<directory>obj</directory>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${stagingDirectory}/lib</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
<includeScope>runtime</includeScope>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-functions-maven-plugin</artifactId>
<version>${azure.functions.maven.plugin.version}</version>
<configuration>
<subscriptionId>${azure.subscriptionid}</subscriptionId>
<!-- function app name -->
<appName>${functionAppName}</appName>
<!-- function app resource group -->
<resourceGroup>${resource.groupname}</resourceGroup>
<!-- function app service plan name -->
<appServicePlanName>${appserviceplan.name}</appServicePlanName>
<!-- function app region-->
<!-- refers https://github.com/microsoft/azure-maven-plugins/wiki/Azure-Functions:-Configuration-Details#supported-regions for all valid values -->
<region>${azure.region}</region>
<!-- function pricingTier, default to be consumption if not specified -->
<!-- refers https://github.com/microsoft/azure-maven-plugins/wiki/Azure-Functions:-Configuration-Details#supported-pricing-tiers for all valid values -->
<!-- <pricingTier></pricingTier> -->
<!-- Whether to disable application insights, default is false -->
<disableAppInsights>false</disableAppInsights>
<runtime>
<os>linux</os>
<javaVersion>11</javaVersion>
</runtime>
<appSettings>
<property>
<name>FUNCTIONS_EXTENSION_VERSION</name>
<value>~4</value>
</property>
<property>
<name>FUNCTIONS_WORKER_RUNTIME</name>
<value>java</value>
</property>
</appSettings>
</configuration>
<executions>
<execution>
<id>package-functions</id>
<goals>
<goal>package</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<overwrite>true</overwrite>
<outputDirectory>
${project.build.directory}/azure-functions/${functionAppName}
</outputDirectory>
<resources>
<resource>
<directory>${project.basedir}/src/main/resources
</directory>
<includes>
<include>**</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.6.3</version>
<dependencies>
<dependency>
<groupId>org.springframework.boot.experimental</groupId>
<artifactId>spring-boot-thin-layout</artifactId>
<version>1.0.28.RELEASE</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
Here is my maven build logs,
$ mvn clean package
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------< com.avol.func:springcloud-eh-func >----------------
[INFO] Building Azure Java Functions 1.0.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) # springcloud-eh-func ---
[INFO] Deleting C:\Users\padaldl\workspace\projects\Avol-POCs\src\Java\JavaFunAppPOC\springcloud-eh-func\target
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) # springcloud-eh-func ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 1 resource
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) # springcloud-eh-func ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 10 source files to C:\Users\padaldl\workspace\projects\Avol-POCs\src\Java\JavaFunAppPOC\springcloud-eh-func\target\classes
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) # springcloud-eh-func ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] skip non existing resourceDirectory C:\Users\padaldl\workspace\projects\Avol-POCs\src\Java\JavaFunAppPOC\springcloud-eh-func\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) # springcloud-eh-func ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.22.2:test (default-test) # springcloud-eh-func ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-dependency-plugin:3.2.0:copy-dependencies (copy-dependencies) # springcloud-eh-func ---
[INFO] Copying azure-functions-java-library-1.4.2.jar to C:\Users\padaldl\workspace\projects\Avol-POCs\src\Java\JavaFunAppPOC\springcloud-eh-func\target\azure-functions\poc-java-func-apsp\lib\azure-functions-java-library-1.4.2.jar
[INFO]
[INFO] --- maven-jar-plugin:3.2.2:jar (default-jar) # springcloud-eh-func ---
[INFO] Building jar: C:\Users\padaldl\workspace\projects\Avol-POCs\src\Java\JavaFunAppPOC\springcloud-eh-func\target\springcloud-eh-func-1.0.0-SNAPSHOT.jar
[INFO]
[INFO] --- azure-functions-maven-plugin:1.14.3:package (package-functions) # springcloud-eh-func ---
[INFO] Java home : C:/Users/padaldl/workspace/installedsws/zulu-11-azure-jdk_11.52.13-11.0.13-win_x64
[INFO] Artifact compile version : 11
[INFO]
[INFO] Step 1 of 8: Searching for Azure Functions entry points
[INFO] 2 Azure Functions entry point(s) found.
[INFO]
[INFO] Step 2 of 8: Generating Azure Functions configurations
[INFO] Generation done.
[INFO]
[INFO] Step 3 of 8: Validating generated configurations
[INFO] Validation done.
[INFO]
[INFO] Step 4 of 8: Saving host.json
[INFO] Successfully saved to C:\Users\padaldl\workspace\projects\Avol-POCs\src\Java\JavaFunAppPOC\springcloud-eh-func\target\azure-functions\poc-java-func-apsp\host.json
[INFO]
[INFO] Step 5 of 8: Saving local.settings.json
[INFO] Successfully saved to C:\Users\padaldl\workspace\projects\Avol-POCs\src\Java\JavaFunAppPOC\springcloud-eh-func\target\azure-functions\poc-java-func-apsp\local.settings.json
[INFO]
[INFO] Step 6 of 8: Saving configurations to function.json
[INFO] Starting processing function: uppercase
[INFO] Successfully saved to C:\Users\padaldl\workspace\projects\Avol-POCs\\src\Java\JavaFunAppPOC\springcloud-eh-func\target\azure-functions\poc-java-func-apsp\uppercase\function.json
[INFO] Starting processing function: assetSync
[INFO] Successfully saved to C:\Users\padaldl\workspace\projects\Avol-POCs\src\Java\JavaFunAppPOC\springcloud-eh-func\target\azure-functions\poc-java-func-apsp\assetSync\function.json
[INFO]
[INFO] Step 7 of 8: Copying JARs to staging directoryC:\Users\padaldl\workspace\projects\Avol-POCs\src\Java\JavaFunAppPOC\springcloud-eh-func\target\azure-functions\poc-java-func-apsp
[INFO] Copied successfully.
[INFO] Step 8 of 8: Installing function extensions if needed
[INFO] Extension bundle specified, skip install extension
[INFO] Successfully built Azure Functions.
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:copy-resources (copy-resources) # springcloud-eh-func ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 2 resources
[INFO]
[INFO] --- spring-boot-maven-plugin:2.6.3:repackage (repackage) # springcloud-eh-func ---
[INFO] Replacing main artifact with repackaged archive
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 29.790 s
[INFO] Finished at: 2022-02-03T19:39:15+05:30
[INFO] ------------------------------------------------------------------------
Function App works fine in local from IntellIJ IDEA, and as well run through mvn azure-functions:run command.
When I run the jar using java command java -jar <> it fails with error No Class Definition found error.
mvn azure-functions:deploy succeeded without any issue, and am able to see functions created on azure, but when I trigger function it fails with 500 Internal Error.
I suspect function failing in azure due to external dependencies not added to classpath of jar. From the stackoverflow I found similar question here, suggestion is to go with maven assembly plugin, but my question is why should we use Assembly plugin when I am using springboot plugin?
Finally issue got resolved after installing Azure Functions Core Tools version 4.x through MSI installer on windows.
https://learn.microsoft.com/en-us/azure/azure-functions/functions-run-local?tabs=v4%2Cwindows%2Ccsharp%2Cportal%2Cbash#v2
And it looks like azure functions refer /lib folder under staging directory when function triggers, it need not be springboot fat jar.

How to Integrate Integration Tests Using Cucumber 6 and Maven

I really need help here.
Objective: Run my cucumber integration tests using Cucumber-Java8 version 6.7.0 with Maven 3.6.3.
Actual Scenario: When I run maven using this command: $ mvn clean verify -Pintegration-tests I am receiving this result.
xxxxx # xxx <Project Name> % mvn clean verify -Pintegration-tests
[INFO] Scanning for projects...
[INFO]
[INFO] ----------< <Project Name> >----------
[INFO] Building <Project Name> 0.0.1
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) # <Project Name> ---
[INFO] Deleting /Users/<home>/Documents/repos/xxx/<Project Name>/target
[INFO]
[INFO] --- build-helper-maven-plugin:3.1.0:add-test-source (add-source) # <Project Name> ---
***[INFO] Test Source directory: /Users/<home>/Documents/repos/xxxx/<Project Name>/src/testintegration added.***
[INFO]
[INFO] --- build-helper-maven-plugin:3.1.0:add-test-resource (add-resource) # <Project Name ---
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) # <Project Name> ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 13 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) # <Project Name> ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 223 source files to /Users/<home>/Documents/repos/xxx/<Project Name>
...
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:testResources (default-testResources) # <Project Name> ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 15 resources
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) # n<Project Name> ---
[INFO] Changes detected - recompiling the module!
...
[INFO]
[INFO] --- maven-surefire-plugin:2.22.2:test (default-test) # <Project Name> ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-jar-plugin:3.2.0:jar (default-jar) # <Project Name> ---
[INFO] Building jar: /Users/<home>/Documents/repos/xxxx/<Project Name> -server/target/<Project Name>.jar
[INFO]
[INFO] --- maven-failsafe-plugin:2.22.2:integration-test (default) # <Project Name> ---
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO]
[INFO] --- maven-failsafe-plugin:2.22.2:verify (default) # <Project Name> ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.484 s
[INFO] Finished at: 2020-10-17T13:07:50+01:00
[INFO] ------------------------------------------------------------------------
I didn't put any code in my Definition Class except "Sysout" and assertTrue. The Integration Test runs when I use a runner that I created trigger by Intellij.
#RunWith(Cucumber.class)
#CucumberOptions(
features = {"src/testintegration/java/features"},
glue = {"steps"},
plugin = {"pretty", "html:target/cucumber"},
publish = true)
public class RunCucumberIT {
Code Scenario Actual
Sctructure of the Project - Intellij
Maven File - Snipped
<!-- Integration tests -->
<profiles>
<profile>
<id>integration-tests</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<cucumber.plugin>json:target/report.json</cucumber.plugin>
<cucumber.filter.tags>#wip</cucumber.filter.tags>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.7</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-test-source</goal>
</goals>
<configuration>
<sources>
<source>src/testintegration/</source>
</sources>
</configuration>
</execution>
<execution>
<id>add-resource</id>
<phase>generate-sources</phase>
<goals>
<goal>add-test-resource</goal>
</goals>
<configuration>
<resources>
<resource>
<directory>src/testintegration/resources/features</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<!-- block unit tests execution -->
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
<configuration>
<systemPropertyVariables>
<cucumber.plugin>${cucumber.plugin}</cucumber.plugin>
<cucumber.filter.tags>${cucumber.filter.tags}</cucumber.filter.tags>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<!-- Cucumber -->
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java8</artifactId>
<version>${cucumber.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit</artifactId>
<version>${cucumber.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>6.2.2</version>
<scope>test</scope>
</dependency>
</dependencies>
</profile>
</profiles>
</project>
Definition Class
package steps;
import static org.junit.jupiter.api.Assertions.assertTrue;
import io.cucumber.java8.En;
public class Authorization implements En {
public Authorization() {
Given("the system knows about the following attributes",
(io.cucumber.datatable.DataTable dataTable) -> {
System.out.println("AUTHORIZATION GIVEN TEST");
assertTrue(true);
});
When("the client request POST \\/login", () -> {
System.out.println("AUTHORIZATION When TEST");
assertTrue(true);
});
Then("the response should be JSON", (io.cucumber.datatable.DataTable dataTable) -> {
System.out.println("AUTHORIZATION Then TEST");
assertTrue(true);
});
}
}
Part of Feature File
Feature: Authorization
#wip
Scenario: Login into account
...
Runner Class - (When I trigger this class by Intellij my test run correctly
package runner;
import io.cucumber.junit.Cucumber;
import io.cucumber.junit.CucumberOptions;
import org.junit.runner.RunWith;
#RunWith(Cucumber.class)
#CucumberOptions(
features = {"src/testintegration/java/features"},
glue = {"steps"},
plugin = {"pretty", "html:target/cucumber"},
publish = true)
public class RunCucumberIT {
}
I used this page here to try to do work my tests. But to be honest I don't know if I am doing something wrong or the article is missing something.
Here is the website.(weblogism)
Please, could someone check the Pom.xml file? I think I am missing something.
Many thanks if someone can help me here.
Cheers,

SOAP UI Maven Integration

My Soap UI project and pom.xml resides under D:\Projekte\JacobMarshell
wanted to execute the testsuite of the soap ui project using maven.
Test suite is not executed when i use the following command
"mvn test" and getting the following response.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven 2 soapUI Sample
[INFO] task-segment: [test]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO] [compiler:compile {execution: default-compile}]
[INFO] No sources to compile
[INFO] [resources:testResources {execution: default-testResources}]
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO] [compiler:testCompile {execution: default-testCompile}]
[INFO] No sources to compile
[INFO] [surefire:test {execution: default-test}]
[INFO] Surefire report directory: D:\Projekte\JacobMarshell
-------------------------------------------------------
T E S T S
-------------------------------------------------------
There are no tests to run.
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
Here is the code snippet of pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>src.main.resources</groupId>
<artifactId>soapui-maven2-plugin</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>Maven 2 soapUI Sample</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<pluginRepositories>
<pluginRepository>
<id>eviwarePluginRepository</id>
<url>http://www.soapui.org/repository/maven2</url>
</pluginRepository>
</pluginRepositories>
<build>
<plugins>
<plugin>
<groupId>eviware</groupId>
<artifactId>maven-soapui-plugin</artifactId>
<version>4.5.1</version>
<configuration>
<projectFile>Sample-Upload-to-Upload-Diagnose---Complete--soapui-project.xml</projectFile>
<junitReport>true</junitReport>
<outputFolder>reports</outputFolder>
<testSuite>diag_upload_tc</testSuite>
</configuration>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Not able to figureout why maven does not execute my testsuite?
The actual problem was with the repository... I removed the eviware folder in the repository and start to run the "mvn test" command, where the repository got downloaded and then Test suite started to get execute thanks Marcel Stör for give me the hope that I would get an answer from some day.
Use below plugin:
<plugin>
<groupId>com.smartbear.soapui</groupId>
<artifactId>soapui-maven-plugin</artifactId>
<version>5.0.0</version>
<!– Change the name to identify –>
<configuration>
<projectFile>src/test/resources/soapui/Soapui-auto-soapui-project.xml</projectFile>
<!– Change the project file name –>
<outputFolder>target/surefire-reports</outputFolder>
<!– Change the suite name –>
<junitReport>true</junitReport>
<exportwAll>true</exportwAll>
<printReport>true</printReport>
<testFailIgnore>false</testFailIgnore>
<projectProperties>
<value>EnvName=${soapUiEnv}</value>
<value>ServiceEndPoint=${ServiceEndPoint}</value>
<value>TestReportPath=${project.build.directory}/surefire-reports/</value>
</projectProperties>
<soapuiProperties>
<property>
<name>soapui.properties</name>
<value>src/test/resources/soapui/soapui-auto_data.properties</value>
</property>
</soapuiProperties>
</configuration>
</plugin>
You need to create a test suite and copy it to "src/test/resources/soapui/".
Specify the path in project file tag and to execute the tests to running application run command "mvn com.smartbear.soapui:soapui-maven-plugin:5.0.0:test -DServiceEndPoint=http://localhost:8080"
You can refer below blog post, explained with example soap automation using maven plugin for spring boot application.

How to generate jar for maven parent project

Maven requires a parent project to have
<packaging>pom</packaging>
clause in the parent's pom.xml. When such a project installed, only a pom-file generated into the maven repository. Jar-file is not generated, no matter if the parent project has any Java code. That forces me to have extra empty parent projects, which is overkill. Logically, some of my libraries could be parents at the same time.
Is there a way to generate both pom and jar files for a parent project without removing/adding the packaging clause between installs?
Use Maven Jar Plugin and Maven Build Helper. Example POM:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>test</groupId>
<artifactId>test</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>attach-artifacts</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>test-${project.version}</file>
<type>jar</type>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>default</id>
<goals>
<goal>jar</goal>
</goals>
<phase>package</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Maven build results:
mvn install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building test 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- build-helper-maven-plugin:1.7:attach-artifact (attach-artifacts) # test ---
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default) # test ---
[WARNING] JAR will be empty - no content was marked for inclusion!
[INFO]
[INFO] --- maven-install-plugin:2.3.1:install (default-install) # test ---
[INFO] Installing /home/username/projects/test/pom.xml to /home/username/.m2/repository/test/test/1.0/test-1.0.pom
[INFO] Installing /home/username/projects/test/test-1.0 to /home/username/.m2/repository/test/test/1.0/test-1.0.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.805s
[INFO] Finished at: Thu Sep 06 13:33:20 EDT 2012
[INFO] Final Memory: 4M/119M
[INFO] ------------------------------------------------------------------------
A note on Maven practices:
Parent modules are typically where you define the dependencies and plugins used in common by all your child modules. It rarely has output of its own. You probably want to have a "distribution" sub-module that aggregates all your other module artifacts, rather than attempting to do it in the parent module.

Resources