I've discovered my problem and submitted a patch for the exec-maven-
plugin:
http://jira.codehaus.org/browse/MEXEC-43
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