Maven test, Jenkins Test Suite failure java.lang.NoClassDefFoundError - - firefox

I am attempting to run my tests through Maven however I am getting an error during the build process. I've tried for the last 2 days to resolve this but now running out of ideas. I have made sure my POM has the correct dependencies and that the tests work outside of Jenkins.
OS - Windows Server 2012 R2
Browser - firefox 50.1.0
Selenium Driver - 3.0.1
Jenkins Error Log
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running TestSuite
[AppClassLoader#18b4aac2] warning javax.* types are not being woven because the weaver option '-Xset:weaveJavaxPackages=true' has not been specified
09:48:46.025 [main] INFO - START com.Ceridian.tests.HB01.CD01
09:48:46.119 [main] WARN - SKIP com.Ceridian.tests.HB01.CD01
09:48:46.119 [main] ERROR - Unable to take screenshot - java.lang.NullPointerException
09:48:46.135 [main] INFO - START com.Ceridian.tests.HB01.CD02
09:48:46.150 [main] WARN - SKIP com.Ceridian.tests.HB01.CD02
09:48:46.150 [main] ERROR - Unable to take screenshot - java.lang.NullPointerException
Tests run: 4, Failures: 2, Errors: 0, Skipped: 2, Time elapsed: 2.688 sec <<< FAILURE! - in TestSuite
configureBrowserBeforeTest(com.Ceridian.tests.HB01) Time elapsed: 2 sec <<< FAILURE!
java.lang.NoClassDefFoundError: org/openqa/selenium/remote/SessionNotFoundException
Caused by: java.lang.ClassNotFoundException: org.openqa.selenium.remote.SessionNotFoundException
configureBrowserBeforeTest(com.Ceridian.tests.HB01) Time elapsed: 0.093 sec <<< FAILURE!
java.lang.NoClassDefFoundError: org/openqa/selenium/remote/SessionNotFoundException
Caused by: java.lang.ClassNotFoundException: org.openqa.selenium.remote.SessionNotFoundException
Results :
Failed tests:
com.Ceridian.tests.HB01.configureBrowserBeforeTest(com.Ceridian.tests.HB01)
Run 1: HB01>BaseTest.configureBrowserBeforeTest:102 » NoClassDefFound org/openqa/sele...
Run 2: HB01>BaseTest.configureBrowserBeforeTest:102 » NoClassDefFound org/openqa/sele...
Jenkins Build Failure
[JENKINS] Recording test results
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 37.354 s
[INFO] Finished at: 2017-01-06T09:48:52+00:00
[INFO] Final Memory: 34M/442M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project Frameworkium: There are test failures.
[ERROR]
[ERROR] Please refer to C:\Program Files (x86)\Jenkins\jobs\FirstAttempt\workspace\target\surefire-reports for the individual test results.
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project Frameworkium: There are test failures.
POM file
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.frameworkium</groupId>
<artifactId>Frameworkium</artifactId>
<packaging>jar</packaging>
<version>2.0.5</version>
<name>Frameworkium</name>
<description>
A template designed to get up and running quickly with Selenium and Appium.
</description>
<url/>
<inceptionYear/>
<organization/>
<licenses/>
<developers/>
<contributors/>
<prerequisites>
<maven>3.1.1</maven>
</prerequisites>
<modules/>
<scm/>
<issueManagement/>
<ciManagement/>
<distributionManagement/>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<env.config>local</env.config>
<threads>1</threads>
<groups/>
<aspectj.version>1.8.9</aspectj.version>
</properties>
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.9.8</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.11</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.14</version>
</dependency>
<dependency>
<groupId>com.github.Frameworkium</groupId>
<artifactId>frameworkium-core</artifactId>
<version>2.0.5</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-remote-driver</artifactId>
<version>3.0.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.53.1</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server</artifactId>
<version>3.0.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
<testSourceDirectory>src/test/java</testSourceDirectory>
<resources>
<resource>
<directory>
src/main/resources
</directory>
</resource>
</resources>
</build>
<profiles>
<profile>
<id>tests</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</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.19.1</version>
<configuration>
<parallel>methods</parallel>
<threadCount>${threads}</threadCount>
<systemProperties>
<screenshotDirectory>
${project.build.directory}/screenshots
</screenshotDirectory>
<allure.issues.tracker.pattern>
/browse/%s
</allure.issues.tracker.pattern>
</systemProperties>
<suiteXmlFiles>
<suiteXmlFile>testng.xml</suiteXmlFile>
</suiteXmlFiles>
<includes>
<include>**/Test*.java</include>
<include>**/*Tests*.java</include>
<include>**/*Tests.java</include>
<include>**/*Test.java</include>
<include>**/*TestCase.java</include>
</includes>
<groups>${groups}</groups>
<testFailureIgnore>false</testFailureIgnore>
<argLine>
-javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
</argLine>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
The Jenkins Logs seem to mention my #BeforeMethod as a possible reason for failure so I'll just include that here
#BeforeMethod(
alwaysRun = true
)
public static void configureBrowserBeforeTest(Method testMethod) {
try {
((Driver)driver.get()).resetBrowser();
wait.set(newDefaultWait());
userAgent = determineUserAgent();
initialiseNewScreenshotCapture(testMethod);
} catch (Exception var2) {
logger.error("Failed to configure browser.", var2);
throw new RuntimeException("Failed to configure browser.", var2);
}
}
I've included my configuration screen of the build.
Apologies if I've missed something out.
Adding dependencies

Updated
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.0.1</version>
</dependency>
So it is also on 3.0.1 and the error went away. Thanks to #duffymo for the help.

Related

Maven returns exit 0 even though junit5 tests fail

I have setup Maven to trigger some junit5 tests.
When I run:
mvn clean integration-test
I see the project build and then it also runs the tests. I see a failure in one of the unit tests.
Further down in the console output, I see:
[INFO] BUILD SUCCESS
What am I doing wrong? My expectation is that a failed test run would stop a tool like maven and return exit code 1.
This is particularly frustrating in CI because it appears as the tests are healthy since exit code returns zero.
EDIT: Here's the POM XML:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.(removedforstackoverflowpost)</groupId>
<artifactId>(removedforstackoverflowpost)</artifactId>
<packaging>jar</packaging>
<version>0.0.1</version>
<name>(removedforstackoverflowpost)</name>
<url>(removedforstackoverflowpost)</url>
<description>(removedforstackoverflowpost)</description>
<licenses>
<license>
<name>MIT License</name>
<url>http://www.opensource.org/licenses/mit-license.php</url>
</license>
</licenses>
<developers>
<developer>
<name>(removedforstackoverflowpost)</name>
<email>(removedforstackoverflowpost)</email>
<organization>(removedforstackoverflowpost)</organization>
<organizationUrl>(removedforstackoverflowpost)</organizationUrl>
</developer>
</developers>
<scm>
<connection>(removedforstackoverflowpost)</connection>
<developerConnection>(removedforstackoverflowpost)</developerConnection>
<url>(removedforstackoverflowpost)</url>
</scm>
<properties>
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.3.1</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.5</version>
</dependency>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.12.1.GA</version>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-console-standalone</artifactId>
<version>1.3.2</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<!-- latest version (2.20.1) 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>
<configuration>
<useSystemClassLoader>false</useSystemClassLoader>
<properties>
<configurationParameters>
junit.jupiter.extensions.autodetection.enabled = true
</configurationParameters>
</properties>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<release>11</release>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19</version>
<configuration>
<testFailureIgnore>true</testFailureIgnore>
<argLine>
--illegal-access=permit
</argLine>
</configuration>
</plugin>
</plugins>
</build>
</project>
I'm running java 11
When I enter this test command:
mvn -ff clean integration-test
I get this output that ends like this:
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec - in com.github.(removedforstackoverflowpost)
Results :
Failed tests:
SomeTest.testSomething1:13 expected: <1> but was: <2>
Tests run: 4, Failures: 1, Errors: 0, Skipped: 0
[ERROR] There are test failures.
Please refer to (removedforstackoverflowpost)/target/surefire-reports for the individual test results.
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) # (removedforstackoverflowpost) ---
[INFO] Building jar: (removedforstackoverflowpost)....-0.0.1.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.360 s
[INFO] Finished at: 2018-12-12T00:45:03-08:00
[INFO] ------------------------------------------------------------------------
I'm a total beginner so I apologize for asking an overly simplistic question. I am new to Java/Maven/JUnit5, but I'm just looking for what I should do to have the test cause a non zero exit code. This way, my CI run (I happen to use CircleCI but that doesnt matter) would show as failed when the tests fail.
I work on a Mac and the undesired behavior that I'm describing on this ticket happens the same way on both my local Mac workstation as well as in CircleCI.
Line 102 of your pom.xml is instructing Maven to ignore the failures. Just remove <testFailureIgnore>true</testFailureIgnore> and the build will fail.

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

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

Maven: Making Jars With Dependencies: Example From Book Doesn't Work

I am a complete beginner with Maven. I've been following the book Maven By Example. In the section 6.13 the author demonstrates making a JAR with the dependencies included via the command
mvn install assembly assembly
I followed the example in chapter 6, except I skipped the parts with unit testing. I went back through them to make sure I didn't skip a step. However when I tried the above command I got this error output:
[INFO]
[INFO] --- maven-jar-plugin:2.3.2:jar (default-jar) # simple-weather ---
[INFO]
[INFO] <<< maven-assembly-plugin:2.2-beta-5:assembly (default-cli) # simple-weather <<<
[INFO]
[INFO] --- maven-assembly-plugin:2.2-beta-5:assembly (default-cli) # simple-weather ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.094s
[INFO] Finished at: Wed Mar 21 15:53:03 EDT 2012
[INFO] Final Memory: 5M/10M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5:assembly (default-cli) on project simple-weather: Error readi
ng assemblies: No assembly descriptors found. -> [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
C:\home\Projects\simple-weather>
The problem is with the jar-with-dependencies descriptor in the plugins section. I googled around a bit, but didn't find a different way to do it from the book. So, I would be interested to know where I am going wrong.
Here is my pom.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.sonatype.mavenbook.custom</groupId>
<artifactId>simple-weather</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<name>simple-weather</name>
<url>http://www.sonatype.com</url>
<licenses>
<license>
<name>Apache 2</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
<comments>A business-friendly OSS license</comments>
</license>
</licenses>
<organization>
<name>Sonatype</name>
<url>http://www.sonatype.com</url>
</organization>
<developers>
<developer>
<id>jason</id>
<name>Jason Van Zyl</name>
<email>jason#maven.org</email>
<url>http://www.sonatype.com</url>
<organization>Sonatype</organization>
<organizationUrl>http://www.sonatype.com</organizationUrl>
<roles>
<role>developer</role>
</roles>
<timezone>-6</timezone>
</developer>
</developers>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
</dependency>
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>jaxen</groupId>
<artifactId>jaxen</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>velocity</groupId>
<artifactId>velocity</artifactId>
<version>1.5</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
</plugins>
</build>
</project>
Thanks much in advance for any clues.
The problem is you have your descriptor refs configured for the compile plugin instead of the assembly plugin.
Add this to your /build/plugins section
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.3</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
and remove the below from your compiler plugin config as it is not doing anything.
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>

Resources