Maven compile error ProjectBuildingException - maven

I'm trying to compile with maven a specific snapshot of Apache log4j.
I obtain this error:
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[ERROR] The build could not read 1 project -> [Help 1]
org.apache.maven.project.ProjectBuildingException: Some problems were encountered while processing the POMs:
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-resources-plugin is missing. # line 89, column 15
[ERROR] 'build.plugins.plugin[org.apache.maven.plugins:maven-antrun-plugin].dependencies.dependency.scope' for junit:junit:jar must be one of [compile, runtime, system] but is 'test'. # line 321, column 20
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:416)
at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:663)
at org.apache.maven.DefaultMaven.getProjectsForMavenReactor(DefaultMaven.java:654)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:243)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:582)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[ERROR]
[ERROR] The project log4j:log4j:1.2.17-SNAPSHOT (/scratch/test/log4j/code/pom.xml) has 1 error
[ERROR] 'build.plugins.plugin[org.apache.maven.plugins:maven-antrun-plugin].dependencies.dependency.scope' for junit:junit:jar must be one of [compile, runtime, system] but is 'test'. # line 321, column 20
[ERROR]
[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/ProjectBuildingException
This is the POM file:
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!--
Usage notes:
To build NTEventLogAppender.dll using MinGW, place mingw\bin on path for Windows or install mingw
package on other platforms. Build will execute gcc and windres on Windows and
i586-mingw32msvc-gcc and i586-mingw32msvc-windres on other platforms.
To build NTEventLogAppender.dll using Microsoft tools, run the appropriate vcvars for the
target platform and specify -Dntdll_target=msbuild on the mvn command line.
-->
<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>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<packaging>bundle</packaging>
<name>Apache Log4j</name>
<version>1.2.17-SNAPSHOT</version>
<description>Apache Log4j 1.2</description>
<url>http://logging.apache.org/log4j/1.2/</url>
<issueManagement>
<system>Bugzilla</system>
<url>http://issues.apache.org/bugzilla/</url>
</issueManagement>
<ciManagement>
<system>Gump</system>
<url>http://vmgump.apache.org/gump/public/logging-log4j-12/logging-log4j-12/index.html</url>
</ciManagement>
<inceptionYear>1999</inceptionYear>
<mailingLists>
<mailingList>
<name>log4j-user</name>
<subscribe>log4j-user-subscribe#logging.apache.org</subscribe>
<unsubscribe>log4j-user-unsubscribe#logging.apache.org</unsubscribe>
<post>log4j-user#logging.apache.org</post>
<archive>http://mail-archives.apache.org/mod_mbox/logging-log4j-user/</archive>
<otherArchives>
<otherArchive>http://marc.info/?l=log4j-user</otherArchive>
<otherArchive>http://dir.gmane.org/gmane.comp.jakarta.log4j.user</otherArchive>
</otherArchives>
</mailingList>
<mailingList>
<name>log4j-dev</name>
<subscribe>log4j-dev-subscribe#logging.apache.org</subscribe>
<unsubscribe>log4j-dev-unsubscribe#logging.apache.org</unsubscribe>
<post>log4j-dev#logging.apache.org</post>
<archive>http://mail-archives.apache.org/mod_mbox/logging-log4j-dev/</archive>
<otherArchives>
<otherArchive>http://marc.info/?l=log4j-dev</otherArchive>
<otherArchive>http://dir.gmane.org/gmane.comp.jakarta.log4j.devel</otherArchive>
</otherArchives>
</mailingList>
</mailingLists>
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/logging/log4j/trunk</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/logging/log4j/trunk</developerConnection>
<url>http://svn.apache.org/viewvc/logging/log4j/trunk</url>
</scm>
<organization>
<name>Apache Software Foundation</name>
<url>http://www.apache.org</url>
</organization>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.5</version>
<configuration>
<workingDirectory>tests</workingDirectory>
<reportFormat>plain</reportFormat>
<forkMode>pertest</forkMode>
<skip>true</skip>
<includes>
<include>org/apache/log4j/LevelTest.java</include>
<include>org/apache/log4j/PriorityTest.java</include>
<include>org/apache/log4j/CategoryTest.java</include>
<include>org/apache/log4j/FileAppenderTest.java</include>
<include>org/apache/log4j/LogManagerTest.java</include>
<include>org/apache/log4j/helpers.LogLogTest.java</include>
<include>org/apache/log4j/LayoutTest.java</include>
<include>org/apache/log4j/helpers.DateLayoutTest.java</include>
<include>org/apache/log4j/TTCCLayoutTest.java</include>
<include>org/apache/log4j/xml.XMLLayoutTest.java</include>
<include>org/apache/log4j/HTMLLayoutTest.java</include>
<include>org/apache/log4j/PatternLayoutTest.java</include>
<include>org/apache/log4j/spi.LoggingEventTest.java</include>
<include>org/apache/log4j/spi.ThrowableInformationTest.java</include>
<include>org/apache/log4j/spi.LocationInfoTest.java</include>
<include>org/apache/log4j/PropertyConfiguratorTest.java</include>
<include>org/apache/log4j/MinimumTestCase.java</include>
<include>org/apache/log4j/LoggerTestCase.java</include>
<include>org/apache/log4j/PatternLayoutTestCase.java</include>
<include>org/apache/log4j/HierarchyThresholdTestCase.java</include>
<include>org/apache/log4j/xml/DOMTestCase.java</include>
<include>org/apache/log4j/xml/CustomLevelTestCase.java</include>
<include>org/apache/log4j/customLogger/XLoggerTestCase.java</include>
<!-- DefaultInit -->
<!-- SocketServer -->
<include>org/apache/log4j/xml/XMLLayoutTestCase.java</include>
<include>org/apache/log4j/xml/AsyncAppenderTestCase.java</include>
<include>org/apache/log4j/varia/LevelMatchFilterTestCase.java</include>
<!-- ErrorHandlerTestCase is not run in Ant build either
<include>org/apache/log4j/varia/ErrorHandlerTestCase.java</include>
-->
<!-- include>org/apache/log4j/helpers/OptionConverterTestCase.java</include -->
<include>org/apache/log4j/helpers/BoundedFIFOTestCase.java</include>
<include>org/apache/log4j/helpers/CyclicBufferTestCase.java</include>
<include>org/apache/log4j/helpers/PatternParserTestCase.java</include>
<include>org/apache/log4j/or/ORTestCase.java</include>
<include>org/apache/log4j/DRFATestCase.java</include>
<include>org/apache/log4j/RFATestCase.java</include>
<include>org/apache/log4j/varia/ERFATestCase.java</include>
<include>org/apache/log4j/net/SyslogAppenderTest</include>
<include>org/apache/log4j/nt/NTEventLogAppenderTest</include>
<include>org/apache/log4j/net/SocketAppenderTest</include>
</includes>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.1</version>
<configuration>
<source>1.3</source>
<target>1.1</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3</version>
<configuration>
<archive>
<manifestSections>
<manifestSection>
<name>org.apache.log4j</name>
<manifestEntries>
<DynamicImport-Package>*</DynamicImport-Package>
<Implementation-Title>log4j</Implementation-Title>
<Implementation-Version>${project.version}</Implementation-Version>
<Implementation-Vendor>"Apache Software Foundation"</Implementation-Vendor>
</manifestEntries>
</manifestSection>
</manifestSections>
</archive>
</configuration>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.2</version>
<executions>
<!-- generate NTEventLogAppender.dll -->
<execution>
<phase>process-classes</phase>
<id>ntdll</id>
<configuration>
<tasks>
<ant antfile="src/ntdll/build.xml" target="${ntdll_target}">
<property name="target.dir" location="target" />
<property name="classes.dir" location="target/classes" />
<property name="src.dir" location="src/ntdll" />
<property name="jni.include.dir" location="${java.home}/../include" />
</ant>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<!-- create tests/output prior to test run -->
<execution>
<phase>test-compile</phase>
<id>mkdir_tests_output</id>
<configuration>
<tasks>
<mkdir dir="tests/output" />
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<phase>clean</phase>
<id>rmdir_tests_output</id>
<configuration>
<tasks>
<delete dir="tests/output" />
<delete dir="tests/classes" />
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<phase>test</phase>
<id>runAll</id>
<configuration>
<tasks>
<ant dir="tests" target="runAll">
<property name="m2_repo" location="${m2_repo}" />
<property name="log4j.jar" location="target/classes" />
<property name="project.lib.home" location="target" />
</ant>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<!-- release builds will put SVN tags into the SCM page, this changes it back to trunk -->
<execution>
<phase>site</phase>
<id>untag-site</id>
<configuration>
<tasks>
<taskdef name="replaceregexp" classname="org.apache.tools.ant.taskdefs.optional.ReplaceRegExp" />
<replaceregexp file="target/site/source-repository.html" match="/tags/[^ "'<]*" replace="/trunk" flags="g" />
<replaceregexp match="-- Generated by (.*) on .*--" replace="-- Generated by \1 --" flags="g">
<fileset dir="target/site/apidocs" includes="**/*.html" />
</replaceregexp>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<phase>post-site</phase>
<id>post-site</id>
<configuration>
<tasks>
<ant target="post-site" />
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<phase>site-deploy</phase>
<id>site-deploy</id>
<configuration>
<tasks>
<ant target="site-deploy" />
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<id>javadoc.resources</id>
<phase>generate-sources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<copy todir="${project.build.directory}/apidocs/META-INF">
<fileset dir="${basedir}">
<include name="LICENSE" />
<include name="NOTICE" />
</fileset>
</copy>
</tasks>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>ant</groupId>
<artifactId>ant-nodeps</artifactId>
<version>1.6.5</version>
</dependency>
<dependency>
<groupId>ant-contrib</groupId>
<artifactId>ant-contrib</artifactId>
<version>1.0b2</version>
</dependency>
<dependency>
<groupId>ant</groupId>
<artifactId>ant-junit</artifactId>
<version>1.6.5</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>sun.jdk</groupId>
<artifactId>tools</artifactId>
<version>1.4.2</version>
<scope>system</scope>
<systemPath>${tools.jar}</systemPath>
</dependency>
</dependencies>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-5</version>
<configuration>
<descriptors>
<descriptor>src/assembly/bin.xml</descriptor>
</descriptors>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
<executions>
<execution>
<goals>
<goal>assembly</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.7</version>
<configuration>
<docfilessubdirs>true</docfilessubdirs>
<excludedocfilessubdir>.svn</excludedocfilessubdir>
<encoding>UTF-8</encoding>
<docEncoding>UTF-8</docEncoding>
</configuration>
<executions>
<execution>
<goals>
<goal>jar</goal>
<goal>javadoc</goal>
</goals>
</execution>
<execution>
<id>site</id>
<phase>pre-site</phase>
<goals>
<goal>javadoc</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>2.0-beta-9</version>
<!--
Bug MRELEASE-273 has been throwing NPE during release:perform,
typically after deploy so this places it last.
-->
<configuration>
<goals>package site-deploy assembly:attached deploy</goals>
</configuration>
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>2.1.1</version>
<executions>
<execution>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<!--
clirr:check will fail with NullPointerException
due to missing javax.jms.MessageListener,
however it will trigger download of supporting components
which can allow "ant clirr" to succeed.
Could possibly run on a JavaEE platform.
-->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>clirr-maven-plugin</artifactId>
<version>2.2.2</version>
<configuration>
<comparisonVersion>1.2.15</comparisonVersion>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>rat-maven-plugin</artifactId>
<version>1.0-alpha-3</version>
<configuration>
<excludes>
<exclude>tests/witness/**</exclude>
<exclude>tests/output/**</exclude>
<exclude>tests/classes/**</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.1.0</version>
<extensions>true</extensions>
<configuration>
<instructions>
<!-- omit chainsaw and LF5 -->
<Export-Package>!org.apache.log4j.lf5.*,
!org.apache.log4j.chainsaw.*,
org.apache.log4j.*;version=1.2.17;-noimport:=true</Export-Package>
<!-- all other potential imports are covered by DynamicImport-Package earlier -->
<Import-Package>!javax.swing.*,
!com.ibm.uvm.tools.*,
!com.sun.jdmk.comm.*,
javax.jmdns.*;resolution:=optional,
javax.jms.*;resolution:=optional,
javax.mail.*;resolution:=optional,
*</Import-Package>
<Bundle-DocURL>http://logging.apache.org/log4j/1.2</Bundle-DocURL>
</instructions>
</configuration>
</plugin>
</plugins>
<testSourceDirectory>tests/src/java</testSourceDirectory>
<testResources>
<testResource>
<directory>tests/resources</directory>
</testResource>
</testResources>
</build>
<profiles>
<profile>
<id>mac</id>
<activation>
<os>
<family>mac</family>
</os>
</activation>
<properties>
<tools.jar>${java.home}/../Classes/classes.jar</tools.jar>
<m2_repo>${user.home}/.m2/repository</m2_repo>
<ntdll_target>build</ntdll_target>
</properties>
</profile>
<profile>
<id>default</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<tools.jar>${java.home}/../lib/tools.jar</tools.jar>
<m2_repo>${user.home}/.m2/repository</m2_repo>
<ntdll_target>build</ntdll_target>
</properties>
</profile>
</profiles>
<repositories>
<repository>
<id>maven2-repository.dev.java.net</id>
<name>Java.net Repository for Maven</name>
<url>http://download.java.net/maven/2/</url>
<layout>default</layout>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4.3</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.openejb</groupId>
<artifactId>javaee-api</artifactId>
<version>5.0-2</version>
<type>jar</type>
<scope>provided</scope>
</dependency>
<!-- the following dependency is not needed on JDK 1.5 and higher
<dependency>
<groupId>com.sun.jmx</groupId>
<artifactId>jmxri</artifactId>
<version>1.2.1</version>
<optional>true</optional>
</dependency>
-->
<dependency>
<groupId>oro</groupId>
<artifactId>oro</artifactId>
<version>2.0.8</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jms_1.1_spec</artifactId>
<version>1.0</version>
<optional>true</optional>
</dependency>
</dependencies>
<reporting>
<excludeDefaults>true</excludeDefaults>
<plugins>
<plugin>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.1.2</version>
<reportSets>
<reportSet>
<reports>
<report>scm</report>
<report>dependencies</report>
<report>cim</report>
<report>issue-tracking</report>
<report>mailing-list</report>
<report>license</report>
</reports>
</reportSet>
</reportSets>
</plugin>
<plugin>
<artifactId>maven-jxr-plugin</artifactId>
<version>2.1</version>
</plugin>
<plugin>
<artifactId>maven-changes-plugin</artifactId>
<version>2.3</version>
<reportSets>
<reportSet>
<reports>
<report>changes-report</report>
</reports>
</reportSet>
</reportSets>
<configuration>
<issueLinkTemplate>%URL%/show_bug.cgi?id=%ISSUE%</issueLinkTemplate>
</configuration>
</plugin>
</plugins>
</reporting>
<distributionManagement>
<repository>
<id>logging.repo</id>
<url>scp://people.apache.org/www/people.apache.org/builds/logging/repo/</url>
</repository>
<site>
<id>logging.site</id>
<url>scp://localhost/${user.dir}/target/site-deploy</url>
</site>
</distributionManagement>
</project>
What do you think is the cause of the problem? Is the pom file malformed? Are there some unresolved dependencies?
I'm using Apache Maven 3.0.5.
Thanks.

The log4j version you are running was designed with maven2.
Try to run it with maven2.

Scope parameter for junit dependency can only have values - compile, runtime, system.
This indicates to Maven that the dependency will be provided at runtime/compile/system by its container or JDK.
Try removing scope or give valid value.

Related

Can not resolve ${project.parent.version} to download dependency

i am using/tried with following versions:
Intellij 2022.3.3 and the prev. one.
Maven 3.8.5, 3.8.4, 3.8.1
I also tried following envs:
Maven-Tool integrated into IntelliJ
IntelliJ terminal
OS terminal
And i always get this error:
[WARNING] The POM for io.swagger:swagger-annotations:jar:${project.parent.version} is missing, no dependency information available
Could not find artifact io.swagger:swagger-annotations:pom:${project.parent.version} in mirror-maven.
[INFO]
[INFO] --- openapi-generator-maven-plugin:5.1.0:generate (generate) # XXX-parent-application ---
[WARNING] The POM for io.swagger.core.v3:swagger-annotations:jar:${project.parent.version} is missing, no dependency information available
[WARNING] The POM for io.swagger.core.v3:swagger-models:jar:${project.parent.version} is missing, no dependency information available
[WARNING] The POM for io.swagger.parser.v3:swagger-parser-v2-converter:jar:${project.parent.version} is missing, no dependency information available
[WARNING] The POM for io.swagger.parser.v3:swagger-parser-v3:jar:${project.parent.version} is missing, no dependency information available
[WARNING] The POM for org.openapitools:openapi-generator-core:jar:${project.parent.version} is missing, no dependency information available
[INFO] --- swagger-maven-plugin:3.1.8:generate (default) # XXX-projectname ---
[WARNING] The POM for io.swagger:swagger-annotations:jar:${project.parent.version} is missing, no dependency information available
[WARNING] The POM for io.swagger:swagger-core:jar:${project.parent.version} is missing, no dependency information available
[WARNING] The POM for io.swagger:swagger-jaxrs:jar:${project.parent.version} is missing, no dependency information available
URL_TO_MY_CENTRAL_REPO/io/swagger/core/v3/swagger-annotations/$%7Bproject.parent.version%7D/swagger-annotations-$%7Bproject.parent.version%7D.pom
I am the only one in my team who has this issue, we checked a lot of stuff:
delete maven-repo-folder
check maven-configuration in intellij and settings.xml
insert a static version (but it does not overwrite ${project.parent.version}
yes, it does exist on our artifactory-server
fresh pull from github
So, my question is, where can i find this used property, because i cant find it anywhere in the project.
Update:
added 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>PARENT</artifactId>
<groupId>GROUP_ID_APP</groupId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<modules>
<module>application-a</module>
<module>application-b</module>
<module>application-c</module>
<module>application-d</module>
</modules>
<artifactId>PARENT-application</artifactId>
<packaging>pom</packaging>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<!--Properties for swagger generating-->
<swaggerJsonDir>${basedir}/target/generated</swaggerJsonDir>
<swaggerJsonVersion>${project.version}</swaggerJsonVersion>
<swaggerLocation>Override in child project</swaggerLocation>
<swaggerTitle>Override in child project</swaggerTitle>
<!--Override in child project with "compile"-->
<swaggerPhase>none</swaggerPhase>
<!--Properties for client generation-->
<client-generation-application-package>Override in child project</client-generation-application-package>
<sonar.exclusions>
**/foldername/**/*_generated/**/*.java
</sonar.exclusions>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<!-- Testing -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- START: added this part below to check if this may solve my problem -->
<!-- <dependency>-->
<!-- <groupId>io.swagger</groupId>-->
<!-- <artifactId>swagger-core</artifactId>-->
<!-- <version>1.6.5</version>-->
<!-- </dependency>-->
<!-- 2.1.23 -->
<!-- https://mvnrepository.com/artifact/io.swagger.core.v3/swagger-models -->
<!-- <dependency>-->
<!-- <groupId>io.swagger.core.v3</groupId>-->
<!-- <artifactId>swagger-models</artifactId>-->
<!-- <version>2.1.13</version>-->
<!-- </dependency>-->
<dependency>
<groupId>io.swagger.parser.v3</groupId>
<artifactId>swagger-parser</artifactId>
<version>2.0.30</version>
</dependency>
<dependency>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>5.4.0</version>
</dependency>
<!-- END: added this part above to check if this may solve my problem -->
</dependencies>
<build>
<plugins>
<!--Build executable jar from spring application.-->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<executable>true</executable>
</configuration>
</plugin>
<!--Generate swagger.json-->
<plugin>
<groupId>com.github.kongchen</groupId>
<artifactId>swagger-maven-plugin</artifactId>
<version>3.1.8</version>
<configuration>
<apiSources>
<apiSource>
<springmvc>true</springmvc>
<locations>
<location>${swaggerLocation}</location>
</locations>
<info>
<title>${swaggerTitle}</title>
<version>${swaggerJsonVersion}</version>
</info>
<outputFormats>json</outputFormats>
<swaggerDirectory>${swaggerJsonDir}</swaggerDirectory>
</apiSource>
</apiSources>
</configuration>
<executions>
<execution>
<phase>${swaggerPhase}</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>generate-application-b-client</id>
<properties>
<maven.test.skip>true</maven.test.skip>
<input>${project.basedir}/../application-b/target/generated/swagger.json</input>
<targetDirectory>${project.basedir}/target/application-b</targetDirectory>
<modelPackage>GROUP_ID_APP.${client-generation-application-package}.application_b_generated.model</modelPackage>
<apiPackage>GROUP_ID_APP.${client-generation-application-package}.application_b_generated.service.client</apiPackage>
<sourceDirectory>src/main/javapackagefoldername/${client-generation-application-package}</sourceDirectory>
<modelDirectory>${sourceDirectory}/application_b_generated/model</modelDirectory>
<apiDirectory>${sourceDirectory}/application_b_generated/service</apiDirectory>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>5.1.0</version>
<executions>
<execution>
<id>generate</id>
<phase>integration-test</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>${input}</inputSpec>
<output>${targetDirectory}</output>
<skipValidateSpec>true</skipValidateSpec>
<generatorName>java</generatorName>
<modelPackage>${modelPackage}</modelPackage>
<apiPackage>${apiPackage}</apiPackage>
<typeMappings>
<typeMapping>OffsetDateTime=LocalDateTime</typeMapping>
</typeMappings>
<importMappings>
<importMapping>java.time.OffsetDateTime=java.time.LocalDateTime</importMapping>
</importMappings>
<configOptions>
<modelPackage>${modelPackage}</modelPackage>
<apiPackage>${apiPackage}</apiPackage>
<dateLibrary>java8</dateLibrary>
<java8>true</java8>
<library>resttemplate</library>
</configOptions>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
<executions>
<execution>
<id>copy-models</id>
<phase>integration-test</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${modelDirectory}</outputDirectory>
<overwrite>true</overwrite>
<resources>
<resource>
<directory>${targetDirectory}/${modelDirectory}</directory>
</resource>
</resources>
</configuration>
</execution>
<execution>
<id>copy-services</id>
<phase>integration-test</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${apiDirectory}</outputDirectory>
<overwrite>true</overwrite>
<resources>
<resource>
<directory>${targetDirectory}/${apiDirectory}</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>2.5</version>
<executions>
<execution>
<id>clean-old</id>
<phase>compile</phase>
<goals>
<goal>clean</goal>
</goals>
<configuration>
<excludeDefaultDirectories>true</excludeDefaultDirectories>
<filesets>
<fileset>
<directory>${modelDirectory}</directory>
</fileset>
<fileset>
<directory>${apiDirectory}</directory>
</fileset>
</filesets>
</configuration>
</execution>
<execution>
<id>auto-clean</id>
<phase>integration-test</phase>
<goals>
<goal>clean</goal>
</goals>
<configuration>
<excludeDefaultDirectories>true</excludeDefaultDirectories>
<filesets>
<fileset>
<directory>${targetDirectory}</directory>
</fileset>
</filesets>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>generate-application-a-client</id>
<properties>
<maven.test.skip>true</maven.test.skip>
<input>${project.basedir}/../application-a/target/generated/swagger.json</input>
<targetDirectory>${project.basedir}/target/application-a</targetDirectory>
<modelPackage>GROUP_ID_APP.${client-generation-application-package}.application_a_generated.model</modelPackage>
<apiPackage>GROUP_ID_APP.${client-generation-application-package}.application_a_generated.service.client</apiPackage>
<sourceDirectory>src/main/javapackagefoldername/${client-generation-application-package}</sourceDirectory>
<modelDirectory>${sourceDirectory}/application_a_generated/model</modelDirectory>
<apiDirectory>${sourceDirectory}/application_a_generated/service</apiDirectory>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>5.1.0</version>
<executions>
<execution>
<id>generate</id>
<phase>integration-test</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>${input}</inputSpec>
<output>${targetDirectory}</output>
<skipValidateSpec>true</skipValidateSpec>
<generatorName>java</generatorName>
<modelPackage>${modelPackage}</modelPackage>
<apiPackage>${apiPackage}</apiPackage>
<typeMappings>
<typeMapping>OffsetDateTime=LocalDateTime</typeMapping>
</typeMappings>
<importMappings>
<importMapping>java.time.OffsetDateTime=java.time.LocalDateTime</importMapping>
</importMappings>
<configOptions>
<modelPackage>${modelPackage}</modelPackage>
<apiPackage>${apiPackage}</apiPackage>
<dateLibrary>java8</dateLibrary>
<java8>true</java8>
<library>resttemplate</library>
</configOptions>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
<executions>
<execution>
<id>copy-models</id>
<phase>integration-test</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${modelDirectory}</outputDirectory>
<overwrite>true</overwrite>
<resources>
<resource>
<directory>${targetDirectory}/${modelDirectory}</directory>
</resource>
</resources>
</configuration>
</execution>
<execution>
<id>copy-services</id>
<phase>integration-test</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${apiDirectory}</outputDirectory>
<overwrite>true</overwrite>
<resources>
<resource>
<directory>${targetDirectory}/${apiDirectory}</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>2.5</version>
<executions>
<execution>
<id>clean-old</id>
<phase>compile</phase>
<goals>
<goal>clean</goal>
</goals>
<configuration>
<excludeDefaultDirectories>true</excludeDefaultDirectories>
<filesets>
<fileset>
<directory>${modelDirectory}</directory>
</fileset>
<fileset>
<directory>${apiDirectory}</directory>
</fileset>
</filesets>
</configuration>
</execution>
<execution>
<id>auto-clean</id>
<phase>integration-test</phase>
<goals>
<goal>clean</goal>
</goals>
<configuration>
<excludeDefaultDirectories>true</excludeDefaultDirectories>
<filesets>
<fileset>
<directory>${targetDirectory}</directory>
</fileset>
</filesets>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Maven often doesn't resolve version number for transitive dependencies - "${project.version}"
ill post my solution there.

Parallel execution with maven-surefire-plugin is throwing PluginResolutionException

I am trying to execute my feature files via TestRunner.java files (by mentioning them in pom.xml) , in parallel using maven-surefire-plugin, for which i have set up pom.xml as below, but when i run pom.xml as maven test, its throwing PluginResolutionException when the version is 3.0.0-M3, when i have update the version to 2.19.1, the maven test is not running my feature files but the build is shown as successful
I have tried with different versions but not worked
Also I have tried replacing the configuration part with below changes
still my feature files are not executed but the build is
successful
<configuration>
<forkCount>3</forkCount>
<reuseForks>true</reuseForks>
<!--
<parallel>classes</parallel>
<forkMode>perthread</forkMode>
<threadCount>3</threadCount>
-->
<argLine>-Xmx1024m -XX:MaxPermSize=256m</argLine>
<includes>
<include>**/*TestRunner.java</include>
</includes>
</configuration>
PS: After reading the below artical
https://maven.apache.org/surefire/maven-surefire-plugin/examples/junit.html#Running_tests_in_parallel
I understand that there is link between the Junit version and surefireflugin i use in my project, bow one thing is for sure, the correct combination of Junit and maven-surefire-plugin is very much necessary, i have tried with below combinations
JUnit 4.7
plugin 3.0.0-M3
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M3</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit47</artifactId>
<version>3.0.0-M3</version>
</dependency>
</dependencies>
</plugin>
JUnit 4.12
plugin 2.20
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20</version>
<configuration>
<parallel>classes</parallel>
<threadCount>3</threadCount>
<argLine>-Xmx1024m -XX:MaxPermSize=256m</argLine>
<includes>
<include>**/*TestRunner.java</include>
</includes>
</configuration>
</plugin>
but its not helpful, I suppose i am doing mistake in choosing this versions and the config of plugin with proper parameters, please help me
My complete pom is as below
<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.practise.raja</groupId>
<artifactId>SeleniumConcepts</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit</artifactId>
<version>4.7.1</version>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-picocontainer</artifactId>
<version>4.7.1</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.5.3</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<fork>true</fork>
<executable>C:\Program Files (x86)\Java\jdk1.8.0_211\bin\javac</executable>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M3</version>
<configuration>
<parallel>classes</parallel>
<forkMode>perthread</forkMode>
<threadCount>3</threadCount>
<argLine>-Xmx1024m -XX:MaxPermSize=256m</argLine>
<includes>
<include>**/*TestRunner.java</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
</project>
Expected:
My feature files should run in parallel
Actual:
My feature files are not executed
After changing the dependencies and plugin as suggested by sureshmani, this is how it looks
Finally i am able to solve this, to my initial pom, have started doing below changes. Which ran my feature files in parallel
Change 1: I happen to add the dependency for cucumber-jvm-parallel-plugin along with plugin ,so i have deleted the plugin
Change 2: I have realized that the cucumber-jvm-parallel-plugin is not able to recognize the feature files when I have them placed src/main/java , some of the posts said i have to move all feature files to src/main/resources/feature , where features is package
Change 3: I have realized that cucumber-jvm-parallel-plugin is not able to recognize the resources like step def's and drivers etc, so i have used build-helper-maven-plugin where i have declared the resources as below
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>src/main/java/</source>
<source>src/main/resources/</source>
<source>features</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
Change 4: cucumber-jvm-parallel-plugin in the maven life cycle in my IDE, because for some reason maven is not able to consider this plugin in it execution
Eclipse --> Windoes --> Preferences --> Maven->LifeCycleMappings-> copy paste below code
<pluginExecution>
<pluginExecutionFilter>
<groupId>com.github.temyers</groupId>
<artifactId>cucumber-jvm-parallel-plugin</artifactId>
<goals>
<goal>generateRunners</goal>
</goals>
<versionRange>[4.2.0,)</versionRange>
</pluginExecutionFilter>
<action>
<ignore/>
</action>
</pluginExecution>
Then , click on "Reload workspace lifecycle mapping metadata" button in Preference
Maven modal
My final pom looks like this
<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.practise.raja</groupId>
<artifactId>JUnitCucumberParallelExecutionPractise</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>JUnitCucumberParallelExecutionPractise</name>
<description>JUnitCucumberParallelExecutionPractise</description>
<dependencies>
<!-- <dependency>
<groupId>com.github.temyers</groupId>
<artifactId>cucumber-jvm-parallel-plugin</artifactId>
<version>5.0.0</version>
</dependency>
-->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit</artifactId>
<version>4.7.1</version>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-picocontainer</artifactId>
<version>4.7.1</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.5.3</version>
</dependency>
</dependencies>
<properties>
<src.main.java>src/main/java</src.main.java>
</properties>
<build>
<resources>
<resource>
<directory>${src.main.java}</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>src/main/java/</source>
<source>src/main/resources/</source>
<source>features</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<fork>true</fork>
<executable>C:\Program Files (x86)\Java\jdk1.8.0_211\bin\javac</executable>
</configuration>
</plugin>
<plugin>
<groupId>com.github.temyers</groupId>
<artifactId>cucumber-jvm-parallel-plugin</artifactId>
<version> 4.2.0</version>
<executions>
<execution>
<id>generateRunners</id>
<phase>generate-test-sources</phase>
<goals>
<goal>generateRunners</goal>
</goals>
<configuration>
<featuresDirectory>src/main/resources/features</featuresDirectory>
<glue>
<package>com.qa.stepdef</package>
</glue>
<outputDirectory>${project.build.directory}/generated-test-
sources/cucumber</outputDirectory>
<cucumberOutputDir>${project.build.directory}</cucumberOutputDir>
<format> json </format>
<strict>true</strict>
<monochrome>false</monochrome>
<useTestNG>false</useTestNG>
<namingScheme>simple</namingScheme>
<namingPattern>Parallel{c}IT</namingPattern>
<parallelScheme>FEATURE</parallelScheme>
</configuration>
</execution>
</executions>
</plugin>
<!-- Specify a custom template for the generated sources (this is a path
relative to the project base directory) -->
<!-- <customVmTemplate>src/test/resources/custom-runner-template.java.vm
</customVmTemplate> -->
<!-- Specify a custom package name for generated sources. Default is no
package. -->
<!--<packageName></packageName> <plugins> <plugin> <name>json</name>
</plugin>
<plugin> <name>html</name> </plugin> <plugin> <name>pretty</name> </plugin>
</plugins> -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20</version>
<configuration>
<forkCount>3</forkCount>
<reuseForks>true</reuseForks>
<includes>
<include>**/*IT.class</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
</project>
Even after these changes, an error started showing at <execution> in pom, it says
Plugin execution not covered by lifecycle configuration: com.github.temyers:cucumber-
jvm-parallel-plugin:4.2.0:generateRunners (execution: generateRunners, phase:
generate-
But, its fine, i am able to run the feature files in parallel even with this above
error
test-sources)

Maven release failing : A zip file cannot include itself

I am facing an issue while releasing a Maven project to nexus repository. I am doing this by Jenkins job. I am getting the error:
Failed to execute goal org.apache.maven.plugins:maven-source-plugin:3.0.1:jar (attach-sources) on project xyz: Error creating source archive: A zip file cannot include itself -> [Help 1]
I am using maven assembly plugin and external.atlassian.jgitflow:jgitflow-maven-plugin.
I have followed below article on StackOveflow : A zip file cannot include itself - Maven-assembly plugin
But this did not solve the problem. Below is how I am using the plugin
<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>
<groupId>com.x</groupId>
<artifactId>y</artifactId>
<packaging>jar</packaging>
<version>2.0.0</version>
<name>myArtifact</name>
<url>http://maven.apache.org</url>
<distributionManagement>
<repository>
<id>myRepoId</id>
<url>http://my/repo/location/releases/</url>
</repository>
<snapshotRepository>
<id>mySnapshotRepoId</id>
<url>http://my/repo/location/snapshots/</url>
</snapshotRepository>
</distributionManagement>
<repositories>
<repository>
<id>myRepoId</id>
<url>http://my/repo/location/releases/</url>
</repository>
<repository>
<id>mySnapshotRepoId</id>
<url>http://my/snapshot/repo/location/snapshots/</url>
</repository>
</repositories>
<dependencies>
<!-- http://mvnrepository.com/artifact/commons-io/commons-io -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.6</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<profiles>
<profile>
<id>local</id>
<properties>
<build.profile.id>local</build.profile.id>
</properties>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
<profile>
<id>pre_prod</id>
<properties>
<build.profile.id>pre_prod</build.profile.id>
</properties>
</profile>
<profile>
<id>prod</id>
<properties>
<build.profile.id>prod</build.profile.id>
</properties>
</profile>
</profiles>
<build>
<testResources>
<testResource>
<directory>${project.build.directory}</directory>
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>external.atlassian.jgitflow</groupId>
<artifactId>jgitflow-maven-plugin</artifactId>
<version>1.0-m5.1</version>
<configuration>
<enableSshAgent>true</enableSshAgent>
<allowUntracked>true</allowUntracked>
<allowSnapshots>true</allowSnapshots>
<autoVersionSubmodules>true</autoVersionSubmodules>
<pushFeatures>true</pushFeatures>
<pushReleases>true</pushReleases>
<pushHotfixes>true</pushHotfixes>
<noDeploy>false</noDeploy>
<scmCommentPrefix>TC-61</scmCommentPrefix>
<flowInitContext>
<developBranchName>development</developBranchName>
<versionTagPrefix>My-APP-</versionTagPrefix>
</flowInitContext>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-scm-plugin</artifactId>
<version>1.8.1</version>
<configuration>
<tag>Release-${project.artifactId}-${project.version}</tag>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.1</version>
<configuration>
<archive>
<manifest>
<mainClass>com.mains.MainClass</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id> <!-- this is used for inheritance merges -->
<phase>package</phase> <!-- bind to the packaging phase -->
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.7</version>
<executions>
<execution>
<id>copy-resources</id>
<!-- here the phase you need -->
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}</outputDirectory>
<encoding>UTF-8</encoding>
<resources>
<resource>
<directory>src/main/resources/config/${build.profile.id}</directory>
<filtering>true</filtering>
</resource>
<resource>
<directory>src/main/resources/velocities/html</directory>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>3.2</version>
</plugin>
<!-- START: Maven Jacoco Plugin -->
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.9</version>
<executions>
<!-- Prepares the property pointing to the JaCoCo runtime agent which
is passed as VM argument when Maven the Surefire plugin is executed. -->
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>jacoco-instrument</id>
<goals>
<goal>instrument</goal>
</goals>
</execution>
<execution>
<id>jacoco-restore-instrumented-classes</id>
<goals>
<goal>restore-instrumented-classes</goal>
</goals>
</execution>
<!-- Ensures that the code coverage report for unit tests is created
after unit tests have been run. -->
<execution>
<id>jacoco-report</id>
<phase>package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
<configuration>
<excludes>
<exclude>*</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<directory>${project.build.directory}</directory>
<filtering>false</filtering>
</resource>
</resources>
</build>
</project>
Can someone point me where I am making the mistake.
Thanks.

Cannot get Cobertura coverage report

I use SonarQube 4.5.2, with Maven in an Eclipse project. Here are fragments from my POM:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>${cobertura.maven.plugin.version}</version>
<configuration>
<instrumentation>
<ignores>
<ignore>org.xxx.xxx.gwt.xxx.common.client.ui.overlay.xxx.gen.*</ignore>
</ignores>
<excludes>
<exclude>org/xxx/xxx/gwt/xxx/common/client/ui/overlay/xxx/gen/**/*.class</exclude>
<exclude>org/xxx/xxx/gwt/xxx/common/client/ui/overlay/xxx/gen/**/*Test.class</exclude>
</excludes>
</instrumentation>
</configuration>
<executions>
<execution>
<goals>
<goal>clean</goal>
<goal>cobertura</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.13</version>
<configuration>
<argLine>-Xmx512M -XX:MaxPermSize=128M</argLine>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>${gwtplugin.version}</version>
<configuration>
<gwtSdkFirstInClasspath>true</gwtSdkFirstInClasspath>
<extraJvmArgs>-Xss2M -XX:MaxPermSize=512M -Xmx2048m -Xdebug </extraJvmArgs>
<!-- <extraJvmArgs>-Xss2M -XX:MaxPermSize=400M -Xms700M -Xmx1024M</extraJvmArgs> -->
<hostedWebapp>web</hostedWebapp>
<modules>
<module>org.xxx.xxx.gwt.xxx.xxx.Module1</module>
<module>org.xxx.xxx.gwt.xxx.xxx.Module2</module>
<module>org.xxx.xx.gwt.xxx.xxx.Module3</module>
</modules>
<compileReport>true</compileReport>
<strict>true</strict>
<runTarget>app.html</runTarget>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>test</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>${gwt.version}</version>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<version>${gwt.version}</version>
</dependency>
</dependencies>
</plugin>
<profile>
<id>sonar</id>
<properties>
<!-- SonarQube enables the appropriate plugin from the coverage report that already finds -->
<!-- <sonar.java.coveragePlugin>cobertura</sonar.java.coveragePlugin> -->
<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
<!-- <sonar.jacoco.reportPath>${project.basedir}/../target/jacoco.exec</sonar.jacoco.reportPath> -->
<sonar.jdbc.url>jdbc:mysql://localhost:3306/sonar</sonar.jdbc.url>
<sonar.jdbc.username>username</sonar.jdbc.username>
<sonar.jdbc.password>password</sonar.jdbc.password>
<sonar.jdbc.driver>com.mysql.jdbc.Driver</sonar.jdbc.driver>
<sonar.host.url>http://localhost:9000/</sonar.host.url>
<sonar.projectVersion>2.0</sonar.projectVersion>
<sonar.language>java</sonar.language>
<sonar.sourceEncoding>UTF-8</sonar.sourceEncoding>
<sonar.sources>src/main/java</sonar.sources>
<sonar.inclusions>(...)</sonar.inclusions>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.18.1</version>
</plugin>
<plugin>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar-maven3-plugin</artifactId>
<version>4.5.2</version>
</plugin>
</plugins>
</build>
</profile>
Now when I run mvn clean -Psonar test cobertura:cobertura sonar:sonar, I would expect to visit http://localhost:9000/ and check the code coverage widget. But it shows 0%. Does anyone has an idea why is this happen?
Java version 1.6.0_45.
Eclipse Luna.
SonarQube 4.5.2.

Maven ftp site plugin

I want to upload my site directly into my ftp server. I'm tring to configure my pom.xml but I've some problem with plugin. I've read many guides on-line but none is unique, or at least there are strong differences.
Have you any tip or trick?
<profile>
<id>deploy</id>
<build>
<plugins>
<plugin>
<inherited>false</inherited>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
<configuration>
<target>
<ftp action="send" server="server"
remotedir="/a/b" userid="usr"
password="pw" depends="no"
verbose="yes" binary="yes">
<fileset dir="modules/my-module/target">
<include name="my-static-file.zip" />
</fileset>
</ftp>
<taskdef name="ftp" classname="org.apache.tools.ant.taskdefs.optional.net.FTP"
classpathref="maven.plugin.classpath" />
</target>
</configuration>
<dependencies>
<dependency>
<groupId>commons-net</groupId>
<artifactId>commons-net</artifactId>
<version>1.4.1</version>
</dependency>
<dependency>
<groupId>ant</groupId>
<artifactId>ant-commons-net</artifactId>
<version>1.6.5</version>
</dependency>
<dependency>
<groupId>ant</groupId>
<artifactId>ant-jsch</artifactId>
<version>1.6.5</version>
</dependency>
<dependency>
<groupId>jsch</groupId>
<artifactId>jsch</artifactId>
<version>0.1.29</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</profile>
Now this is my pom.xml.
<build>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ftp</artifactId>
<version>2.2</version>
</extension>
</extensions>
<defaultGoal>package</defaultGoal>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>wagon-maven-plugin</artifactId>
<version>1.0-beta-4</version>
<configuration>
<skip>false</skip>
<serverId>ftpserver</serverId>
<url>ftp://---.---.----.---/var/www/html</url>
</configuration>
<executions>
<execution>
<id>upload</id>
<phase>deploy</phase>
<goals>
<goal>upload</goal>
</goals>
<configuration>
<fromDir>${project.basedir}/target/${project.artifactId}-${project.version}/</fromDir>
<includes>*</includes>
<toDir></toDir>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
I'm using Eclipse 3.7, when I use Run As -> Maven Install all go in right way, but I would like to launch deploy phase for upload all into my ftp server.
How I configure Eclipse? My POM is correct for this task now?
Instead of maven-antrun-plugin it is better to use upload goal of maven-wagon-plugin. Here is an example project demonstrating uploading multiple files to ftp.

Resources