How can I build a project that requires multiple versions of Scala? - scala

When I tried to build spark-ts package using Maven by executing
mvn package
"BUILD FAILURE" occurred with the following error.
[INFO] --- scala-maven-plugin:3.2.2:compile (scala-compile-first) # sparkts ---
[WARNING] Expected all dependencies to require Scala version: 2.11.4
[WARNING] com.cloudera.sparkts:sparkts:0.4.0-SNAPSHOT requires scala version: 2.11.4
[WARNING] com.cloudera.sparkts:sparkts:0.4.0-SNAPSHOT requires scala version: 2.11.4
[WARNING] org.scala-lang:scalap:2.11.4 requires scala version: 2.11.4
[WARNING] com.cloudera.sparkts:sparkts:0.4.0-SNAPSHOT requires scala version: 2.11.4
[WARNING] org.scala-lang:scala-compiler:2.11.4 requires scala version: 2.11.4
[WARNING] org.scala-lang:scala-reflect:2.11.4 requires scala version: 2.11.4
[WARNING] org.scala-lang.modules:scala-xml_2.11:1.0.2 requires scala version: 2.11.1
[WARNING] Multiple versions of scala libraries detected!
[INFO] .../spark-timeseries-master/src/main/java:-1: info: compiling
[INFO] .../spark-timeseries-master/src/main/scala:-1: info: compiling
[INFO] Compiling 29 source files to .../spark-timeseries-master/target/classes at 1597272142962
[ERROR] error: scala.reflect.internal.MissingRequirementError: object java.lang.Object in compiler mirror not found.
[ERROR] error: scala.reflect.internal.MissingRequirementError: object java.lang.Object in compiler mirror not found.
[ERROR] at scala.reflect.internal.MissingRequirementError$.signal(MissingRequirementError.scala:17)
[ERROR] at scala.reflect.internal.MissingRequirementError$.notFound(MissingRequirementError.scala:18)
[ERROR] at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:53)
[ERROR] at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:45)
[ERROR] at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:45)
[ERROR] at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:66)
[ERROR] at scala.reflect.internal.Mirrors$RootsBase.getClassByName(Mirrors.scala:102)
[ERROR] at scala.reflect.internal.Mirrors$RootsBase.getRequiredClass(Mirrors.scala:105)
[ERROR] at scala.reflect.internal.Definitions$DefinitionsClass.ObjectClass$lzycompute(Definitions.scala:257)
[ERROR] at scala.reflect.internal.Definitions$DefinitionsClass.ObjectClass(Definitions.scala:257)
[ERROR] at scala.reflect.internal.Definitions$DefinitionsClass.init(Definitions.scala:1387)
[ERROR] at scala.tools.nsc.Global$Run.<init>(Global.scala:1053)
[ERROR] at scala.tools.nsc.Driver.doCompile(Driver.scala:31)
[ERROR] at scala.tools.nsc.MainClass.doCompile(Main.scala:23)
[ERROR] at scala.tools.nsc.Driver.process(Driver.scala:51)
[ERROR] at scala.tools.nsc.Driver.main(Driver.scala:64)
[ERROR] at scala.tools.nsc.Main.main(Main.scala)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.base/java.lang.reflect.Method.invoke(Method.java:564)
[ERROR] at scala_maven_executions.MainHelper.runMain(MainHelper.java:164)
[ERROR] at scala_maven_executions.MainWithArgsInFile.main(MainWithArgsInFile.java:26)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.656 s
[INFO] Finished at: 2020-08-12T15:42:24-07:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal net.alchim31.maven:scala-maven-plugin:3.2.2:compile (scala-compile-first) on project sparkts: wrap: org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1) -> [Help 1]
Error message
I think the issue comes from the fact that the scala compiler depends on scala-xml, which requires an older version of scala. Is there any way fix the issue with multiple versions of scala?
Pom file for spark-ts looks like the following. It includes the "dependencies" that I specified, which still did not fix the issue. (Source code is here.)
<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.7</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>3.2.2</version>
<configuration>
<scalaVersion>${scala.complete.version}</scalaVersion>
<javacArgs>
<javacArg>-source</javacArg>
<javacArg>${java.version}</javacArg>
<javacArg>-target</javacArg>
<javacArg>${java.version}</javacArg>
</javacArgs>
</configuration>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>scala-compile-first</id>
<phase>process-resources</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>scala-test-compile-first</id>
<phase>process-test-resources</phase>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
<!-- This is what I added to fix the code. But, it still did not work... -->
<dependencies>
<dependency>
<groupId>org.scala-lang.modules</groupId>
<artifactId>scala-xml_2.11</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>org.scala-lang.modules</groupId>
<artifactId>scala-parser-combinators_2.11</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>org.scala-lang.modules</groupId>
<artifactId>scala-swing_2.11</artifactId>
<version>2.0.3</version>
</dependency>
</dependencies>
</plugin>
Edit: The problem was resolved after changing Java 10 to Java 8.

Related

Error only with maven: NoClassDefFoundError: feign/codec/Encoder

I created a project in Eclipse with the Maven wizard and edited the pom.xml file to include my dependencies. My project, which uses Open Feign, builds and runs in Eclipse, but I get the following runtime error when I build it at the command line with Maven:
Error: Unable to initialize main class edu.mills.cs180a.BookRepositoryImplFeign
Caused by: java.lang.NoClassDefFoundError: feign/codec/Encoder
Here is my pom.xml 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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>edu.mills.cs.180a</groupId>
<artifactId>book-client-example</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>book-client</name>
<description>Book REST API example</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.target>15</maven.compiler.target>
<maven.compiler.source> 15</maven.compiler.source>
</properties>
<dependencies>
<!-- Begin Open Feign dependencies -->
<!-- https://mvnrepository.com/artifact/io.github.openfeign/feign-core -->
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-core</artifactId>
<version>11.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.github.openfeign/feign-jackson -->
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-jackson</artifactId>
<version>11.0</version>
</dependency>
<!-- End Open Feign dependencies -->
<dependency>
<groupId>io.github.openfeign.form</groupId>
<artifactId>feign-form</artifactId>
<version>3.8.0</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
<version>2.2.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-ribbon</artifactId>
<version>2.2.5.RELEASE</version>
</dependency>
</dependencies>
</project>
To build and run it in Eclipse, I only need the first two dependencies. I added the rest in an attempt to eliminate the error.
Here is a command-line transcript:
$ mvn -v
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: C:\Program Files\apache-maven-3.6.3
Java version: 15.0.1, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk-15.0.1
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
$ mvn clean
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------< edu.mills.cs.180a:book-client-example >----------------
[INFO] Building book-client 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # book-client-example ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.153 s
[INFO] Finished at: 2020-11-03T10:54:18-08:00
[INFO] -----------------------------------------------------------------------
$ mvn package
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------< edu.mills.cs.180a:book-client-example >----------------
[INFO] Building book-client 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # book-client-example ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\ellen\eclipse-workspace9\book-client-example\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # book-client-example ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 4 source files to C:\Users\ellen\eclipse-workspace9\book-client-example\target\classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # book-client-example ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\ellen\eclipse-workspace9\book-client-example\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # book-client-example ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # book-client-example ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) # book-client-example ---
[INFO] Building jar: C:\Users\ellen\eclipse-workspace9\book-client-example\target\book-client-example-0.0.1-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.748 s
[INFO] Finished at: 2020-11-03T10:54:25-08:00
[INFO] ------------------------------------------------------------------------
$ java -cp target/book-client-example-0.0.1-SNAPSHOT.jar edu.mills.cs180a.BookRepositoryImplFeign
Error: Unable to initialize main class edu.mills.cs180a.BookRepositoryImplFeign
Caused by: java.lang.NoClassDefFoundError: feign/codec/Encoder
See also the repo.
Update
Per below answer, I added this to pom.xml:
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.1</version>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>edu.mills.cs180a.BookRepositoryImplFeign</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
I still get the same error when I try building and running:
$ java -jar target/book-client-example-0.0.1-SNAPSHOT.jar
Error: Unable to initialize main class edu.mills.cs180a.BookRepositoryImplFeign
Caused by: java.lang.NoClassDefFoundError: feign/codec/Encoder
The problem is how you run your code in the end.
When you compile and build your project, Maven will put all your compiled code into your jar file. This is the one you add to the classpath for execution. But you already know there are two more dependencies which you did not specify.
What you may want Maven to do is copy all your dependencies to your target folder. This can be done via the maven dependency plugin.
Next, you probably do not want to specify all the required libs on the classpath when you run your code. At least in my projects I add the main class and the classpath into the manifest using the maven jar plugin.
Here is a snippet from my pom.xml:
<project>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.1</version>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>edu.mills.cs180a.BookRepositoryImplFeign</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>
With that in your pom you should be able to run your code like this:
java -jar target\book-client-example-0.0.1-SNAPSHOT.jar

Maven not building Scala project correctly

Problem
I got a Maven - Scala project. It compiles etc. when I want to build it in IntelliJ it works but the output jar is empty except a pom.xml.
When a build the whole project via command line with mvn scala:compile I get the following errors:
[INFO] Compiling 67 source files to /Users/my.name/Documents/company/util/util/target/classes at 1555483575272
[ERROR] error: scala.reflect.internal.MissingRequirementError: object java.lang.Object in compiler mirror not found.
[ERROR] at scala.reflect.internal.MissingRequirementError$.signal(MissingRequirementError.scala:17)
[ERROR] at scala.reflect.internal.MissingRequirementError$.notFound(MissingRequirementError.scala:18)
[ERROR] at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:53)
[ERROR] at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:45)
[ERROR] at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:45)
[ERROR] at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:66)
[ERROR] at scala.reflect.internal.Mirrors$RootsBase.getClassByName(Mirrors.scala:102)
[ERROR] at scala.reflect.internal.Mirrors$RootsBase.getRequiredClass(Mirrors.scala:105)
[ERROR] at scala.reflect.internal.Definitions$DefinitionsClass.ObjectClass$lzycompute(Definitions.scala:257)
[ERROR] at scala.reflect.internal.Definitions$DefinitionsClass.ObjectClass(Definitions.scala:257)
[ERROR] at scala.reflect.internal.Definitions$DefinitionsClass.init(Definitions.scala:1394)
[ERROR] at scala.tools.nsc.Global$Run.<init>(Global.scala:1215)
[ERROR] at scala.tools.nsc.Driver.doCompile(Driver.scala:31)
[ERROR] at scala.tools.nsc.MainClass.doCompile(Main.scala:23)
[ERROR] at scala.tools.nsc.Driver.process(Driver.scala:51)
[ERROR] at scala.tools.nsc.Driver.main(Driver.scala:64)
[ERROR] at scala.tools.nsc.Main.main(Main.scala)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.base/java.lang.reflect.Method.invoke(Method.java:564)
[ERROR] at scala_maven_executions.MainHelper.runMain(MainHelper.java:164)
[ERROR] at scala_maven_executions.MainWithArgsInFile.main(MainWithArgsInFile.java:26)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.256 s
[INFO] Finished at: 2019-04-17T08:46:16+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal net.alchim31.maven:scala-maven-plugin:3.3.1:compile (default-cli) on project util: wrap: org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
I also can run mvn compile which succeeds but produces an empty jar:
[INFO] Building util 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # util ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/markus.geilehner/Documents/Syniverse/util/util/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) # util ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 6 source files to /Users/markus.geilehner/Documents/Syniverse/util/util/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.334 s
[INFO] Finished at: 2019-04-17T09:03:55+02:00
[INFO] ------------------------------------------------------------------------
Project File Structure
-util
--src
---main
----scala
-----com.company.util
------Scala Classes and packages
pom.xml
Here some parts of the pom.xml. I use the net.alchim Scala-maven plugin.
The build process is configured to use the scala directory.
<build>
<sourceDirectory>src/main/scala</sourceDirectory>
<testSourceDirectory>src/test/scala</testSourceDirectory>
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>3.3.1</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.0</version>
<configuration>
<reportPlugins>
<plugin>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.2</version>
</plugin>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>3.3.1</version>
<configuration>
<jvmArgs>
<jvmArg>-Xms64m</jvmArg>
<jvmArg>-Xmx1024m</jvmArg>
</jvmArgs>
</configuration>
</plugin>
</reportPlugins>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
Solution
I had the same error when working with a scala project combined with maven.
Issue-1
One Issue can be that you use the wrong Java-Version (9/10) try to change it to Java 8 (1.8) in IntelliJ (File => Project-Structure).
Issue-2
In your pom add the following execution beneath the maven-scala plugin.
<executions>
<execution>
<id>compile</id>
<goals>
<goal>compile</goal>
</goals>
<phase>compile</phase>
</execution>
<execution>
<id>test-compile</id>
<goals>
<goal>testCompile</goal>
</goals>
<phase>test-compile</phase>
</execution>
<execution>
<phase>process-resources</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
Do a clean install an try again.

Cannot update mule version to 3.6 in esb mule maven project

i am using Anypoint Studio (latest version to date)
i cant find what is wrong, everything messes up when i change the mule-version to 3.6
this is 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.hamgam.esb</groupId>
<artifactId>ESBDroolsRouter</artifactId>
<packaging>mule</packaging>
<name>Mule DroolsJBPM Application</name>
<version>1.0-SNAPSHOT</version>
<description></description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<mule.version>3.6.0</mule.version>
<!-- Tools properties -->
<eclipsePluginVersion>2.5</eclipsePluginVersion>
<vmtype>org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType</vmtype>
<jdkName>JavaSE-1.7</jdkName>
<jdk.version>1.7</jdk.version>
</properties>
<build>
<!--
Use a newer version of the install plugin than what your Maven uses by default. The
older version failed to install the project if there was no target/classes folder.
Since we use mule packaging on the project we actually create and attach the zip that
must be installed.
-->
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.mule.tools</groupId>
<artifactId>maven-mule-plugin</artifactId>
<version>1.6</version>
<extensions>true</extensions>
<configuration>
<copyToAppsDirectory>true</copyToAppsDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>${jdk.version}</source>
<target>${jdk.version}</target>
<encoding>ISO-8859-1</encoding>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<finalName>${project.artifactId}-${project.version}</finalName>
<descriptors>
<descriptor>assembly.xml</descriptor>
</descriptors>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>${eclipsePluginVersion}</version>
<configuration>
<!-- by default download all sources when generating project files -->
<downloadSources>true</downloadSources>
<classpathContainers>
<classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER/${vmtype}/${jdkName}
</classpathContainer>
</classpathContainers>
</configuration>
</plugin>
<!--
make sure that MULE_HOME is set when building (required below when copying the
artifact to Mule's apps directory
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.0-beta-1</version>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireProperty>
<property>env.MULE_HOME</property>
<message>You must set MULE_HOME before installing the example.</message>
</requireProperty>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<!--
automatically deploy the artifact after it has been built
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<id>package-example</id>
<phase>install</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<copy file="${project.build.directory}/${project.build.finalName}.zip"
todir="${env.MULE_HOME}/apps" overwrite="true"/>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<!-- plugins for creating site reports -->
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>2.4.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.5</version>
<configuration>
<configLocation>http://mulesoft.org/download/attachments/92/checkstyle.xml?version=1</configLocation>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>2.5</version>
<configuration>
<targetJdk>${jdk.version}</targetJdk>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.5</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>taglist-maven-plugin</artifactId>
<version>2.4</version>
<configuration>
<tags>
<tag>TODO</tag>
<tag>#todo</tag>
<tag>FIXME</tag>
<tag>#fixme</tag>
<tag>#deprecated</tag>
</tags>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>2.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.7</version>
<configuration>
<source>${jdk.version}</source>
<links>
<link>http://java.sun.com/j2ee/1.4/docs/api</link>
<link>http://java.sun.com/j2se/1.4.2/docs/api</link>
<link>http://java.sun.com/j2se/1.5.0/docs/api</link>
</links>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jdepend-maven-plugin</artifactId>
<version>2.0-beta-2</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>2.3.2</version>
</plugin>
</plugins>
</reporting>
<!-- Mule Dependencies -->
<dependencies>
<dependency>
<groupId>org.mule</groupId>
<artifactId>mule-core</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>
<!-- Xml configuration -->
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-spring-config</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>
<!-- Mule Transports -->
<dependency>
<groupId>org.mule.transports</groupId>
<artifactId>mule-transport-file</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mule.transports</groupId>
<artifactId>mule-transport-vm</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mule.transports</groupId>
<artifactId>mule-transport-jms</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>
<!-- Mule Modules -->
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-bpm</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-drools</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-jbpm</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-client</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>
<!-- for testing -->
<dependency>
<groupId>org.mule.tests</groupId>
<artifactId>mule-tests-functional</artifactId>
<version>${mule.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>mockobjects</groupId>
<artifactId>mockobjects-core</artifactId>
<version>0.09</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.1</version>
<scope>test</scope>
</dependency>
<!-- GOLI -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>4.2.0.Final</version>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.0.0.GA</version>
</dependency>
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<version>10.11.1.1</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-core</artifactId>
<version>5.7.0</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-broker</artifactId>
<version>5.10.1</version>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-invoker</artifactId>
<version>2.1.1</version>
</dependency>
<dependency>
<groupId>org.jdom</groupId>
<artifactId>jdom</artifactId>
<version>2.0.2</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>muleforge-repo</id>
<name>MuleForge Repository</name>
<url>http://repository.muleforge.org</url>
<layout>default</layout>
</repository>
<repository>
<id>codehaus-repo</id>
<name>Codehaus Repository</name>
<url>http://dist.codehaus.org/mule/dependencies/maven2</url>
<layout>default</layout>
</repository>
</repositories>
</project>
when i try to change the mule-version from 3.4 to 3.6 i get this odd compile problem complaining about not founding one of my classes
this is what i am facing :
[12:55:21] Running: mvn clean package
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Mule DroolsJBPM Application 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # ESBDroolsRouter ---
[INFO] Deleting D:\MuleWorkspace\ESBDroolsRouter\target
[INFO]
[INFO] --- maven-mule-plugin:1.6:attach-test-resources (default-attach-test-resources) # ESBDroolsRouter ---
[INFO] attaching test resource D:\MuleWorkspace\ESBDroolsRouter\src\main\app
[INFO]
[INFO] --- maven-resources-plugin:2.7:resources (default-resources) # ESBDroolsRouter ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 7 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) # ESBDroolsRouter ---
[INFO] Compiling 4 source files to D:\MuleWorkspace\ESBDroolsRouter\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\RuleXMLToDRL.java:[3,15] error: package org.jdom does not exist
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\RuleXMLToDRL.java:[4,15] error: package org.jdom does not exist
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\RuleXMLToDRL.java:[5,21] error: package org.jdom.input does not exist
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\XMLToDTO.java:[3,15] error: package org.jdom does not exist
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\XMLToDTO.java:[4,15] error: package org.jdom does not exist
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\XMLToDTO.java:[5,15] error: package org.jdom does not exist
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\XMLToDTO.java:[6,22] error: package org.jdom.filter does not exist
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\XMLToDTO.java:[7,21] error: package org.jdom.input does not exist
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\RuleXMLToDRL.java:[3,15] error: package org.jdom does not exist
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\RuleXMLToDRL.java:[4,15] error: package org.jdom does not exist
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\RuleXMLToDRL.java:[5,21] error: package org.jdom.input does not exist
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\XMLToDTO.java:[3,15] error: package org.jdom does not exist
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\XMLToDTO.java:[4,15] error: package org.jdom does not exist
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\XMLToDTO.java:[5,15] error: package org.jdom does not exist
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\XMLToDTO.java:[6,22] error: package org.jdom.filter does not exist
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\XMLToDTO.java:[7,21] error: package org.jdom.input does not exist
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\RuleXMLToDRL.java:[42,12] error: cannot find symbol
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\RuleXMLToDRL.java:[42,37] error: cannot find symbol
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\RuleXMLToDRL.java:[48,12] error: cannot find symbol
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\RuleXMLToDRL.java:[51,12] error: cannot find symbol
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\RuleXMLToDRL.java:[53,17] error: cannot find symbol
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\RuleXMLToDRL.java:[57,17] error: cannot find symbol
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\RuleXMLToDRL.java:[60,21] error: cannot find symbol
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\RuleXMLToDRL.java:[61,21] error: cannot find symbol
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\XMLToDTO.java:[22,3] error: cannot find symbol
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\XMLToDTO.java:[22,28] error: cannot find symbol
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\XMLToDTO.java:[23,3] error: cannot find symbol
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\XMLToDTO.java:[27,4] error: cannot find symbol
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\XMLToDTO.java:[27,31] error: cannot find symbol
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\XMLToDTO.java:[28,13] error: cannot find symbol
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\XMLToDTO.java:[37,11] error: cannot find symbol
[INFO] 31 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.328 s
[INFO] Finished at: 2015-02-02T12:55:24+03:30
[INFO] Final Memory: 26M/215M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project ESBDroolsRouter: Compilation failure: Compilation failure:
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\RuleXMLToDRL.java:[3,15] error: package org.jdom does not exist
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\RuleXMLToDRL.java:[4,15] error: package org.jdom does not exist
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\RuleXMLToDRL.java:[5,21] error: package org.jdom.input does not exist
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\XMLToDTO.java:[3,15] error: package org.jdom does not exist
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\XMLToDTO.java:[4,15] error: package org.jdom does not exist
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\XMLToDTO.java:[5,15] error: package org.jdom does not exist
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\XMLToDTO.java:[6,22] error: package org.jdom.filter does not exist
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\XMLToDTO.java:[7,21] error: package org.jdom.input does not exist
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\RuleXMLToDRL.java:[3,15] error: package org.jdom does not exist
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\RuleXMLToDRL.java:[4,15] error: package org.jdom does not exist
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\RuleXMLToDRL.java:[5,21] error: package org.jdom.input does not exist
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\XMLToDTO.java:[3,15] error: package org.jdom does not exist
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\XMLToDTO.java:[4,15] error: package org.jdom does not exist
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\XMLToDTO.java:[5,15] error: package org.jdom does not exist
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\XMLToDTO.java:[6,22] error: package org.jdom.filter does not exist
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\XMLToDTO.java:[7,21] error: package org.jdom.input does not exist
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\RuleXMLToDRL.java:[42,12] error: cannot find symbol
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\RuleXMLToDRL.java:[42,37] error: cannot find symbol
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\RuleXMLToDRL.java:[48,12] error: cannot find symbol
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\RuleXMLToDRL.java:[51,12] error: cannot find symbol
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\RuleXMLToDRL.java:[53,17] error: cannot find symbol
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\RuleXMLToDRL.java:[57,17] error: cannot find symbol
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\RuleXMLToDRL.java:[60,21] error: cannot find symbol
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\RuleXMLToDRL.java:[61,21] error: cannot find symbol
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\XMLToDTO.java:[22,3] error: cannot find symbol
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\XMLToDTO.java:[22,28] error: cannot find symbol
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\XMLToDTO.java:[23,3] error: cannot find symbol
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\XMLToDTO.java:[27,4] error: cannot find symbol
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\XMLToDTO.java:[27,31] error: cannot find symbol
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\XMLToDTO.java:[28,13] error: cannot find symbol
[ERROR] \MuleWorkspace\ESBDroolsRouter\src\main\java\com\hamgam\hit\esb\XMLToDTO.java:[37,11] error: cannot find symbol
[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
they changed several libraries in 3.6.0 (updated them) so there is a chance the class you are looking for may have move around.
Any ways the stack trace just shows missing packages, and I can find those in 3.5.1 and 3.6.0 too. Besides they are present in different jars.
Could you please check which class is the one that is missing?
I would suggest to update JDOM to the latest version.

Maven is not finding scala tests

I have a scala test class but when I attempt to run using the Maven goal 'test'
the tests are not being run. I receive the Maven message "There are no tests to run." even though the tests are located in the scala test class. Do I need to add extra configuration ?
Here is my package setup :
Here is the output of the Maven "test" goal when run against the pom file :
[INFO] Scanning for projects... [INFO]
[INFO]
------------------------------------------------------------------------ [INFO] Building scala.maven.test 0.0.1-SNAPSHOT [INFO]
------------------------------------------------------------------------ [INFO] [INFO] --- maven-resources-plugin:2.4.3:resources
(default-resources) # scala.maven.test --- [WARNING] Using platform
encoding (Cp1252 actually) to copy filtered resources, i.e. build is
platform dependent! [INFO] Copying 0 resource [INFO] [INFO] ---
maven-scala-plugin:2.9.1:add-source (scala-compile-first) #
scala.maven.test --- [INFO] Add Source directory:
C:\workspaces\29112012\scala.maven.test\src\main\scala [INFO] Add Test
Source directory:
C:\workspaces\29112012\scala.maven.test\src\test\scala [INFO] [INFO]
--- maven-scala-plugin:2.9.1:compile (scala-compile-first) # scala.maven.test --- [ERROR]
C:\workspaces\29112012\scala.maven.test\src\main\java [ERROR]
C:\workspaces\29112012\scala.maven.test\src\main\scala [ERROR]
C:\workspaces\29112012\scala.maven.test\src\test\scala [INFO]
Compiling 2 source files to
C:\workspaces\29112012\scala.maven.test\target\classes [INFO] [INFO]
--- maven-compiler-plugin:2.0.2:compile (default-compile) # scala.maven.test --- [INFO] Nothing to compile - all classes are up to
date [INFO] [INFO] --- maven-compiler-plugin:2.0.2:compile (default)
# scala.maven.test --- [INFO] Nothing to compile - all classes are up
to date [INFO] [INFO] --- maven-resources-plugin:2.4.3:testResources
(default-testResources) # scala.maven.test --- [WARNING] Using
platform encoding (Cp1252 actually) to copy filtered resources, i.e.
build is platform dependent! [INFO] Copying 0 resource [INFO] [INFO]
--- maven-scala-plugin:2.9.1:testCompile (scala-test-compile) # scala.maven.test --- [ERROR]
C:\workspaces\29112012\scala.maven.test\src\test\java [ERROR]
C:\workspaces\29112012\scala.maven.test\src\test\java..\scala [INFO]
Compiling 1 source files to
C:\workspaces\29112012\scala.maven.test\target\test-classes [INFO]
[INFO] --- maven-compiler-plugin:2.0.2:testCompile
(default-testCompile) # scala.maven.test --- [INFO] Nothing to compile
- all classes are up to date [INFO] [INFO] --- maven-surefire-plugin:2.7.1:test (default-test) # scala.maven.test ---
[INFO] Surefire report directory:
C:\workspaces\29112012\scala.maven.test\target\surefire-reports
------------------------------------------------------- T E S T S
------------------------------------------------------- There are no tests to run.
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO]
------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO]
------------------------------------------------------------------------ [INFO] Total time: 11.354s [INFO] Finished at: Fri Nov 30 16:57:05 GMT
2012 [INFO] Final Memory: 7M/17M [INFO]
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>scala.maven.test</groupId>
<artifactId>scala.maven.test</artifactId>
<version>0.0.1-SNAPSHOT</version>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.scala-tools</groupId>
<artifactId>maven-scala-plugin</artifactId>
<version>2.9.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
</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>
org.scala-tools
</groupId>
<artifactId>
maven-scala-plugin
</artifactId>
<versionRange>
[2.9.1,)
</versionRange>
<goals>
<goal>add-source</goal>
<goal>compile</goal>
<goal>testCompile</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.scala-tools</groupId>
<artifactId>maven-scala-plugin</artifactId>
<executions>
<execution>
<id>scala-compile-first</id>
<phase>process-resources</phase>
<goals>
<goal>add-source</goal>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>scala-test-compile</id>
<phase>process-test-resources</phase>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_2.9.0-1</artifactId>
<version>2.0.M5</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
</dependency>
</dependencies>
</project>
Even though this is a very late reply, but I wrote it hoping that someone might get benefitted from it in case their scala unit test are not getting discovered. One of the major and silent culprit is the absolute path to the test classes. If there is a space in the name of any directory on the path, scalatest won't pick it up. Rename such directories for successful running of unit tests.
What's your test class name? Maven can be pretty picky and by default I think it requires the class name to end in 'Test'.
See my previos post:
Maven won't run tests

Maven assembly - Error reading assemblies

I have defined a personalized jar-with-dependencies assembly descriptor. However, when I execute it with mvn assembly:assembly, I get :
...
[INFO] META-INF/ already added, skipping
[INFO] META-INF/MANIFEST.MF already added, skipping
[INFO] javax/ already added, skipping
[INFO] META-INF/ already added, skipping
[INFO] META-INF/MANIFEST.MF already added, skipping
[INFO] META-INF/maven/ already added, skipping
[INFO] [assembly:assembly {execution: default-cli}]
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error reading assemblies: No assembly descriptors found.
My jar-with-dependencies.xml is in src/main/resources/assemblies/.
My assembly descriptor is the following :
<?xml version='1.0' encoding='UTF-8'?>
<assembly>
<id>jar-with-dependencies</id>
<formats>
<format>jar</format>
</formats>
<dependencySets>
<dependencySet>
<scope>runtime</scope>
<unpack>true</unpack>
<unpackOptions>
<excludes>
<exclude>**/LICENSE*</exclude>
<exclude>**/README*</exclude>
</excludes>
</unpackOptions>
</dependencySet>
</dependencySets>
<fileSets>
<fileSet>
<directory>${project.build.outputDirectory}</directory>
<outputDirectory>/</outputDirectory>
</fileSet>
<fileSet>
<directory>src/main/resources/META-INF/services</directory>
<outputDirectory>META-INF/services</outputDirectory>
</fileSet>
</fileSets>
</assembly>
And my project pom.xml is :
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-5</version>
<executions>
<execution>
<id>jar-with-dependencies</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>jar-with-dependencies.xml</descriptor>
</descriptors>
<archive>
<manifest>
<mainClass>org.my.app.HowTo</mainClass>
</manifest>
</archive>
</configuration>
</execution>
</executions>
</plugin>
When mvn assembly:assembly is performed, dependencies are unpacked and I get the previous error when unpack has finished.
Moreover, if I execute mvn -e assembly:assembly it is say that no descriptors has been found, however it try to unpack dependencies and a JAR with dependencies is created but it doesn't contain META-INF/services/* as specified in descriptor :
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error reading assemblies: No assembly descriptors found.
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Error reading assemblies: No assembly descriptors found.
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:284)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error reading assemblies: No assembly descriptors found.
at org.apache.maven.plugin.assembly.mojos.AbstractAssemblyMojo.execute(AbstractAssemblyMojo.java:356)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
... 17 more
Caused by: org.apache.maven.plugin.assembly.io.AssemblyReadException: No assembly descriptors found.
at org.apache.maven.plugin.assembly.io.DefaultAssemblyReader.readAssemblies(DefaultAssemblyReader.java:206)
at org.apache.maven.plugin.assembly.mojos.AbstractAssemblyMojo.execute(AbstractAssemblyMojo.java:352)
... 19 more
I don't see my error. Does someone has a solution ?
There are two problems here. First, when using your own descriptor, you must specify the path to your customized descriptor file (by the way, you can use any location but putting the descriptor in src/main/resources is maybe not the best choice, you don't really want the descriptor to be packaged in your application, I'd use the standard location which is src/main/assembly as mentioned in this page).
<descriptors>
<descriptor>src/main/assembly/jar-with-dependencies.xml</descriptor>
</descriptors>
Second, your configuration element is currently inside an execution block and is thus specific to this execution. In other words, it won't apply if you run assembly:assembly on the command line. So, if you want to call assembly:assembly with a custom descriptor, either use:
mvn assembly:assembly -Ddescriptor=path/to/descriptor.xml
Or move the configuration outside the execution element (to make the configuration global):
<project>
...
<build>
...
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-5</version>
<configuration>
<descriptors>
<descriptor>path/to/descriptor.xml</descriptor>
</descriptors>
...
</configuration>
</plugin>
</plugins>
...
</build>
...
</project>
assembly is trying to open /assemblies/${ref}.xml in classpath
check this
http://maven.apache.org/plugins/maven-assembly-plugin/xref/org/apache/maven/plugin/assembly/io/DefaultAssemblyReader.html