Maven release:prepare goal - java

We have the following config in our POM file:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
<executions>
<execution>
<id>surefire-it</id>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<skip>false</skip>
</configuration>
</execution>
</executions>
</plugin>
This ensures that the tests are not executed during test phase. Tests are executed only during integration-test phase.
However, when we prepare for release (release:prepare), maven executes the tests during test phase. This causes our build to fail because our tests can be run only during Integration test phase (we use tomcat-maven plugin to deploy the packaged war before the tests can be executed).
I know that we can skip the tests by passing the parameter (-DskipTests etc.). We do not want to skip any tests, we just want release:prepare to execute just like any other maven goal.
Any suggestion/help is highly appreciated.

Try with the more general approach to disable the maven-surefire-plugin completely during test phase.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<executions>
<execution>
<id>default-test</id>
<!-- Disable the default-test by putting it in phase none -->
<phase>none</phase>
</execution>
<execution>
<!-- Enable the test during integration-test phase -->
<id>surefire-it</id>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>
Edit
This is the output from my dry run of mvn release:prepare with the above configured surefire plugin:
C:\Users\maba\Development\svn\local\stackoverflow\Q12840869>mvn release:prepare -DdryRun
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Q12840869-1.0-SNAPSHOT 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-release-plugin:2.0:prepare (default-cli) # Q12840869 ---
[INFO] Resuming release from phase 'scm-check-modifications'
[INFO] Verifying that there are no local modifications...
[INFO] Executing: cmd.exe /X /C "svn --non-interactive status"
[INFO] Working directory: C:\Users\maba\Development\svn\local\stackoverflow\Q12840869
[INFO] Checking dependencies and plugins for snapshots ...
What is the release version for "Q12840869-1.0-SNAPSHOT"? (com.stackoverflow:Q12840869) 1.0: :
What is SCM release tag or label for "Q12840869-1.0-SNAPSHOT"? (com.stackoverflow:Q12840869) Q12840869-1.0: :
What is the new development version for "Q12840869-1.0-SNAPSHOT"? (com.stackoverflow:Q12840869) 1.1-SNAPSHOT: :
[INFO] Transforming 'Q12840869-1.0-SNAPSHOT'...
[INFO] Not generating release POMs
[INFO] Executing preparation goals - since this is simulation mode it is running against the original project, not the rewritten ones
[INFO] Executing goals 'clean verify'...
[WARNING] Maven will be executed in interactive mode, but no input stream has been configured for this MavenInvoker instance.
[INFO] [INFO] Scanning for projects...
[INFO] [INFO]
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Building Q12840869-1.0-SNAPSHOT 1.0-SNAPSHOT
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO]
[INFO] [INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) # Q12840869 ---
[INFO] [INFO] Deleting C:\Users\maba\Development\svn\local\stackoverflow\Q12840869\target
[INFO] [INFO]
[INFO] [INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) # Q12840869 ---
[INFO] [INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] [INFO] Copying 0 resource
[INFO] [INFO]
[INFO] [INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) # Q12840869 ---
[INFO] [INFO] Compiling 1 source file to C:\Users\maba\Development\svn\local\stackoverflow\Q12840869\target\classes
[INFO] [INFO]
[INFO] [INFO] --- maven-resources-plugin:2.4.3:testResources (default-testResources) # Q12840869 ---
[INFO] [INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] [INFO] skip non existing resourceDirectory C:\Users\maba\Development\svn\local\stackoverflow\Q12840869\src\test\resources
[INFO] [INFO]
[INFO] [INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) # Q12840869 ---
[INFO] [INFO] Compiling 1 source file to C:\Users\maba\Development\svn\local\stackoverflow\Q12840869\target\test-classes
[INFO] [INFO]
[INFO] [INFO] --- maven-jar-plugin:2.3.1:jar (default-jar) # Q12840869 ---
[INFO] [INFO] Building jar: C:\Users\maba\Development\svn\local\stackoverflow\Q12840869\target\Q12840869-1.0-SNAPSHOT.jar
[INFO] [INFO]
[INFO] [INFO] --- maven-surefire-plugin:2.7.2:test (surefire-it) # Q12840869 ---
[INFO] [INFO] Surefire report directory: C:\Users\maba\Development\svn\local\stackoverflow\Q12840869\target\surefire
-reports
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.stackoverflow.MainTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.041 sec
[INFO]
[INFO] Results :
[INFO]
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] BUILD SUCCESS
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Total time: 5.102s
[INFO] [INFO] Finished at: Thu Oct 11 17:10:29 CEST 2012
[INFO] [INFO] Final Memory: 13M/147M
[INFO] [INFO] ------------------------------------------------------------------------

Add your integration tests in a separate profile which isn't active by default. Add a triggerring rule or something. Then invoke the builds with the integration tests on a need by need basis. For example, on your CI (Jenkins/Hudson, TeamCity, Bamboo, etc) triggered the profile.
The problem you are currently facing is that you haven't made a separation between the two types of tests and when they should run. You have simply defined the phases you would like them to execute in. This isn't sufficient knowledge of the execution context for Maven to figure out what you would like to do and it invokes them during the release as well.

I would try an alternate approach, and try to configure the release plugin to always use -DskipTests as an argument so you don't need to specify it each time:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin<artifactId>
<configuration>
<arguments>-DskipTests</arguments>
</configuration>
</plugin>
In theory this should append -DskipTests to the arguments that the prepare and release goals pass to the sub-executions of Maven that they execute.

Use the maven-failsafe-plugin for the integration tests, and keep maven-surefire-plugin for the unit tests.
This will guarantee that the unit tests are completely segregated from the integration tests (and can therefore be turned off separately), and the integration tests are run during the "integration-test and verify phases of the build lifecycle".

Related

How can I fix the unexpected clean phase caused by maven 3.3.9's build order and use ${revision}

I have a multi-module maven project, it's a springboot project.
Because of our company's jenkins script, I need to copy the runnable module(with the spring main class) to the root pom menu and I use Maven CI Friendly Versions's placeholder ${revision} to make the version simplify, but it's not work because the build order deleted the .jar file in maven 3.3.9 after copy, and it's works when the maven version is 3.8.2.
I write a demo project to reproduce the problem, the root pom is called demo-root, and a web module called demo-web.
Here's my root 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>org.example</groupId>
<artifactId>demo-root</artifactId>
<version>${revision}</version>
<modules>
<module>demo-web</module>
</modules>
<packaging>pom</packaging>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.6</version>
</parent>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<revision>1.0-SNAPSHOT</revision>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.example</groupId>
<artifactId>demo-web</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<version>1.2.2</version>
<configuration>
</configuration>
<executions>
<!-- enable flattening -->
<execution>
<id>flatten</id>
<phase>process-resources</phase>
<goals>
<goal>flatten</goal>
</goals>
</execution>
<!-- ensure proper cleanup -->
<execution>
<id>flatten.clean</id>
<phase>clean</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Here's my module 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">
<parent>
<artifactId>demo-root</artifactId>
<groupId>org.example</groupId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>demo-web</artifactId>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
<build>
<finalName>demo-project</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy</id>
<phase>package</phase>
<goals>
<goal>copy</goal>
</goals>
</execution>
</executions>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.example</groupId>
<artifactId>demo-web</artifactId>
<type>jar</type>
<overWrite>true</overWrite>
<destFileName>demo-project.jar</destFileName>
</artifactItem>
</artifactItems>
<outputDirectory>../target</outputDirectory>
</configuration>
</plugin>
</plugins>
</build>
</project>
Then, I run the mvn clean package under the root dir(with the .pom file).
Here's the build log, we can see that the build order is 'demo-web' -> 'demo-root'.
And under the log we can see that build order make the clean after the copy, that deleted the .jar file.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] demo-web
[INFO] demo-root
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building demo-web 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) # demo-web ---
[INFO] Deleting /Users/admin/repo#jin/demo-root/demo-web/target
[INFO]
[INFO] --- flatten-maven-plugin:1.2.2:clean (flatten.clean) # demo-web ---
[INFO] Deleting /Users/admin/repo#jin/demo-root/demo-web/.flattened-pom.xml
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) # demo-web ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 0 resource
[INFO] Copying 0 resource
[INFO]
[INFO] --- flatten-maven-plugin:1.2.2:flatten (flatten) # demo-web ---
[INFO] Generating flattened POM of project org.example:demo-web:jar:1.0-SNAPSHOT...
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) # demo-web ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /Users/admin/repo#jin/demo-root/demo-web/target/classes
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) # demo-web ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] skip non existing resourceDirectory /Users/admin/repo#jin/demo-root/demo-web/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) # demo-web ---
[INFO] Changes detected - recompiling the module!
[INFO]
[INFO] --- maven-surefire-plugin:2.22.2:test (default-test) # demo-web ---
[INFO]
[INFO] --- maven-jar-plugin:3.2.0:jar (default-jar) # demo-web ---
[INFO] Building jar: /Users/admin/repo#jin/demo-root/demo-web/target/demo-project.jar
[INFO]
[INFO] --- spring-boot-maven-plugin:2.5.6:repackage (repackage) # demo-web ---
[INFO] Replacing main artifact with repackaged archive
[INFO]
[INFO] --- maven-dependency-plugin:3.1.2:copy (copy) # demo-web ---
[INFO] Configured Artifact: org.example:demo-web:?:jar
[INFO] Copying demo-project.jar to /Users/admin/repo#jin/demo-root/target/demo-project.jar
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building demo-root 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) # demo-root ---
[INFO] Deleting /Users/admin/repo#jin/demo-root/target
[INFO]
[INFO] --- flatten-maven-plugin:1.2.2:clean (flatten.clean) # demo-root ---
[INFO] Deleting /Users/admin/repo#jin/demo-root/.flattened-pom.xml
[INFO]
[INFO] --- flatten-maven-plugin:1.2.2:flatten (flatten) # demo-root ---
[INFO] Generating flattened POM of project org.example:demo-root:pom:1.0-SNAPSHOT...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] demo-web ........................................... SUCCESS [ 4.592 s]
[INFO] demo-root .......................................... SUCCESS [ 0.095 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.940 s
[INFO] Finished at: 2021-10-26T00:44:10+08:00
[INFO] Final Memory: 34M/120M
[INFO] ------------------------------------------------------------------------
If I change the maven version to 3.8.2, and then run the mvn clean package.
it works well.
Here's the build log, and under the log we can see that the build order is 'demo-root' ->
'demo-web', so the copy is after the clean delete, and we can get the .jar file.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] demo-root [pom]
[INFO] demo-web [jar]
[INFO]
[INFO] -----------------------< org.example:demo-root >------------------------
[INFO] Building demo-root 1.0-SNAPSHOT [1/2]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) # demo-root ---
[INFO]
[INFO] --- flatten-maven-plugin:1.2.2:clean (flatten.clean) # demo-root ---
[INFO] Deleting /Users/admin/repo#jin/demo-root/.flattened-pom.xml
[INFO]
[INFO] --- flatten-maven-plugin:1.2.2:flatten (flatten) # demo-root ---
[INFO] Generating flattened POM of project org.example:demo-root:pom:1.0-SNAPSHOT...
[INFO]
[INFO] ------------------------< org.example:demo-web >------------------------
[INFO] Building demo-web 1.0-SNAPSHOT [2/2]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) # demo-web ---
[INFO] Deleting /Users/admin/repo#jin/demo-root/demo-web/target
[INFO]
[INFO] --- flatten-maven-plugin:1.2.2:clean (flatten.clean) # demo-web ---
[INFO] Deleting /Users/admin/repo#jin/demo-root/demo-web/.flattened-pom.xml
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) # demo-web ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 0 resource
[INFO] Copying 0 resource
[INFO]
[INFO] --- flatten-maven-plugin:1.2.2:flatten (flatten) # demo-web ---
[INFO] Generating flattened POM of project org.example:demo-web:jar:1.0-SNAPSHOT...
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) # demo-web ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /Users/admin/repo#jin/demo-root/demo-web/target/classes
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) # demo-web ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] skip non existing resourceDirectory /Users/admin/repo#jin/demo-root/demo-web/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) # demo-web ---
[INFO] Changes detected - recompiling the module!
[INFO]
[INFO] --- maven-surefire-plugin:2.22.2:test (default-test) # demo-web ---
[INFO]
[INFO] --- maven-jar-plugin:3.2.0:jar (default-jar) # demo-web ---
[INFO] Building jar: /Users/admin/repo#jin/demo-root/demo-web/target/demo-project.jar
[INFO]
[INFO] --- spring-boot-maven-plugin:2.5.6:repackage (repackage) # demo-web ---
[INFO] Replacing main artifact with repackaged archive
[INFO]
[INFO] --- maven-dependency-plugin:3.1.2:copy (copy) # demo-web ---
[INFO] Configured Artifact: org.example:demo-web:?:jar
[INFO] Copying demo-project.jar to /Users/admin/repo#jin/demo-root/target/demo-project.jar
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for demo-root 1.0-SNAPSHOT:
[INFO]
[INFO] demo-root .......................................... SUCCESS [ 1.366 s]
[INFO] demo-web ........................................... SUCCESS [ 3.800 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.653 s
[INFO] Finished at: 2021-10-26T00:48:13+08:00
[INFO] ------------------------------------------------------------------------
If I replace the ${revision} to '1.0-SNAPSHOT', it works well, and I can get a .jar file under the root's target dir.
Here is the build log:
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] demo-root
[INFO] demo-web
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building demo-root 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) # demo-root ---
[INFO] Deleting /Users/admin/repo#jin/demo-root/target
[INFO]
[INFO] --- flatten-maven-plugin:1.2.2:clean (flatten.clean) # demo-root ---
[INFO] Deleting /Users/admin/repo#jin/demo-root/.flattened-pom.xml
[INFO]
[INFO] --- flatten-maven-plugin:1.2.2:flatten (flatten) # demo-root ---
[INFO] Generating flattened POM of project org.example:demo-root:pom:1.0-SNAPSHOT...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building demo-web 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) # demo-web ---
[INFO] Deleting /Users/admin/repo#jin/demo-root/demo-web/target
[INFO]
[INFO] --- flatten-maven-plugin:1.2.2:clean (flatten.clean) # demo-web ---
[INFO] Deleting /Users/admin/repo#jin/demo-root/demo-web/.flattened-pom.xml
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) # demo-web ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 0 resource
[INFO] Copying 0 resource
[INFO]
[INFO] --- flatten-maven-plugin:1.2.2:flatten (flatten) # demo-web ---
[INFO] Generating flattened POM of project org.example:demo-web:jar:1.0-SNAPSHOT...
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) # demo-web ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /Users/admin/repo#jin/demo-root/demo-web/target/classes
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) # demo-web ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] skip non existing resourceDirectory /Users/admin/repo#jin/demo-root/demo-web/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) # demo-web ---
[INFO] Changes detected - recompiling the module!
[INFO]
[INFO] --- maven-surefire-plugin:2.22.2:test (default-test) # demo-web ---
[INFO]
[INFO] --- maven-jar-plugin:3.2.0:jar (default-jar) # demo-web ---
[INFO] Building jar: /Users/admin/repo#jin/demo-root/demo-web/target/demo-project.jar
[INFO]
[INFO] --- spring-boot-maven-plugin:2.5.6:repackage (repackage) # demo-web ---
[INFO] Replacing main artifact with repackaged archive
[INFO]
[INFO] --- maven-dependency-plugin:3.1.2:copy (copy) # demo-web ---
[INFO] Configured Artifact: org.example:demo-web:?:jar
[INFO] Copying demo-project.jar to /Users/admin/repo#jin/demo-root/target/demo-project.jar
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] demo-root .......................................... SUCCESS [ 1.110 s]
[INFO] demo-web ........................................... SUCCESS [ 3.545 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.562 s
[INFO] Finished at: 2021-10-26T00:51:36+08:00
[INFO] Final Memory: 29M/104M
[INFO] ------------------------------------------------------------------------
So, the problem is happened with 3 pre-condition:
1、use maven-dependency-plugin to copy the module .jar file to the root dir.
2、use the ${revision} placeholder to the version tag.
3、run mvn clean package command in maven 3.3.9
How can I fix this problem when I can't change the maven version(cause the 3.3.9's a company version, change it make a lot of effect). And still want to copy the .jar to the root dir(cause the jenkins script is a company specification). And keep the ${revision} benefit to multi-version control.
If you really cannot change the Maven version, I would no use the ${revision} and instead add the versions directly.
You can then update all versions in a project by calling mvn versions:set -DnewVersion=1.2.3-SNAPSHOT

JACoCo/surefire-plugin does not find tests to run

All my tests are located in src/test/java/... with java marked as a test source folder. They are also all named as ***Test so Surefire plugin should be finding them.
However my maven verify fails as all my test coverage is at 0%. I have 20 tests which should cover all of my non-excluded classes and they all pass when I do run them in my IntelliJ. When I run maven test or maven verify my tests aren't being run. I'm not sure why.
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.6</version>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>default-report</id>
<goals>
<goal>report</goal>
</goals>
</execution>
<execution>
<id>jacoco-check</id>
<goals>
<goal>check</goal>
</goals>
<configuration>
<excludes>
...
</excludes>
<rules>
<rule>
<element>CLASS</element>
<limits>
<limit>
<counter>LINE</counter>
<value>COVEREDRATIO</value>
<minimum>80%</minimum>
</limit>
<limit>
<counter>BRANCH</counter>
<value>COVEREDRATIO</value>
<minimum>80%</minimum>
</limit>
</limits>
</rule>
</rules>
</configuration>
</execution>
<execution>
<id>report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
</plugin>
----------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- jacoco-maven-plugin:0.8.6:prepare-agent (default-prepare-agent) # *-*-service ---
[INFO] surefireArgLine set to "-javaagent:C:\\Users\\*\\.m2\\repository\\org\\jacoco\\org.jacoco.agent\\0.8.6\\org.jacoco.agent-0.8.6-runtime.jar=destfile=C:\\Users\\*\\OneDrive\\Documents\\IntelliJ Projects\\*-*-service\\*-*-service\\target\\jacoco.exec,append=true"
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) # *-*-service ---
[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) # *-*-service ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) # *-*-service ---
[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\*\OneDrive\Documents\IntelliJ Projects\*-*-service\*-*-service\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) # *-*-service ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:3.0.0-M5:test (default-test) # *-*-service ---
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[ERROR] Java HotSpot(TM) 64-Bit Server VM warning: Options -Xverify:none and -noverify were deprecated in JDK 13 and will likely be removed in a future release.
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO]
[INFO] --- jacoco-maven-plugin:0.8.6:report (report) # *-*-service ---
[INFO] Loading execution data file C:\Users\*\OneDrive\Documents\IntelliJ Projects\*-*-service\*-*-service\target\jacoco.exec
[INFO] Analyzed bundle '*-*-service' with 19 classes
[INFO]
[INFO] --- maven-jar-plugin:3.2.0:jar (default-jar) # *-*-service ---
[INFO]
[INFO] --- spring-boot-maven-plugin:2.4.4:repackage (repackage) # *-*-service ---
[INFO] Replacing main artifact with repackaged archive
[INFO]
[INFO] --- jacoco-maven-plugin:0.8.6:report (default-report) # *-*-service ---
[INFO] Loading execution data file C:\Users\*\OneDrive\Documents\IntelliJ Projects\*-*-service\*-*-service\target\jacoco.exec
[INFO] Analyzed bundle '*-*-service' with 19 classes
[INFO]
[INFO] --- jacoco-maven-plugin:0.8.6:check (jacoco-check) # *-*-service ---
[INFO] Loading execution data file C:\Users\*\OneDrive\Documents\IntelliJ Projects\*-*-service\*-*-service\target\jacoco.exec
[INFO] Analyzed bundle '*-*-service' with 6 classes
[WARNING] Rule violated for class com.*.**.mapper.*Mapper: lines covered ratio is 0.00, but expected minimum is 0.80
[WARNING] Rule violated for class com.*.**.mapper.*Mapper: branches covered ratio is 0.00, but expected minimum is 0.80
[WARNING] Rule violated for class com.*.**.mapper.*Mapper: lines covered ratio is 0.00, but expected minimum is 0.80
[WARNING] Rule violated for class com.*.**.controller.*Controller: lines covered ratio is 0.00, but expected minimum is 0.80
[WARNING] Rule violated for class com.*.**.controller.*Controller: lines covered ratio is 0.00, but expected minimum is 0.80
[WARNING] Rule violated for class com.*.**.service.*Service: lines covered ratio is 0.00, but expected minimum is 0.80
[WARNING] Rule violated for class com.*.**.service.*Service: lines covered ratio is 0.00, but expected minimum is 0.80
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.388 s
[INFO] Finished at: 2021-04-11T19:48:54+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.jacoco:jacoco-maven-plugin:0.8.6:check (jacoco-check) on project *-*-service: Coverage checks have not been met. See log for details. -> [Help 1]
I am using IntelliJ-IDEA ultimate version 2021.1 (Latest at post date )
Any help on getting my tests recognised in a full maven build would be greatly appreciated. Thanks
Please read the log, and check [ERROR].
You are using JDK 13 and some POM added -Xverify:none and -noverify in the configuration parameter argLine.

frontend-maven-plugin executed twice

frontend-maven-plugin is getting executed twice when i issue the followign command -
mvn clean install package -DenvType=local2
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>
<groupId>com.awpl</groupId>
<artifactId>pva-nb-uw-ui</artifactId>
<packaging>war</packaging>
<version>0.2.0</version>
<profiles>
<profile>
<id>local</id>
<activation>
<property>
<name>envType</name>
<value>local</value>
</property>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<envType>local</envType>
</properties>
</profile>
<profile>
<id>local2</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<envType>local2</envType>
</properties>
</profile>
<profile>
<id>dev</id>
<activation>
<property>
<name>envType</name>
<value>dev</value>
</property>
</activation>
<properties>
<envType>dev</envType>
</properties>
</profile>
<profile>
<id>sit</id>
<activation>
<property>
<name>envType</name>
<value>sit</value>
</property>
</activation>
<properties>
<envType>sit</envType>
</properties>
</profile>
<profile>
<id>uat</id>
<activation>
<property>
<name>envType</name>
<value>uat</value>
</property>
</activation>
<properties>
<envType>uat</envType>
</properties>
</profile>
</profiles>
<build>
<finalName>pva-ui-webapp</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.4</version>
<!-- <configuration> <installDirectory>target</installDirectory>
</configuration> -->
<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<nodeVersion>v6.10.0</nodeVersion>
<npmVersion>3.10.10</npmVersion>
</configuration>
</execution>
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<arguments>install</arguments>
</configuration>
</execution>
<execution>
<id>bower install</id>
<goals>
<goal>bower</goal>
</goals>
<configuration>
<arguments>install</arguments>
</configuration>
</execution>
<execution>
<id>gulp build</id>
<goals>
<goal>gulp</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<arguments>optimize --env ${envType}</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
The output of the command --
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building artifactname 0.2.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # artifactname ---
[INFO] Deleting D:\Softwares\workspace_eclipse\artifactname\target
[INFO]
[INFO] --- frontend-maven-plugin:1.4:install-node-and-npm (install node and npm) # artifactname ---
[INFO] Node v6.10.0 is already installed.
[INFO] NPM 3.10.10 is already installed.
[INFO]
[INFO] --- frontend-maven-plugin:1.4:npm (npm install) # artifactname ---
[INFO] Running 'npm install' in D:\Softwares\workspace_eclipse\artifactname
[WARNING] npm WARN artifactname#0.2.0 No repository field.
[INFO]
[INFO] --- frontend-maven-plugin:1.4:bower (bower install) # artifactname ---
[INFO] Running 'bower install' in D:\Softwares\workspace_eclipse\artifactname
[INFO]
[INFO] --- frontend-maven-plugin:1.4:gulp (gulp build) # artifactname ---
[INFO] Running 'gulp optimize --env local2' in D:\Softwares\workspace_eclipse\artifactname
[INFO] [10:50:06] Using gulpfile D:\Softwares\workspace_eclipse\artifactname\gulpfile.js
[INFO] [10:50:06] Starting 'lintjs'...
[INFO] [10:50:06] Analyzing JS files
[INFO] [10:50:06] Starting 'linthtml'...
[INFO] [10:50:06] Analyzing HTML files
[INFO] [10:50:06] Starting 'lintcss'...
[INFO] [10:50:06] Analyzing CSS files
[INFO] [10:50:06] Starting 'lintjson'...
[INFO] [10:50:06] Analyzing JSON files
[INFO] [10:50:06] Starting 'clean'...
[INFO] [10:50:06] cleaning ./src/main/webapp/js/,./src/main/webapp/fonts/,./src/main/webapp/resources/,./src/main/webapp/styles/,./src/main/webapp/index.html,./src/main/webapp/rev-manifest.json,./.tmp/
[ERROR] The rule `angular/service-name` will be split up to different rules in the next version. Please read the docs for more information
[INFO] [10:50:07] Finished 'clean' after 1.13 s
[INFO] [10:50:07] Starting 'jsoncopy'...
[INFO] [10:50:07] copying and minifying json resources
[INFO] [10:50:10] Finished 'lintcss' after 3.37 s
[INFO] [10:51:12] Finished 'lintjson' after 1.1 min
[INFO] [10:51:13] Finished 'jsoncopy' after 1.08 min
[INFO] [10:51:13] Starting 'htmlcopy'...
[INFO] [10:51:13] copying html files for making it ready for templatecache
[INFO] [10:51:14] Finished 'linthtml' after 1.12 min
[INFO] [10:51:16] Finished 'lintjs' after 1.17 min
[INFO] [10:51:16] Starting 'wireindex'...
[INFO] [10:51:16] Linking all js/css files into index.html
[INFO] [10:51:17] gulp-inject 100 files into index.html.
[INFO] [10:51:17] gulp-inject 3 files into index.html.
[INFO] [10:51:17] Finished 'wireindex' after 705 ms
[INFO] [10:51:17] Finished 'htmlcopy' after 3.21 s
[INFO] [10:51:17] Starting 'fontscopy'...
[INFO] [10:51:17] copying bootstrap and other fonts
[INFO] [10:51:17] Finished 'fontscopy' after 224 ms
[INFO] [10:51:17] Starting 'templatecache'...
[INFO] [10:51:17] creating AngularJS $templateCache
[INFO] [10:51:18] Finished 'templatecache' after 824 ms
[INFO] [10:51:18] Starting 'optimize'...
[INFO] [10:51:18] optimizing the js/html/css files
[INFO] [10:51:19] gulp-inject 1 files into index.html.
[INFO] [10:51:31] Finished 'optimize' after 13 s
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # artifactname ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory D:\Softwares\workspace_eclipse\artifactname\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.6.1:compile (default-compile) # artifactname ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # artifactname ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory D:\Softwares\workspace_eclipse\artifactname\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.6.1:testCompile (default-testCompile) # artifactname ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # artifactname ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-war-plugin:2.2:war (default-war) # artifactname ---
[INFO] Packaging webapp
[INFO] Assembling webapp [artifactname] in [D:\Softwares\workspace_eclipse\artifactname\target\pva-ui-webapp]
[INFO] Processing war project
[INFO] Copying webapp resources [D:\Softwares\workspace_eclipse\artifactname\src\main\webapp]
[INFO] Webapp assembled in [600 msecs]
[INFO] Building war: D:\Softwares\workspace_eclipse\artifactname\target\pva-ui-webapp.war
[INFO] WEB-INF\web.xml already added, skipping
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) # artifactname ---
[INFO] Installing D:\Softwares\workspace_eclipse\artifactname\target\pva-ui-webapp.war to C:\Users\Admin\.m2\repository\com\mycompany\artifactname\0.2.0\artifactname-0.2.0.war
[INFO] Installing D:\Softwares\workspace_eclipse\artifactname\pom.xml to C:\Users\Admin\.m2\repository\com\mycompany\artifactname\0.2.0\artifactname-0.2.0.pom
[INFO]
[INFO] --- frontend-maven-plugin:1.4:install-node-and-npm (install node and npm) # artifactname ---
[INFO] Node v6.10.0 is already installed.
[INFO] NPM 3.10.10 is already installed.
[INFO]
[INFO] --- frontend-maven-plugin:1.4:npm (npm install) # artifactname ---
[INFO] Running 'npm install' in D:\Softwares\workspace_eclipse\artifactname
[WARNING] npm WARN artifactname#0.2.0 No repository field.
[INFO]
[INFO] --- frontend-maven-plugin:1.4:bower (bower install) # artifactname ---
[INFO] Running 'bower install' in D:\Softwares\workspace_eclipse\artifactname
[INFO]
[INFO] --- frontend-maven-plugin:1.4:gulp (gulp build) # artifactname ---
[INFO] Running 'gulp optimize --env local2' in D:\Softwares\workspace_eclipse\artifactname
[INFO] [10:51:48] Using gulpfile D:\Softwares\workspace_eclipse\artifactname\gulpfile.js
[INFO] [10:51:48] Starting 'lintjs'...
[INFO] [10:51:48] Analyzing JS files
[INFO] [10:51:49] Starting 'linthtml'...
[INFO] [10:51:49] Analyzing HTML files
[INFO] [10:51:49] Starting 'lintcss'...
[INFO] [10:51:49] Analyzing CSS files
[INFO] [10:51:49] Starting 'lintjson'...
[INFO] [10:51:49] Analyzing JSON files
[INFO] [10:51:49] Starting 'clean'...
[INFO] [10:51:49] cleaning ./src/main/webapp/js/,./src/main/webapp/fonts/,./src/main/webapp/resources/,./src/main/webapp/styles/,./src/main/webapp/index.html,./src/main/webapp/rev-manifest.json,./.tmp/
[ERROR] The rule `angular/service-name` will be split up to different rules in the next version. Please read the docs for more information
[INFO] [10:51:50] Finished 'clean' after 1.05 s
[INFO] [10:51:50] Starting 'jsoncopy'...
[INFO] [10:51:50] copying and minifying json resources
[INFO] [10:51:52] Finished 'lintcss' after 3.29 s
[INFO] [10:52:56] Finished 'lintjson' after 1.12 min
[INFO] [10:52:58] Finished 'jsoncopy' after 1.12 min
[INFO] [10:52:58] Starting 'htmlcopy'...
[INFO] [10:52:58] copying html files for making it ready for templatecache
[INFO] [10:52:58] Finished 'linthtml' after 1.13 min
[INFO] [10:53:00] Finished 'lintjs' after 1.18 min
[INFO] [10:53:00] Starting 'wireindex'...
[INFO] [10:53:00] Linking all js/css files into index.html
[INFO] [10:53:01] gulp-inject 100 files into index.html.
[INFO] [10:53:01] gulp-inject 3 files into index.html.
[INFO] [10:53:01] Finished 'wireindex' after 568 ms
[INFO] [10:53:01] Finished 'htmlcopy' after 3.04 s
[INFO] [10:53:01] Starting 'fontscopy'...
[INFO] [10:53:01] copying bootstrap and other fonts
[INFO] [10:53:01] Finished 'fontscopy' after 182 ms
[INFO] [10:53:01] Starting 'templatecache'...
[INFO] [10:53:01] creating AngularJS $templateCache
[INFO] [10:53:02] Finished 'templatecache' after 805 ms
[INFO] [10:53:02] Starting 'optimize'...
[INFO] [10:53:02] optimizing the js/html/css files
[INFO] [10:53:02] gulp-inject 1 files into index.html.
[INFO] [10:53:15] Finished 'optimize' after 13 s
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # artifactname ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory D:\Softwares\workspace_eclipse\artifactname\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.6.1:compile (default-compile) # artifactname ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # artifactname ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory D:\Softwares\workspace_eclipse\artifactname\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.6.1:testCompile (default-testCompile) # artifactname ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # artifactname ---
[INFO] No tests to run.
[INFO] Skipping execution of surefire because it has already been run for this configuration
[INFO]
[INFO] --- maven-war-plugin:2.2:war (default-war) # artifactname ---
[INFO] Packaging webapp
[INFO] Assembling webapp [artifactname] in [D:\Softwares\workspace_eclipse\artifactname\target\pva-ui-webapp]
[INFO] Processing war project
[INFO] Copying webapp resources [D:\Softwares\workspace_eclipse\artifactname\src\main\webapp]
[INFO] Webapp assembled in [312 msecs]
[INFO] Building war: D:\Softwares\workspace_eclipse\artifactname\target\pva-ui-webapp.war
[INFO] WEB-INF\web.xml already added, skipping
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 03:27 min
[INFO] Finished at: 2017-07-19T10:53:15+05:30
[INFO] Final Memory: 12M/122M
[INFO] ------------------------------------------------------------------------
Notice that the frontend-maven-plugin is executed twice. This almost doubles up the build time.
How do I make it run only once?
You are getting multiple executions because you have specified multiple default lifecycle phases on the command line:
mvn clean install package -DenvType=local2
This will:
run the clean lifecycle;
run the default lifecycle up to and including install (which includes package);
run the default lifecycle again up to and including package.
Please see Introduction to the Build Lifecycle for more information.

Maven GAE Failed to execute goal com.google.appengine:appengine-maven-plugin:1.9.12:devserver [...] NoSuchElementException

Maven is having this problem and none of the solutions I found worked :(.
pom.xml
https://github.com/Brkk/text-share/blob/master/pom.xml
web.xml
https://github.com/Brkk/text-share/blob/master/src/main/webapp/WEB-INF/web.xml
Maven is generating
[INFO] Scanning for projects...
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building text-share 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> appengine-maven-plugin:1.9.12:devserver (default-cli) # text-share >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # text-share ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/paulotabarro/Desktop/workspace/text-share/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # text-share ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # text-share ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/paulotabarro/Desktop/workspace/text-share/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # text-share ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # text-share ---
[INFO]
[INFO] --- maven-war-plugin:2.4:war (default-war) # text-share ---
[INFO] Packaging webapp
[INFO] Assembling webapp [text-share] in [/Users/paulotabarro/Desktop/workspace/text-share/target/text-share-1.0-SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp webResources [/Users/paulotabarro/Desktop/workspace/text-share/src/main/webapp/WEB-INF] to [/Users/paulotabarro/Desktop/workspace/text-share/target/text-share-1.0-SNAPSHOT]
[INFO] Copying webapp resources [/Users/paulotabarro/Desktop/workspace/text-share/src/main/webapp]
[INFO] Webapp assembled in [101 msecs]
[INFO] Building war: /Users/paulotabarro/Desktop/workspace/text-share/target/text-share-1.0-SNAPSHOT.war
[INFO]
[INFO] <<< appengine-maven-plugin:1.9.12:devserver (default-cli) # text-share <<<
[INFO]
[INFO] --- appengine-maven-plugin:1.9.12:devserver (default-cli) # text-share ---
[INFO]
[INFO] Google App Engine Java SDK - Running Development Server
[INFO]
[INFO] Retrieving Google App Engine Java SDK from Maven
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.692 s
[INFO] Finished at: 2014-10-14T19:12:13-08:00
[INFO] Final Memory: 16M/184M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.google.appengine:appengine-maven-plugin:1.9.12:devserver (default-cli) on project text-share: Execution default-cli of goal com.google.appengine:appengine-maven-plugin:1.9.12:devserver failed. NoSuchElementException -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
According to this page, https://code.google.com/p/appengine-maven-plugin/issues/detail?id=41 , you need to add the plugin not only in the <build><pluginManagement> section, but also in the <build><plugins> section. So you would need to extend your pom as follows:
<build>
<outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory>
<pluginManagement>
<!-- other plugins here -->
<plugin>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>1.9.12</version>
<configuration>
<enableJarClasses>false</enableJarClasses>
</configuration>
</plugin>
</pluginManagement>
<plugins>
<plugin>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

successfully building but the wsdl file not found?

i try to generate wsdl file using jaxws maven plugin
finaly:"successfully building" but my wsdl file is not generate, it is normaly in the folder \target\surefire-reports
but i don't have it after the building
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building BSCSwebservices Maven Webapp 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for com.sun.xml.stream.buffer:streambuffer:jar:0.4 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for org.jvnet.staxex:stax-ex:jar:1.0 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) # BSCSwebservices ---
[debug] execute contextualize
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 6 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) # BSCSwebservices ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) # BSCSwebservices ---
[debug] execute contextualize
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Users\sayed\workspace\BSCSwebservices\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) # BSCSwebservices ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.10:test (default-test) # BSCSwebservices ---
[INFO] Surefire report directory: C:\Users\sayed\workspace\BSCSwebservices\target\surefire-reports
T E S T S
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] --- maven-war-plugin:2.1.1:war (default-war) # BSCSwebservices ---
[INFO] Packaging webapp
[INFO] Assembling webapp [BSCSwebservices] in [C:\Users\sayed\workspace\BSCSwebservices\target\BSCSwebservices]
[INFO] Processing war project
[INFO] Copying webapp resources [C:\Users\sayed\workspace\BSCSwebservices\src\main\webapp]
[INFO] Webapp assembled in [1042 msecs]
[INFO] Building war: C:\Users\sayed\workspace\BSCSwebservices\target\BSCSwebservices.war
[WARNING] Warning: selected war files include a WEB-INF/web.xml which will be ignored
(webxml attribute is missing from war task, or ignoreWebxml attribute is specified as 'true')
[INFO]
[INFO] --- jaxws-maven-plugin:1.11:wsgen (default) # BSCSwebservices ---
warning: The apt tool and its associated API are planned to be
removed in the next major JDK release. These features have been
superseded by javac and the standardized annotation processing API,
javax.annotation.processing and javax.lang.model. Users are
recommended to migrate to the annotation processing features of
javac; see the javac man page for more information.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:30.437s
[INFO] Finished at: Fri Aug 02 23:00:03 WAT 2013
[INFO] Final Memory: 16M/40M
[INFO] ------------------------------------------------------------------------
this a part of pom.xml
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>1.11</version>
<executions>
<execution>
<configuration>
<sei>com.ws.BillingAccountRead</sei>
<genwsdl>true</genwsdl>
<keep>true</keep>
</configuration>
<phase>package</phase>
<goals>
<goal>wsgen</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
when i use mvn clean package -X
<configuration>
<destDir default-value="${project.build.outputDirectory}"/>
<extension default-value="false"/>
<genWsdl default-value="false"/>
<keep default-value="false">true</keep>
<pluginArtifactMap>${plugin.artifactMap}</pluginArtifactMap>
<pluginArtifacts>${plugin.artifacts}</pluginArtifacts>
<project>${project}</project>
<resourceDestDir default-value="${project.build.directory}/jaxws/wsgen/wsdl"/>
<sei>com.ws.BillingAccountRead</sei>
<verbose default-value="false">true</verbose>
</configuration>
I would think you would want to build the wsdl in the 'generate-sources' phase or maybe 'generate-resources' instead of 'package'
It is supposed to generate the wsdl in ${resourceDestDir}
Configure it like below with verbose = true, and execute the mvn command with -X flag, then look the maven log carefully.
<executions>
<execution>
<configuration>
<sei>com.ws.BillingAccountRead</sei>
<genwsdl>true</genwsdl>
<keep>true</keep>
<verbose>true</verbose>
</configuration>
<phase>package</phase>
<goals>
<goal>wsgen</goal>
</goals>
</execution>
</executions>
Try to build using -X or -e to get more info from the log

Categories

Resources