You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Florian Ockhuysen <oc...@gmail.com> on 2007/04/18 12:24:49 UTC

Include runtime-dependencies in packaged jar

Hi,

Using 'mvn package' I generated a jar for my application. This all works fine.
However, two dependency jars are used that need to be included in the jar so they are always available at runtime (they're needed at 
compile-time, too btw). Of course, these dependencies were declared in the pom.xml and exist in my local maven repository.
Just setting their <scope> element to 'runtime', doesn't work since they're also compile-time dependencies.
I googled around and read documentation, but couldn't to find information on this.

I solved the problem for now by putting class files from the jars in main/resources, but now I have to manually update these class files 
whenever a new version for one of the dependencies comes out.
Something tells me there must be a more generic way to do this...
Any of you have a solution??

Greets,

Florian

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


Re: [Spam] Is there any way to get timestamp in maven?

Posted by David Corbin <dc...@allureglobal.com>.
On Wednesday 18 April 2007 17:41, Chen Li wrote:
> Hi,
>
> It might be a very basic question.
>
> I want to add timestamp to the distribute, for instance ${DSTAMP}.war .
> Is there any similar way in maven can do it like what <tstamp/> does in
> ant?

You can use Groovy.

http://pteropus.blogspot.com/2007/03/from-maven-to-mvn-part-5.html

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

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


Re: Is there any way to get timestamp in maven?

Posted by Andrius Ĺ abanas <an...@pivotcapital.com>.
Chen Li wrote:
> Hi,
> 
> It might be a very basic question.
> 
> I want to add timestamp to the distribute, for instance ${DSTAMP}.war .
> Is there any similar way in maven can do it like what <tstamp/> does in 
> ant?

Check out this plugin:
http://commons.ucalgary.ca/projects/maven-buildnumber-plugin/howto.html

I have not tried it myself yet, but it seems to be exactly what you need.


Andrius


P.S. Please do not reply to an existing thread to start a new topic, it 
messes up the threading in some mail clients, and probably also mailing 
list archives - thank you.

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


Re: Is there any way to get timestamp in maven?

Posted by Jeroen Leenarts <je...@gmail.com>.
This'll help a bit too I think:
http://docs.codehaus.org/display/MAVENUSER/Creating+the+repositories
(search for "uniqueVersion" with your browser on the page.)

On 19/04/07, Jeroen Leenarts <je...@gmail.com> wrote:
>
> Look into the distributionmanagement section of the Maven pom: http://maven.apache.org/ref/2.0.4/maven-model/maven.html#class_distributionManagement
>
>
> Note the "uniqueVersion" element.
>
> Jeroen
>
> On 18/04/07, Chen Li <chenli@ebi.ac.uk > wrote:
> >
> > Hi,
> >
> > It might be a very basic question.
> >
> > I want to add timestamp to the distribute, for instance ${DSTAMP}.war .
> > Is there any similar way in maven can do it like what <tstamp/> does in
> > ant?
> >
> > Thanks,
> > Chen
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>

Re: Is there any way to get timestamp in maven?

Posted by Jeroen Leenarts <je...@gmail.com>.
Look into the distributionmanagement section of the Maven pom:
http://maven.apache.org/ref/2.0.4/maven-model/maven.html#class_distributionManagement

Note the "uniqueVersion" element.

Jeroen

On 18/04/07, Chen Li <ch...@ebi.ac.uk> wrote:
>
> Hi,
>
> It might be a very basic question.
>
> I want to add timestamp to the distribute, for instance ${DSTAMP}.war .
> Is there any similar way in maven can do it like what <tstamp/> does in
> ant?
>
> Thanks,
> Chen
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Is there any way to get timestamp in maven?

Posted by Chen Li <ch...@ebi.ac.uk>.
Hi,

It might be a very basic question.

I want to add timestamp to the distribute, for instance ${DSTAMP}.war .
Is there any similar way in maven can do it like what <tstamp/> does in ant?

Thanks,
Chen

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


Re: Include runtime-dependencies in packaged jar

Posted by Wayne Fay <wa...@gmail.com>.
Search the list archives for "jar-with-dependencies".

Wayne

On 4/18/07, Marcos Silva Pereira <ma...@gmail.com> wrote:
> Hum, maybe you could resolve it with assembly plugin.
>
> Take a look at: http://maven.apache.org/plugins/maven-assembly-plugin/
>
> Kind Regards
>
> On 4/18/07, Florian Ockhuysen <oc...@gmail.com> wrote:
> >
> > Hi,
> >
> > Using 'mvn package' I generated a jar for my application. This all works
> > fine.
> > However, two dependency jars are used that need to be included in the jar
> > so they are always available at runtime (they're needed at
> > compile-time, too btw). Of course, these dependencies were declared in the
> > pom.xml and exist in my local maven repository.
> > Just setting their <scope> element to 'runtime', doesn't work since
> > they're also compile-time dependencies.
> > I googled around and read documentation, but couldn't to find information
> > on this.
> >
> > I solved the problem for now by putting class files from the jars in
> > main/resources, but now I have to manually update these class files
> > whenever a new version for one of the dependencies comes out.
> > Something tells me there must be a more generic way to do this...
> > Any of you have a solution??
> >
> > Greets,
> >
> > Florian
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
>
> --
> Marcos Silva Pereira
> recife - pe
> marcos.silva@gmail.com
> skype: marcos.silva.pereira
> http://blastemica.blogspot.com
>

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


Re: Include runtime-dependencies in packaged jar

Posted by Marcos Silva Pereira <ma...@gmail.com>.
Hum, maybe you could resolve it with assembly plugin.

Take a look at: http://maven.apache.org/plugins/maven-assembly-plugin/

Kind Regards

On 4/18/07, Florian Ockhuysen <oc...@gmail.com> wrote:
>
> Hi,
>
> Using 'mvn package' I generated a jar for my application. This all works
> fine.
> However, two dependency jars are used that need to be included in the jar
> so they are always available at runtime (they're needed at
> compile-time, too btw). Of course, these dependencies were declared in the
> pom.xml and exist in my local maven repository.
> Just setting their <scope> element to 'runtime', doesn't work since
> they're also compile-time dependencies.
> I googled around and read documentation, but couldn't to find information
> on this.
>
> I solved the problem for now by putting class files from the jars in
> main/resources, but now I have to manually update these class files
> whenever a new version for one of the dependencies comes out.
> Something tells me there must be a more generic way to do this...
> Any of you have a solution??
>
> Greets,
>
> Florian
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Marcos Silva Pereira
recife - pe
marcos.silva@gmail.com
skype: marcos.silva.pereira
http://blastemica.blogspot.com