You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Wim Deblauwe <wi...@gmail.com> on 2009/10/02 10:22:13 UTC

Add arbitrary dependency in assembly

Hi,

How do you add an arbitrary dependency in an assembly descriptor?

I have a maven project that builds a war file. I want to assemble this war
file together with a zip file. I have this zip file in my repository. I
currently have added the zip file as a dependency in my pom.xml and added a
<dependencySet/> element to include this zip file (with unpack to true) and
also an element for the war (with unpack to false).

This works fine, but the zip is not a dependency of the war itself, so I
don't like that I had to add it in my pom.xml. I tried setting the scope to
'provided' but then the assembly cannot find that zip file it seems.

Is there some other way to have a nicer solution?

regards,

Wim

Re: Add arbitrary dependency in assembly

Posted by Wim Deblauwe <wi...@gmail.com>.
2009/10/2 Antonio Petrelli <an...@gmail.com>

> 2009/10/2 Wim Deblauwe <wi...@gmail.com>:
> > I tried setting the scope to
> > 'provided' but then the assembly cannot find that zip file it seems.
>
> You have to add the "scope" element and set it to "provided" in the
> "dependencySet" element:
>
> http://maven.apache.org/plugins/maven-assembly-plugin/assembly.html#class_dependencySet
>
> > Is there some other way to have a nicer solution?
>
> I don't if it is "nicer", but a widely adopted solution is to create
> an "assembly project", so you can manage your assembly dependencies
> independently.
>
>
Setting the provided scope indeed does the trick. Thank you! For me, this
solution is nice enough :)



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

Re: Add arbitrary dependency in assembly

Posted by Antonio Petrelli <an...@gmail.com>.
2009/10/2 Wim Deblauwe <wi...@gmail.com>:
> I tried setting the scope to
> 'provided' but then the assembly cannot find that zip file it seems.

You have to add the "scope" element and set it to "provided" in the
"dependencySet" element:
http://maven.apache.org/plugins/maven-assembly-plugin/assembly.html#class_dependencySet

> Is there some other way to have a nicer solution?

I don't if it is "nicer", but a widely adopted solution is to create
an "assembly project", so you can manage your assembly dependencies
independently.

Antonio

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