Correction to my previous post: I realize now that the problem described below is actually caused by my helper script changing into the ModuleB directory before running the command below, which would understandably cause the problem described.

HOWEVER, I am still having a problem, which is actually best described in this post:

http://www.nabble.com/Maven-exec:java-ClassNotFoundException-td15613520s177.html

Is there a solution to this? It sounds like if the class is not found, we'd like the plugin to not fail, but keep running, to allow the plugin to try again on the sub-modules. Is that possible?

-Josh


On Apr 8, 2008, at 11:01 PM, Joshua ChaitinPollak wrote:

Hi, I'm having a bit of trouble with the exec-maven-plugin. I've got a project setup with two sub-modules, and when I run the exec plugin on a main class that is in one module that depends on another, I get an error that the dependancy module is not in the repository. I don't want to have to install the project just to exec it, and unit testing works with dependancies without installing, so I'm a bit puzzled.

Any help would be greatly appreciated.

Here is a more concrete example:

MyProj
  +-----------ModuleA
  +-----------ModuleB

ModuleB depends on ModuleA and has a class with a main function.

If I run "mvn compile exec:java - Dexec.mainClass="MyProj.ModuleB.MyClass"

INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

Missing:
----------
1) MyProj:ModuleA.jar:1.0-SNAPSHOT

 Try downloading the file manually from the project website.

 Then, install it using the command:
mvn install:install-file -DgroupId=MyProj -DartifactId=ModuleA - Dversion=1-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file

Alternatively, if you host your own repository you can deploy the file there: mvn deploy:deploy-file -DgroupId=MyProj -DartifactId=ModuleA - Dversion=1-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

 Path to dependency:
        1) MyProj:ModuleA.jar:1.0-SNAPSHOT
        2) MyProj:ModuleB.jar:1.0-SNAPSHOT


--
Joshua ChaitinPollak | Software Engineer
Kiva Systems, Inc., 225 Wildwood Ave, Woburn, MA 01970







--
Joshua ChaitinPollak | Software Engineer
Kiva Systems, Inc., 225 Wildwood Ave, Woburn, MA 01970






Reply via email to