RE: Multi-Project Build: copy resulting jars into dependent webapp

2006-04-17 Thread Brian E. Fox
So are you just running mvn compile or package and not install?
Dependency wants to find them in the local (or remote) repository, if
you haven't run install, they won't be there. If there is some other use
case that prevents you from running install, then file a jira
enhancement against dependency. I may be able to find a way to locate
the jar in the build tree if a flag is set, although I personally can't
think of a use case for this. (and I'm pretty sure it would only
reasonably work in a multi project build, ie if you just built one of
them, I might not be able to locate the dependent jar)

-Original Message-
From: SkipWalker [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 13, 2006 2:48 PM
To: users@maven.apache.org
Subject: Multi-Project Build: copy resulting jars into dependent webapp


I'm trying to get around using the webstart plugin that isn't ready for
primetime.  In order to do that, I'm trying to use the codehause
dependency plugin to copy my webstart application project jar, it's
other project dependencies, and some 3rd party dependencies into a
directory in my webapp output so they will become part of the resulting
war.

I'm trying to do something along the lines of the first suggestion at
codehaus for the webstart plugin, just not using the webstart plugin
itself, just the dependency plugin.

http://mojo.codehaus.org/webstart-maven-plugin-parent/webstart-maven-plu
gin/howto.html

I'm running into the problem that the dependency copy won't copy my own
project jars common.jar, and webstart-client.jar saying it can't resolve
the artifacts.  I guess it's looking in the repo and not finding the
jars.  

The dependency:copy plugin is working fine for the 3rd party
dependencies, copying them into the appropriate place.  The build is
just balking at copying my own jars that were created earlier in the
multi-project build.

So I guess the crux of my question in is, how can I copy the resulting
jars from the other projects in my multi-project build into a directory
in my webapp before it gets packaged?

Any help is appreciated.

Here's the error
_

[INFO]

[ERROR] BUILD ERROR
[INFO]

[INFO] Failed to resolve artifact.

GroupId: com.myorg
ArtifactId: common
Version: 1.0-SNAPSHOT

Reason: Unable to download the artifact from any repository

Try downloading the file manually from the project website.

Then, install it using the command:
mvn install:install-file -DgroupId=com.myorg -DartifactId=common\
-Dversion=1.0-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file


  com.myorg:common:jar:1.0-SNAPSHOT

from the specified remote repositories:

  central (http://repo1.maven.org/maven2),

_

Here's more about my setup:

I've tried this with maven 2.0.3. and 2.0.4

I've got a pretty standard setup.

projects/pom.xml
projects/common/pom.xml
projects/webstart-client/pom.xml
projects/webapp/pom.xml


I need to copy the resulting jar artifact from the common project and
the resulting jar from the webstart-client project into the webapp's
client directory.  

So, in my webapp pom.xml I have:


org.codehaus.mojo
dependency-maven-plugin



process-resources

copy






com.myorg
common
1.0-SNAPSHOT
jar


com.myorg
webstart-client
1.0-SNAPSHOT
jar


jgoodies
binding
1.1
jar



   
${project.build.directory}/${project.build.finalName}/c
lient



mywebapp





com.myorg
common
1.0-SNAPSHOT
compile
  

com.myorg
webstart-client
1.0-SNAPSHOT
compile

...

Thanks,
Skip


--
View this message in context:
http://www.nabble.com/Multi-Project-Build%3A-copy-resulting-jars-into-de
pendent-webapp-t1446168.html#a3906335
Sent from the Maven - Users forum at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional comm

Re: Multi-Project Build: copy resulting jars into dependent webapp

2006-04-13 Thread Wayne Fay
Have you tried first running:
mvn install

To install the dependencies into your local repo, so they are found
during the later build process?

Obviously you'd rather do it all in one step, but this might be a
solution your problem.

Wayne

On 4/13/06, SkipWalker <[EMAIL PROTECTED]> wrote:
>
> I'm trying to get around using the webstart plugin that isn't ready for
> primetime.  In order to do that, I'm trying to use the codehause dependency
> plugin to copy my webstart application project jar, it's other project
> dependencies, and some 3rd party dependencies into a directory in my webapp
> output so they will become part of the resulting war.
>
> I'm trying to do something along the lines of the first suggestion at
> codehaus for the webstart plugin, just not using the webstart plugin itself,
> just the dependency plugin.
>
> http://mojo.codehaus.org/webstart-maven-plugin-parent/webstart-maven-plugin/howto.html
>
> I'm running into the problem that the dependency copy won't copy my own
> project jars common.jar, and webstart-client.jar saying it can't resolve the
> artifacts.  I guess it's looking in the repo and not finding the jars.
>
> The dependency:copy plugin is working fine for the 3rd party dependencies,
> copying them into the appropriate place.  The build is just balking at
> copying my own jars that were created earlier in the multi-project build.
>
> So I guess the crux of my question in is, how can I copy the resulting jars
> from the other projects in my multi-project build into a directory in my
> webapp before it gets packaged?
>
> Any help is appreciated.
>
> Here's the error
> _
>
> [INFO]
> 
> [ERROR] BUILD ERROR
> [INFO]
> 
> [INFO] Failed to resolve artifact.
>
> GroupId: com.myorg
> ArtifactId: common
> Version: 1.0-SNAPSHOT
>
> Reason: Unable to download the artifact from any repository
>
> Try downloading the file manually from the project website.
>
> Then, install it using the command:
>mvn install:install-file -DgroupId=com.myorg -DartifactId=common\
>-Dversion=1.0-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file
>
>
>  com.myorg:common:jar:1.0-SNAPSHOT
>
> from the specified remote repositories:
>
>  central (http://repo1.maven.org/maven2),
>
> _
>
> Here's more about my setup:
>
> I've tried this with maven 2.0.3. and 2.0.4
>
> I've got a pretty standard setup.
>
> projects/pom.xml
> projects/common/pom.xml
> projects/webstart-client/pom.xml
> projects/webapp/pom.xml
>
>
> I need to copy the resulting jar artifact from the common project and the
> resulting jar from the webstart-client project into the webapp's client
> directory.
>
> So, in my webapp pom.xml I have:
>
>
>org.codehaus.mojo
>dependency-maven-plugin
>
>
>
>process-resources
>
>copy
>
>
>
>
>
>
>com.myorg
>common
>1.0-SNAPSHOT
>jar
>
>
>com.myorg
>webstart-client
>1.0-SNAPSHOT
>jar
>
>
>jgoodies
>binding
>1.1
>jar
>
> 
>
>
> ${project.build.directory}/${project.build.finalName}/client
>
>
>
>mywebapp
>
>
>
>
>
>com.myorg
>common
>1.0-SNAPSHOT
>compile
>
>
>com.myorg
>webstart-client
>1.0-SNAPSHOT
>compile
>
> ...
>
> Thanks,
> Skip
>
>
> --
> View this message in context: 
> http://www.nabble.com/Multi-Project-Build%3A-copy-resulting-jars-into-dependent-webapp-t1446168.html#a3906335
> Sent from the Maven - Users forum at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Multi-Project Build: copy resulting jars into dependent webapp

2006-04-13 Thread Martin Cooper
On 4/13/06, SkipWalker <[EMAIL PROTECTED]> wrote:
>
>
> I'm trying to get around using the webstart plugin that isn't ready for
> primetime.  In order to do that, I'm trying to use the codehause
> dependency
> plugin to copy my webstart application project jar, it's other project
> dependencies, and some 3rd party dependencies into a directory in my
> webapp
> output so they will become part of the resulting war.
>
> I'm trying to do something along the lines of the first suggestion at
> codehaus for the webstart plugin, just not using the webstart plugin
> itself,
> just the dependency plugin.
>
>
> http://mojo.codehaus.org/webstart-maven-plugin-parent/webstart-maven-plugin/howto.html
>
> I'm running into the problem that the dependency copy won't copy my own
> project jars common.jar, and webstart-client.jar saying it can't resolve
> the
> artifacts.  I guess it's looking in the repo and not finding the jars.


Unless you want / need to keep your other jars out of your local repo, you
could use 'mvn install' to build everything, putting the intermediate jars
into the local repo on the way.

--
Martin Cooper


The dependency:copy plugin is working fine for the 3rd party dependencies,
> copying them into the appropriate place.  The build is just balking at
> copying my own jars that were created earlier in the multi-project build.
>
> So I guess the crux of my question in is, how can I copy the resulting
> jars
> from the other projects in my multi-project build into a directory in my
> webapp before it gets packaged?
>
> Any help is appreciated.
>
> Here's the error
> _
>
> [INFO]
> 
> [ERROR] BUILD ERROR
> [INFO]
> 
> [INFO] Failed to resolve artifact.
>
> GroupId: com.myorg
> ArtifactId: common
> Version: 1.0-SNAPSHOT
>
> Reason: Unable to download the artifact from any repository
>
> Try downloading the file manually from the project website.
>
> Then, install it using the command:
> mvn install:install-file -DgroupId=com.myorg -DartifactId=common\
> -Dversion=1.0-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file
>
>
>   com.myorg:common:jar:1.0-SNAPSHOT
>
> from the specified remote repositories:
>
>   central (http://repo1.maven.org/maven2),
>
> _
>
> Here's more about my setup:
>
> I've tried this with maven 2.0.3. and 2.0.4
>
> I've got a pretty standard setup.
>
> projects/pom.xml
> projects/common/pom.xml
> projects/webstart-client/pom.xml
> projects/webapp/pom.xml
>
>
> I need to copy the resulting jar artifact from the common project and the
> resulting jar from the webstart-client project into the webapp's client
> directory.
>
> So, in my webapp pom.xml I have:
>
> 
> org.codehaus.mojo
> dependency-maven-plugin
> 
> 
> 
> process-resources
> 
> copy
> 
> 
> 
> 
> 
> 
> com.myorg
> common
> 1.0-SNAPSHOT
> jar
> 
> 
> com.myorg
> webstart-client
> 1.0-SNAPSHOT
> jar
> 
> 
> jgoodies
> binding
> 1.1
> jar
> 
> 
> 
>
> ${project.build.directory}/${project.build.finalName
> }/client
> 
> 
> 
> mywebapp
> 
>
> 
> 
> 
> com.myorg
> common
> 1.0-SNAPSHOT
> compile
> 
> 
> com.myorg
> webstart-client
> 1.0-SNAPSHOT
> compile
> 
> ...
>
> Thanks,
> Skip
>
>
> --
> View this message in context:
> http://www.nabble.com/Multi-Project-Build%3A-copy-resulting-jars-into-dependent-webapp-t1446168.html#a3906335
> Sent from the Maven - Users forum at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>