Hello,
I am using maven for a multi module project. The project consists of three
modules (each having its own directory):
hmiCore
eBioFlowCore
eBioFlowLauncher
I have a central pom.xml and which contains the build settings, and the
modules (corresponding to the directories mentioned above). Each module has
his own pom.xml file, containing module specific dependencies. This pom.xml
file are childs (inheritance) from the central pom.xml file to copy the
central settings. The eBioFlowLauncher contains a main class
(nl.utwente.ewi.hmi.ebioflow.launcher.EBioFlowLauncher).
The project compiles well and packages well (using maven package from
command line). All modules are compiled into their target/classes directory
and also the jar files are created.
However, when I perform a mvn exec:java, I get a classNotFoundException. The
main pom file is:
--------------------------- Pom.xml ------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>nl.utwente.ewi.hmi.ebioflow</groupId>
<artifactId>eBioFlow</artifactId>
<packaging>pom</packaging>
<name>eBioFlow</name>
<version>1.0</version>
<url>http://maven.apache.org</url>
<build>
<directory>${project.basedir}/target</directory>
<outputDirectory>
${project.basedir}/target/${pom.artifactId}/classes
</outputDirectory>
<finalName>
${pom.groupId}.${pom.artifactId}-${pom.version}
</finalName>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
<descriptor>
src/main/descriptors/assembly.xml
</descriptor>
</descriptors>
<archive>
<manifest>
<mainClass>
nl.utwente.ewi.hmi.ebioflow.launcher.EBioFlowLauncher
</mainClass>
</manifest>
</archive>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>attached</goal>
</goals>
</execution>
</executions>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>
nl.utwente.ewi.hmi.ebioflow.launcher.EBioFlowLauncher
</mainClass>
<executableDependency>
<groupId>nl.utwente.ewi.hmi.ebioflow</groupId>
<artifactId>EBioFlowLauncher</artifactId>
</executableDependency>
<dependencies>
<dependency>
<groupId>net.sf.jpf</groupId>
<artifactId>jpf-boot</artifactId>
<version>1.5</version>
</dependency>
<dependency>
<groupId>
nl.utwente.ewi.hmi.ebioflow
</groupId>
<artifactId>hmiCore</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>
nl.utwente.ewi.hmi.ebioflow
</groupId>
<artifactId>eBioFlowCore</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>
nl.utwente.ewi.hmi.ebioflow
</groupId>
<artifactId>EBioFlowLauncher</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
</configuration>
</plugin>
</plugins>
</build>
<modules>
<module>hmiCore</module>
<module>eBioFlowCore</module>
<module>eBioFlowLauncher</module>
</modules>
<developers>
<developer>
<id>WassinkI</id>
<name>Ingo Wassink</name>
[EMAIL PROTECTED]
<organization>
Human Media Interaction Group - University of
Twente
</organization>
</developer>
</developers>
<licenses>
<license>
<name>GNU Lesser General Public License</name>
<url>http://www.gnu.org/licenses/lgpl.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
</project>
--------------------------- end Pom.xml ------------------------------
The output I get from mvn -exec:java -e is:
******************** Start output *************************
[INFO] Scanning for projects...
[INFO] Reactor build order:
[INFO] eBioFlow
[INFO] HMI core package
[INFO] eBioFlow Core library
[INFO] eBioFlow Launcher
[INFO] Searching repository for plugin with prefix: 'exec'.
[INFO]
------------------------------------------------------------------------
[INFO] Building eBioFlow
[INFO] task-segment: [exec:java]
[INFO]
------------------------------------------------------------------------
[INFO] Preparing exec:java
[INFO] No goals needed for project - skipping
[INFO] [exec:java]
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] null
[INFO]
------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:564)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandalone
Goal(DefaultLifecycleExecutor.java:493)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
ltLifecycleExecutor.java:463)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
dleFailures(DefaultLifecycleExecutor.java:311)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
ts(DefaultLifecycleExecutor.java:278)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
fecycleExecutor.java:143)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:333)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:126)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:282)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.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
at
org.codehaus.mojo.exec.ExecJavaMojo.execute(ExecJavaMojo.java:318)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
nManager.java:447)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:539)
... 16 more
Caused by: java.lang.ClassNotFoundException:
nl.utwente.ewi.hmi.ebioflow.launche
r.EBioFlowLauncher
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:264)
at java.lang.Thread.run(Thread.java:619)
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 1 second
[INFO] Finished at: Thu Feb 21 17:05:40 CET 2008
[INFO] Final Memory: 4M/8M
[INFO]
------------------------------------------------------------------------
******************** End output *************************
Can anyone tell me why this is hapening? I expect all jar files or at least
the class files are in the classpath using this mvn exec:java command. Or am
I wrong? Can anyone help me solving this problem?
Thanks,
Ingo Wassink
--
View this message in context:
http://www.nabble.com/Maven-exec%3Ajava-ClassNotFoundException-tp15613520s177p15613520.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]