You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Komal Agrawal <ko...@gmail.com> on 2010/12/01 15:23:54 UTC

maven: How to include third party library to existing maven project

Hello there,

I want to include external jar to my existing maven project. I used
following command to install it to local maven repository:

mvn -e install:install
-Dfile="D:\test\com.project.MyApp.externalLib-1.0.jar" -DgroupId=com.project
-DartifactId=MyApp -Dversion=1.0 -Dpackaging=jar

and got following exception:

org.apache.maven.lifecycle.LifecycleExecutionException: The packaging for
this p
roject did not assign a file to the build artifact

at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:719)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandalone
Goal(DefaultLifecycleExecutor.java:569)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
ltLifecycleExecutor.java:539)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
dleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
ts(DefaultLifecycleExecutor.java:348)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
fecycleExecutor.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:6
0)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java <http://www.javaranch.com/>: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: The packaging for
thi
s project did not assign a file to the build artifact
at org.apache.maven.plugin.install.InstallMojo.execute(InstallMojo.java:
124)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
nManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:694)
... 17 more

What needs to be done in this case ? I am not getting any useful articles on
internet as well.

Basic question : It "should" be possible to add a third party non maven
library to a maven project. Is this correct ?

Also, what can I check to have this working ? Its very urgent for me , any
help is highly appreciated.

Thanks,
Komal

Re: maven: How to include third party library to existing maven project

Posted by Justin Edelson <ju...@justinedelson.com>.
You need to use install:install-file

On Dec 1, 2010, at 9:23 AM, Komal Agrawal <ko...@gmail.com> wrote:

> Hello there,
> 
> I want to include external jar to my existing maven project. I used
> following command to install it to local maven repository:
> 
> mvn -e install:install
> -Dfile="D:\test\com.project.MyApp.externalLib-1.0.jar" -DgroupId=com.project
> -DartifactId=MyApp -Dversion=1.0 -Dpackaging=jar
> 
> and got following exception:
> 
> org.apache.maven.lifecycle.LifecycleExecutionException: The packaging for
> this p
> roject did not assign a file to the build artifact
> 
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
> ultLifecycleExecutor.java:719)
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandalone
> Goal(DefaultLifecycleExecutor.java:569)
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
> ltLifecycleExecutor.java:539)
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
> dleFailures(DefaultLifecycleExecutor.java:387)
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
> ts(DefaultLifecycleExecutor.java:348)
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
> fecycleExecutor.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:6
> 0)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> java <http://www.javaranch.com/>: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: The packaging for
> thi
> s project did not assign a file to the build artifact
> at org.apache.maven.plugin.install.InstallMojo.execute(InstallMojo.java:
> 124)
> at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
> nManager.java:490)
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
> ultLifecycleExecutor.java:694)
> ... 17 more
> 
> What needs to be done in this case ? I am not getting any useful articles on
> internet as well.
> 
> Basic question : It "should" be possible to add a third party non maven
> library to a maven project. Is this correct ?
> 
> Also, what can I check to have this working ? Its very urgent for me , any
> help is highly appreciated.
> 
> Thanks,
> Komal

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org