ant maven plugin failed - run#hbm2java - maven

when i run this command
mvn antrun:run#hbm2java
i got this error
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building ciccio 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-antrun-plugin:1.8:run (hbm2java) # ciccio ---
Downloading: https://repo.maven.apache.org/maven2/org/apache/ant/ant/1.9.4/ant-1.9.4.pom
Downloaded: https://repo.maven.apache.org/maven2/org/apache/ant/ant/1.9.4/ant-1.9.4.pom (10 KB at 9.5 KB/sec)
Downloading: https://repo.maven.apache.org/maven2/org/apache/ant/ant/1.9.4/ant-1.9.4.jar
Downloaded: https://repo.maven.apache.org/maven2/org/apache/ant/ant/1.9.4/ant-1.9.4.jar (1972 KB at 1036.8 KB/sec)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.267 s
[INFO] Finished at: 2016-11-27T23:32:16+01:00
[INFO] Final Memory: 15M/144M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.8:run (hbm2java) on project ciccio: An Ant BuildException has occured: The following error occurred while executing this line:
[ERROR] jar:file:/C:/Users/ciro/.m2/repository/org/apache/maven/plugins/maven-antrun-plugin/1.8/maven-antrun-plugin-1.8.jar!/org/apache/maven/ant/tasks/antlib.xml:24: The following error occurred while executing this line:
[ERROR] jar:file:/C:/Users/ciro/.m2/repository/org/apache/ant/ant/1.9.4/ant-1.9.4.jar!/org/apache/tools/ant/antlib.xml:37: Could not create task or type of type: componentdef.
[ERROR]
[ERROR] Ant could not find the task or a class this task relies upon.
[ERROR]
[ERROR] This is common and has a number of causes; the usual
[ERROR] solutions are to read the manual pages then download and
[ERROR] install needed JAR files, or fix the build file:
[ERROR] - You have misspelt 'componentdef'.
[ERROR] Fix: check your spelling.
[ERROR] - The task needs an external JAR file to execute
[ERROR] and this is not found at the right place in the classpath.
[ERROR] Fix: check the documentation for dependencies.
[ERROR] Fix: declare the task.
[ERROR] - The task is an Ant optional task and the JAR file and/or libraries
[ERROR] implementing the functionality were not found at the time you
[ERROR] yourself built your installation of Ant from the Ant sources.
[ERROR] Fix: Look in the ANT_HOME/lib for the 'ant-' JAR corresponding to the
[ERROR] task and make sure it contains more than merely a META-INF/MANIFEST.MF.
[ERROR] If all it contains is the manifest, then rebuild Ant with the needed
[ERROR] libraries present in ${ant.home}/lib/optional/ , or alternatively,
[ERROR] download a pre-built release version from apache.org
[ERROR] - The build file was written for a later version of Ant
[ERROR] Fix: upgrade to at least the latest release version of Ant
[ERROR] - The task is not an Ant core or optional task
[ERROR] and needs to be declared using <taskdef>.
[ERROR] - You are attempting to use a task defined using
[ERROR] <presetdef> or <macrodef> but have spelt wrong or not
[ERROR] defined it at the point of use
[ERROR]
[ERROR] Remember that for JAR files to be visible to Ant tasks implemented
[ERROR] in ANT_HOME/lib, the files must be in the same directory or on the
[ERROR] classpath
[ERROR]
[ERROR] Please neither file bug reports on this problem, nor email the
[ERROR] Ant mailing lists, until all of these causes have been explored,
[ERROR] as this is not an Ant bug.
[ERROR] -> [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/MojoExecutionException
i've installed ANT 1.8 and set ANT_HOME e put bin folder inside windows path.
I get the feeling you're trying to do something they should not. for example, I see that as a repository download version 1.9 of ant apache and I do not know why. then ignore the fact that I have installed on my machine ant
thanks
edit
I confirm what has been said. I renamed the jar of version 1.9 and put in its place that of 1.8. everything works perfectly. But it would be better that everything worked without these tricks
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution> <!--mvn antrun:run#hbm2java-->
<id>hbm2java</id>
<phase>none</phase>
<configuration>
<target>
<echo message="Start generating entities .."/>
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask"/>
<hibernatetool>
<jdbcconfiguration
revengfile="src/main/resources/hibernate.reveng.xml"
packagename="it.ciccio.test"
detectmanytomany="true"
configurationfile="src/main/resources/hibernate.cfg.xml"/>
<hbm2java
destdir="src/main/java/"
jdk5="true"
ejb3="true"
/>
</hibernatetool>
<echo message="End generating entities"/>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution> <!--mvn antrun:run#hbm2dao-->
<id>hbm2dao</id>
<phase>none</phase>
<configuration>
<target>
<echo message="Start generating dao .."/>
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask"/>
<hibernatetool>
<jdbcconfiguration
revengfile="src/main/resources/hibernate.reveng.xml"
packagename="it.ciccio.dao"
detectmanytomany="true"
configurationfile="src/main/resources/hibernate.cfg.xml"/>
<hbmtemplate destdir="${basedir}/src/main/java"
templatepath="${basedir}/src/main/resources/template"
template="daohome.ftl"
filepattern="{package-name}/{class-name}Dao.java">
<property key="ejb3" value="true" />
<property key="jdk5" value="true" />
</hbmtemplate>
</hibernatetool>
<echo message="End generating dao"/>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>${hibernate.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>${hibernate.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate.common</groupId>
<artifactId>hibernate-commons-annotations</artifactId>
<version>5.0.1.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.1-api</artifactId>
<version>1.0.0.Final</version>
</dependency>
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>2.3.8</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.4.1207.jre7</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-tools</artifactId>
<version>${hibernate.version}</version>
<exclusions>
<exclusion>
<groupId>org.hiernate</groupId>
<artifactId>${hibernate.version}</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</plugin>

i post right pom.
the problem is in the version of dependency used from tool
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution> <!--mvn antrun:run#hbm2java-->
<id>hbm2java</id>
<phase>none</phase>
<configuration>
<target>
<echo message="Start generating entities .."/>
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask"/>
<hibernatetool>
<jdbcconfiguration
revengfile="src/main/resources/hibernate.reveng.xml"
packagename="it.ciccio.test"
detectmanytomany="true"
configurationfile="src/main/resources/hibernate.cfg.xml"/>
<hbm2java
destdir="src/main/java/"
jdk5="true"
ejb3="true"
/>
</hibernatetool>
<echo message="End generating entities"/>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution> <!--mvn antrun:run#hbm2java-->
<id>hbm2dao</id>
<phase>none</phase>
<configuration>
<target>
<echo message="Start generating dao .."/>
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask"/>
<hibernatetool>
<jdbcconfiguration
revengfile="src/main/resources/hibernate.reveng.xml"
packagename="it.webgate.dao"
detectmanytomany="true"
configurationfile="src/main/resources/hibernate.cfg.xml"/>
<hbmtemplate destdir="${basedir}/src/main/java"
templatepath="${basedir}/src/main/resources/template"
template="daohome.ftl"
filepattern="{package-name}/{class-name}Dao.java">
<property key="ejb3" value="true" />
<property key="jdk5" value="true" />
</hbmtemplate>
</hibernatetool>
<echo message="End generating dao"/>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.hibernate/hibernate-core -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.3.11.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.3.11.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>4.3.11.Final</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.hibernate.common/hibernate-commons-annotations -->
<dependency>
<groupId>org.hibernate.common</groupId>
<artifactId>hibernate-commons-annotations</artifactId>
<version>4.0.5.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.1-api</artifactId>
<version>1.0.0.Final</version>
</dependency>
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>2.3.8</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.4.1207.jre7</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-tools</artifactId>
<version>4.3.2.Final</version>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>

Related

how to fix the maven surefire plugin error [there was error in the forked process]?

I am trying to run my sample project which uses Maven- testNG-cucumber and deploy it using docker . here is my Dockerfile
FROM maven:3.6.0-jdk-8
RUN mkdir /docker
WORKDIR /docker
COPY pom.xml .
COPY testng.xml .
COPY src .
RUN mvn clean verify
POM.XML
<dependencies>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-java</artifactId>
<version>1.2.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-jvm-deps</artifactId>
<version>1.0.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-testng</artifactId>
<version>1.2.5</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.9.8</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.masterthought</groupId>
<artifactId>cucumber-reporting</artifactId>
<version>3.8.0</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.44.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.4</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20.1</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>testng.xml</suiteXmlFile>
</suiteXmlFiles>
<useSystemClassLoader>false</useSystemClassLoader>
</configuration>
</plugin>
<plugin>
<groupId>net.masterthought</groupId>
<artifactId>maven-cucumber-reporting</artifactId>
<version>3.8.0</version>
<executions>
<execution>
<id>execution</id>
<phase>verify</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<projectName>Sample</projectName>
<outputDirectory>target/cucumber-reports/advanced-reports</outputDirectory>
<cucumberOutput>target/cucumber-reports/CucumberTestReport.json</cucumberOutput>
<buildNumber>1</buildNumber>
<parallelTesting>false</parallelTesting>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
above scenario works completely fine when i run the project locally using mvn verify .Then i try to build the image using docker build -t sample . . this time i have got the following error .
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.20.1:test (default-test) on project Sample: There are test failures.
[ERROR] Please refer to /docker/target/surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date]-jvmRun[N].dump, [date].dumpstream and [date]-jvmRun[N].dumpstream.
[ERROR] There was an error in the forked process
[ERROR] Cannot find class in classpath: TestRunner
[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process
[ERROR] Cannot find class in classpath: TestRunner
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork
(ForkStarter.java:673)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork
(ForkStarter.java:535)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run
(ForkStarter.java:280)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run
(ForkStarter.java:245)
[ERROR] at
org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider
(AbstractSurefireMojo.java:1124)
[ERROR] at
org.apache.maven.plugin.surefire.AbstractSurefireMojo.
executeAfterPreconditionsChecked(AbstractSurefireMojo.java:954)
Any help would be much appreciated
I had a similar issue and after using older version of maven-surefire-plugin solved my issue.
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<!-- latest version does not work well with JUnit5 -->
<version>2.19.1</version>
<dependencies>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-surefire-provider</artifactId>
<version>1.0.3</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.0.3</version>
</dependency>
</dependencies>
</plugin>
I had the same issue, I just used the clean command for maven.
clean -f pom.xml
If you are working in IntelliJ you can use maven plugin instead.
On the right side click maven Tab -> plugins -> clean -> clean:clean
I faced the same issue but it got resolved with different solution, you can check below problems as well.
Actually i have given the wrong testNG.xml path in POM.XML that's why it was throwing me that error. Please cross verify your testNG.xml path.
The above exception log clearly states that it is unable to find the TestRunner class. Make sure your TestRunner class is on the classpath.
I was getting a similar exception due to there were few extra characters added in the Classes section of the TestNG XML file. Its worth checking TestNG XML file is correct and doesn't contain any extra chars than needed structure.
I faced the same issue. It got resolved after the maven clean build and then ran the test.

Maven/Junit Parallel Execution - Cucumber-JVM v4.0.0

I'm struggling to get the new parallel execution feature of Cucumber-JVM v4.0.0 working with JUnit/Maven.
As specified here, if you configure <parallel> and <threadCount> accordingly in your POM, and use dependency injection to share state (I'm using Pico Continer) then your Cucumber features should execute in parallel.
However, it is still only executing one feature at a time when i run Maven.
I've included my complete POM below - Can anybody help?
<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.softwareautomation</groupId>
<artifactId>selenium</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>selenium</name>
<url>http://maven.apache.org</url>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12.4</version>
<configuration>
<parallel>both</parallel>
<threadCount>4</threadCount>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<!-- AssertJ -->
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.11.1</version>
<scope>test</scope>
</dependency>
<!-- Cucumber -->
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>4.0.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit</artifactId>
<version>4.0.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-picocontainer</artifactId>
<version>4.0.0</version>
<scope>test</scope>
</dependency>
<!-- JUnit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<!-- Selenium WebDriver -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.11.0</version>
</dependency>
</dependencies>
If it helps, below is my runner class (com.softwareautomation.world is the DI class)
package com.evasoftwareautomation.runners;
import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
#RunWith(Cucumber.class)
#CucumberOptions(
plugin = {"pretty", "html:target/cucumber", "junit:target/cucumber.xml"},
features = "src/test/resources/com/softwareautomation/features",
glue = {"com.softwareautomation.stepdefs", "com.softwareautomation.world"},
junit ={ "--step-notifications"},
monochrome = true)
public class CucumberTest {
}
Please see failing stack trace when running from Maven below:
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Concurrency config is parallel='methods', perCoreThreadCount=true, threadCount=4, useUnlimitedThreads=false
org.apache.maven.surefire.util.SurefireReflectionException: java.lang.reflect.InvocationTargetException; nested exception is java.lang.reflect.InvocationTargetException: null
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Caused by: java.lang.NullPointerException
at org.junit.runner.Description.createSuiteDescription(Description.java:124)
at org.apache.maven.surefire.common.junit48.FilterFactory$GroupMatcherCategoryFilter.shouldRun(FilterFactory.java:207)
at org.junit.runners.ParentRunner.shouldRun(ParentRunner.java:434)
at org.junit.runners.ParentRunner.filter(ParentRunner.java:382)
at org.junit.runner.manipulation.Filter.apply(Filter.java:97)
at org.junit.runners.ParentRunner.filter(ParentRunner.java:384)
at org.junit.runner.manipulation.Filter.apply(Filter.java:97)
at org.junit.runners.ParentRunner.filter(ParentRunner.java:384)
at org.junit.runner.manipulation.Filter.apply(Filter.java:97)
at org.junit.runners.ParentRunner.filter(ParentRunner.java:384)
at org.junit.runner.manipulation.Filter.apply(Filter.java:97)
at org.junit.internal.requests.FilterRequest.getRunner(FilterRequest.java:37)
at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.execute(JUnitCoreWrapper.java:62)
at org.apache.maven.surefire.junitcore.JUnitCoreProvider.invoke(JUnitCoreProvider.java:139)
... 9 more
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.709 s
[INFO] Finished at: 2018-10-25T23:36:01+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project selenium: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test failed: The forked VM terminated without saying properly goodbye. VM crash or System.exit called ? -> [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
at org.apache.maven.surefire.common.junit48.FilterFactory$GroupMatcherCategoryFilter.shouldRun(FilterFactory.java:207)
You are using JUnit 4.12. However as noted above the stack trace tells us that surefire is trying to use an integration for JUnit 4.8. Your version of surefire was released in 2012, where as JUnit 4.12 was released in 2014. Have you considered updating your maven surefire plugin?
I managed to get it to work by explicitly adding the dependency of the testing framework:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit47</artifactId>
<version>2.22.2</version>
</dependency>
</dependencies>
<configuration>
<parallel>all</parallel>
<threadCount>4</threadCount>
</configuration>
</plugin>
Leaving it here as it might help somebody else
In my case
maven was not picking up Junit 5 tests
cucumber tests were not running in parallel
Got it working by
adding junit-jupiter 5.5.2
adding maven-surefire-plugin 2.22.2 and explicitly adding
surefire-junit47 2.22.2
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit47</artifactId>
<version>2.22.2</version>
</dependency>
</dependencies>
<configuration>
<parallel>both</parallel>
<threadCount>4</threadCount>
</configuration>
</plugin>
In my case, I was using surefire 2.12.4 and updating it to 2.22.2 did the trick

Dependency convergence error

After updating Firefox I changed versions of libraries to higher ones. Following errors appeard:
[ERROR] Dependency convergence error for commons-collections:commons-collections:3.2.2 paths to dependency are:
[ERROR] +-net:serenity.pom.gradle:0.0.1-SNAPSHOT
[ERROR] +-net.serenity-bdd:serenity-core:1.1.29-rc.3
[ERROR] +-org.seleniumhq.selenium:htmlunit-driver:2.20
[ERROR] +-commons-collections:commons-collections:3.2.2
[ERROR] and
[ERROR] +-net:serenity.pom.gradle:0.0.1-SNAPSHOT
[ERROR] +-net.serenity-bdd:serenity-core:1.1.29-rc.3
[ERROR] +-io.appium:java-client:3.3.0
[ERROR] +-commons-validator:commons-validator:1.4.1
[ERROR] +-commons-collections:commons-collections:3.2.1
[ERROR] and
[ERROR] +-net:serenity.pom.gradle:0.0.1-SNAPSHOT
[ERROR] +-net.serenity-bdd:serenity-core:1.1.29-rc.3
[ERROR] +-commons-collections:commons-collections:3.2.2
[ERROR] ]
[ERROR] -> [Help 1]
Dependency tree looks like:
[INFO] +- net.serenity-bdd:serenity-core:jar:1.1.29-rc.3:test
[INFO] | +- org.seleniumhq.selenium:htmlunit-driver:jar:2.20:test
[INFO] | +- commons-collections:commons-collections:jar:3.2.2:test
[INFO] | +- io.appium:java-client:jar:3.3.0:test
[INFO] | | \- commons-validator:commons-validator:jar:1.4.1:test
[INFO] | | +- commons-beanutils:commons-beanutils:jar:1.8.3:test
[INFO] | | \- commons-digester:commons-digester:jar:1.8.1:test
How to solve this problem?
Can I manually switch the library?
PS
Here is my pom.xml
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-core</artifactId>
<version>1.1.29-rc.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.7</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-jbehave</artifactId>
<version>1.9.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.2.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<id>verify</id>
<phase>validate</phase>
<goals>
<goal>enforce</goal>
</goals>
<inherited>true</inherited>
</execution>
</executions>
<configuration>
<failFast>true</failFast>
<rules>
<DependencyConvergence></DependencyConvergence>
<requireReleaseDeps>
<onlyWhenRelease>true</onlyWhenRelease>
</requireReleaseDeps>
<requireJavaVersion>
<version>${java.version}</version>
</requireJavaVersion>
</rules>
</configuration>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.18</version>
<configuration>
<includes>
<include>src/test/java/*.java </include>
</includes>
</configuration>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>net.serenity-bdd.maven.plugins</groupId>
<artifactId>serenity-maven-plugin</artifactId>
<version>1.1.29-rc.1</version>
<dependencies>
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-core</artifactId>
<version>1.1.29-rc.3</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>serenity-reports</id>
<phase>post-integration-test</phase>
<goals>
<goal>aggregate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
See POM Reference, Exclusions:
Exclusions explicitly tell Maven that you don't want to include the specified project that is a dependency of this dependency (in other words, its transitive dependency).
See also Apache Maven Enforcer Rules, Dependency Convergence:
If a project has two dependencies, A and B, both depending on the same artifact, C, this rule will fail the build if A depends on a different version of C then the version of C depended on by B.
[...]
And this will succeed.
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-nop</artifactId>
<version>1.6.0</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
I know I'm late to the party, but after scratching my head for 8-10 hours, I came around this solution which fixes the problem when you don't have control over different poms where the different versions of dependencies are used at different places. So, I thought it's worth sharing.
#Gerold's answer is an ideal one (source: Maven wiki). But, it works for the case when you are the owner of all the dependencies and have the time, luxury and write permission to fix the issue at the root. In my case, I was using a company-wide global parent pom which had different versions set in different places, so I was facing this issue. I wanted to find some way to fix this on my end without changing the global parent pom.
To fix this, in your project's parent pom, you can specify the exact version which matches with rest of the places and override the versions specified by the global parent poms at different places. You can add this block in your project's parent pom
<!-- ============================= -->
<!-- DEPENDENCY MANAGEMENT -->
<!-- ============================= -->
<dependencyManagement>
<dependencies>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<!-- This version should be consistent
with versions at other places -->
<version>3.2.2</version>
</dependency>
</dependencies>
</dependencyManagement>
HTH
Or just remove the maven enforcer all together if you really/temporarily need to get past this issue.

Issues with maven compiler

I am trying to use jetty plugin for a grails project. I am currently using jdk 1.6.0_45. It seems that the jre version used by jdk 1.6 is a little old one for jetty plugin and it generates the following error.
Fatal error during compilation org.apache.tools.ant.BuildException: java.lang.UnsupportedClassVersionError: org/eclipse/jetty/plus/webapp/EnvConfiguration : Unsupported major.minor version 51.0 (Use --stacktrace to see the full trace)
To resolve this error I have added a code in the pom.xml to use java source 1.7. The code is something like this.
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
But still I continue to get the same error. Can any body please help me out.
I am posting my entire pom.xml and the error that I am getting
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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany</groupId>
<artifactId>grails-mongo-demo</artifactId>
<packaging>grails-app</packaging>
<version>0.1</version>
<name>grails-mongo-demo</name>
<description>grails-mongo-demo</description>
<properties>
<grails.version>2.4.2</grails.version>
<h2.version>1.3.170</h2.version>
</properties>
<dependencies>
<dependency>
<groupId>org.grails</groupId>
<artifactId>grails-dependencies</artifactId>
<version>${grails.version}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.grails</groupId>
<artifactId>grails-test</artifactId>
<version>${grails.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.grails</groupId>
<artifactId>grails-plugin-testing</artifactId>
<version>${grails.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.spockframework</groupId>
<artifactId>spock-core</artifactId>
<version>0.7-groovy-2.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>${h2.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.grails</groupId>
<artifactId>grails-datastore-test-support</artifactId>
<version>1.0-grails-2.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.grails.plugins</groupId>
<artifactId>scaffolding</artifactId>
<version>2.1.2</version>
<scope>compile</scope>
<type>zip</type>
</dependency>
<dependency>
<groupId>org.grails.plugins</groupId>
<artifactId>cache</artifactId>
<version>1.1.7</version>
<scope>compile</scope>
<type>zip</type>
</dependency>
<dependency>
<groupId>org.grails.plugins</groupId>
<artifactId>asset-pipeline</artifactId>
<version>1.8.11</version>
<scope>compile</scope>
<type>zip</type>
</dependency>
<dependency>
<groupId>org.grails.plugins</groupId>
<artifactId>jquery</artifactId>
<version>1.11.1</version>
<scope>runtime</scope>
<type>zip</type>
</dependency>
<dependency>
<groupId>org.grails.plugins</groupId>
<artifactId>webxml</artifactId>
<version>1.4.1</version>
<type>zip</type>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.grails.plugins</groupId>
<artifactId>mongodb</artifactId>
<version>3.0.2</version>
<scope>compile</scope>
<type>zip</type>
</dependency>
<dependency>
<groupId>org.grails.plugins</groupId>
<artifactId>jetty</artifactId>
<version>3.0.0</version>
<type>zip</type>
</dependency>
</dependencies>
<build>
<pluginManagement />
<plugins>
<!-- Disables the Maven surefire plugin for Grails applications, as we have our own test runner -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.17</version>
<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>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>2.4.1</version>
<configuration>
<filesets>
<fileset>
<directory>plugins</directory>
<includes>
<include>**/*</include>
</includes>
<followSymlinks>false</followSymlinks>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>org.grails</groupId>
<artifactId>grails-maven-plugin</artifactId>
<version>2.4.3</version>
<configuration>
<grailsVersion>${grails.version}</grailsVersion>
</configuration>
<extensions>true</extensions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>grails</id>
<name>grails</name>
<url>http://repo.grails.org/grails/core</url>
</repository>
<repository>
<id>grails-plugins</id>
<name>grails-plugins</name>
<url>http://repo.grails.org/grails/plugins</url>
</repository>
</repositories>
<profiles>
<profile>
<id>tools</id>
<activation>
<property>
<name>java.vendor</name>
<value>Sun Microsystems Inc.</value>
</property>
</activation>
<dependencies>
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>${java.version}</version>
<scope>system</scope>
<systemPath>${java.home}/../lib/tools.jar</systemPath>
</dependency>
</dependencies>
</profile>
</profiles>
</project>
Error
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building grails-mongo-demo 0.1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) # grails-mongo-demo ---
[INFO] Deleting /mnt/data/Work/Tutorials/Practice/grails/grails-mongo-demo/target
[INFO] Deleting /mnt/data/Work/Tutorials/Practice/grails/grails-mongo-demo/plugins (includes = [**/*], excludes = [])
[INFO]
[INFO] --- grails-maven-plugin:2.4.3:clean (default-clean) # grails-mongo-demo ---
4 Sep, 2014 6:28:00 PM org.codehaus.groovy.runtime.m12n.MetaInfExtensionModule newModule
WARNING: Module [groovy-all] - Unable to load extension class [org.codehaus.groovy.runtime.NioGroovyMethods]
4 Sep, 2014 6:28:00 PM org.codehaus.groovy.runtime.m12n.MetaInfExtensionModule newModule
WARNING: Module [groovy-all] - Unable to load extension class [org.codehaus.groovy.runtime.NioGroovyMethods]
|Loading Grails 2.4.2
|Configuring classpath
|Running pre-compiled script
.
|Environment set to development
....................
|Application cleaned.
[INFO]
[INFO] --- grails-maven-plugin:2.4.3:validate (default-validate) # grails-mongo-demo ---
[INFO]
[INFO] --- grails-maven-plugin:2.4.3:init (default-init) # grails-mongo-demo ---
[INFO]
[INFO] --- grails-maven-plugin:2.4.3:config-directories (default-config-directories) # grails-mongo-demo ---
[INFO]
[INFO] --- grails-maven-plugin:2.4.3:maven-compile (default-maven-compile) # grails-mongo-demo ---
4 Sep, 2014 6:28:32 PM org.codehaus.groovy.runtime.m12n.MetaInfExtensionModule newModule
WARNING: Module [groovy-all] - Unable to load extension class [org.codehaus.groovy.runtime.NioGroovyMethods]
4 Sep, 2014 6:28:32 PM org.codehaus.groovy.runtime.m12n.MetaInfExtensionModule newModule
WARNING: Module [groovy-all] - Unable to load extension class [org.codehaus.groovy.runtime.NioGroovyMethods]
|Loading Grails 2.4.2
|Configuring classpath
|Running pre-compiled script
.
|Environment set to development
......
|Installing zip jetty-3.0.0.zip...
...
|Installed plugin jetty-3.0.0
.............
|Installing zip webxml-1.4.1.zip...
...
|Installed plugin webxml-1.4.1
.............
|Installing zip asset-pipeline-1.8.11.zip...
...
|Installed plugin asset-pipeline-1.8.11
..................
|Installing zip cache-1.1.7.zip...
...
|Installed plugin cache-1.1.7
..............
|Installing zip scaffolding-2.1.2.zip...
...
|Installed plugin scaffolding-2.1.2
..............
|Installing zip jquery-1.11.1.zip...
...
|Installed plugin jquery-1.11.1
..............
|Installing zip mongodb-3.0.2.zip...
...
|Installed plugin mongodb-3.0.2
...................
|Compiling 87 source files
.Error
|
Fatal error during compilation org.apache.tools.ant.BuildException: java.lang.UnsupportedClassVersionError: org/eclipse/jetty/plus/webapp/EnvConfiguration : Unsupported major.minor version 51.0 (Use --stacktrace to see the full trace)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 47.500 s
[INFO] Finished at: 2014-09-04T18:28:42+05:30
[INFO] Final Memory: 10M/102M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.grails:grails-maven-plugin:2.4.3:maven-compile (default-maven-compile) on project grails-mongo-demo: Forked Grails VM exited with error -> [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/MojoExecutionException

Could not resolve dependencies for project from workspace

Hi I have a problem with maven. I want to run my app but when I am typing "clean install jetty:run" I am getting this error:
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 frontend 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for laud.b2b:logic:jar:0.0.1-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.585s
[INFO] Finished at: Sat Jul 13 20:17:27 CEST 2013
[INFO] Final Memory: 6M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project Frontend: Could not resolve dependencies for project laud.b2b:Frontend:war:0.0.1-SNAPSHOT: Failure to find laud.b2b:logic:jar:0.0.1-SNAPSHOT in http://maven.vaadin.com/vaadin-addons was cached in the local repository, resolution will not be reattempted until the update interval of vaadin-addons has elapsed or updates are forced -> [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/DependencyResolutionException
"logic" is a second project in my workspace.
I don`t know what to do to resolve this error. I've searched whole internet and I can do nothing with it...
My pom.xml from Frontend project:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>laud.b2b-root</artifactId>
<groupId>laud.b2b</groupId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<groupId>laud.b2b</groupId>
<artifactId>Frontend</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>frontend</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<vaadin.version>7.1.0</vaadin.version>
<vaadin.plugin.version>${vaadin.version}</vaadin.plugin.version>
<org.springframework.version>3.0.5.RELEASE</org.springframework.version>
</properties>
<repositories>
<repository>
<id>vaadin-addons</id>
<url>http://maven.vaadin.com/vaadin-addons</url>
</repository>
<repository>
<id>vaadin-snapshots</id>
<url>http://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>vaadin-snapshots</id>
<url>http://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
</snapshots>
</pluginRepository>
</pluginRepositories>
<dependencies>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-server</artifactId>
<version>${vaadin.version}</version>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-client-compiled</artifactId>
<version>${vaadin.version}</version>
</dependency>
<!-- Needed when using the widgetset optimizer (custom ConnectorBundleLoaderFactory).
For widgetset compilation, vaadin-client-compiler is automatically added
on the compilation classpath by vaadin-maven-plugin so normally there is
no need for an explicit dependency. -->
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-client-compiler</artifactId>
<version>${vaadin.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-client</artifactId>
<version>${vaadin.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-push</artifactId>
<version>${vaadin.version}</version>
</dependency>
<dependency>
<groupId>laud.b2b</groupId>
<artifactId>logic</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-themes</artifactId>
<version>${vaadin.version}</version>
</dependency>
<dependency>
<groupId>ru.xpoft.vaadin</groupId>
<artifactId>spring-vaadin-integration</artifactId>
<version>2.0.1</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.6.6</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.6</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
</dependency>
</dependencies>
<profiles>
<profile>
<id>compile-widgetset</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<!-- As we are doing "inplace" GWT compilation, ensure the widgetset -->
<!-- directory is cleaned properly -->
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>2.4.1</version>
<configuration>
<filesets>
<fileset>
<directory>src/main/webapp/VAADIN/widgetsets</directory>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.2</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-maven-plugin</artifactId>
<version>${vaadin.plugin.version}</version>
<configuration>
<extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs>
<!-- <runTarget>mobilemail</runTarget> -->
<!-- We are doing "inplace" but into subdir VAADIN/widgetsets. This
way compatible with Vaadin eclipse plugin. -->
<webappDirectory>${basedir}/src/main/webapp/VAADIN/widgetsets</webappDirectory>
<hostedWebapp>${basedir}/src/main/webapp/VAADIN/widgetsets</hostedWebapp>
<noServer>true</noServer>
<!-- Remove draftCompile when project is ready -->
<draftCompile>false</draftCompile>
<compileReport>true</compileReport>
<style>OBF</style>
<strict>true</strict>
<runTarget>http://localhost:8080/</runTarget>
</configuration>
<executions>
<execution>
<configuration></configuration>
<goals>
<goal>clean</goal>
<goal>resources</goal>
<goal>update-theme</goal>
<goal>update-widgetset</goal>
<goal>compile-theme</goal>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<configuration>
<scanIntervalSeconds>3</scanIntervalSeconds>
</configuration>
</plugin>
<!--This plugin's configuration is used to store Eclipse m2e settings
only. It has no influence on the Maven build itself. -->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-maven-plugin</artifactId>
<versionRange>[7.1.0,)</versionRange>
<goals>
<goal>resources</goal>
<goal>update-widgetset</goal>
<goal>compile</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
(AD2)
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 frontend 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) # Frontend ---
[INFO] Deleting C:\Users\mateu\git\LPMavenProblem\laud\laud.b2b-root\Frontend\target
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) # Frontend ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\mateu\git\LPMavenProblem\laud\laud.b2b-root\Frontend\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) # Frontend ---
[INFO] Compiling 2 source files to C:\Users\mateu\git\LPMavenProblem\laud\laud.b2b-root\Frontend\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] Unable to locate the Javac Compiler in:
C:\Program Files (x86)\Java\jre7\..\lib\tools.jar
Please ensure you are using JDK 1.4 or above and
not a JRE (the com.sun.tools.javac.Main class is required).
In most cases you can change the location of your Java
installation by setting the JAVA_HOME environment variable.
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.744s
[INFO] Finished at: Sat Jul 13 21:13:52 CEST 2013
[INFO] Final Memory: 8M/19M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project Frontend: Compilation failure
[ERROR] Unable to locate the Javac Compiler in:
[ERROR] C:\Program Files (x86)\Java\jre7\..\lib\tools.jar
[ERROR] Please ensure you are using JDK 1.4 or above and
[ERROR] not a JRE (the com.sun.tools.javac.Main class is required).
[ERROR] In most cases you can change the location of your Java
[ERROR] installation by setting the JAVA_HOME environment variable.
[ERROR] -> [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/MojoFailureException
Most probably you haven't installed all the dependencies you need to build the frontend artifact. If frontend depends on laud.b2b.logic, you must first install this artifact to your local repository before you can build artifacts that depend on it, i.e.:
Go to the logic source tree and execute mvn install
Then go to the frontend and try the build process again
Maybe it's a good idea to create a root pom.xml for all sub-projects and specify them as modules, then start the build process from the new root project. Maven will compile and install them in the correct order.
References:
Multi-module projects in Maven

Resources