You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Stephen More <st...@gmail.com> on 2006/08/31 22:36:21 UTC

executing after being built with Maven2

I am fairly new to maven2.

Once the dependecies are listed, I see how maven automagically figures
out what are the needed jars and downloads them.

I can compile, test and jar my maven2 project just fine. My problem is
that when I try to run from the SNAPSHOT, I can no longer find all the
jars that were used during the compilation process.

After a package I would like to: java -jar SNAPSHOT.jar and have it work.

- Should I include all the needed jars in my SNAPSHOT.jar ? If so how.
       or
- Can maven echo out the classpath used during compile and test so I
can set my classpath to the same so it will execute ?


-Thanks
Steve More

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


Re: executing after being built with Maven2

Posted by Stéphane Bouchet <st...@knowesia.fr>.
Take a look to the last maven-jar-plugin :

http://maven.apache.org/plugins/maven-jar-plugin/examples/executable-jar.html

Cheers,

Stéphane


berndq a écrit :
> Stephen More wrote:
>
> I guess you are looking for the assembly plugin
>
> Here is the docu: 
> http://maven.apache.org/plugins/maven-assembly-plugin/howto.html
>
> But I do not know how up to date this is.
>
> Recently on the dev list a staging version of new docu was
> presented for review (this was helpfull for me)
>
> "A staging site is currently available at 
> http://people.apache.org/~epunzalan/maven-assembly-plugin.
> Thank you for taking some time to review it."
>
> Bernd
>
>
>> I am fairly new to maven2.
>>
>> Once the dependecies are listed, I see how maven automagically figures
>> out what are the needed jars and downloads them.
>>
>> I can compile, test and jar my maven2 project just fine. My problem is
>> that when I try to run from the SNAPSHOT, I can no longer find all the
>> jars that were used during the compilation process.
>>
>> After a package I would like to: java -jar SNAPSHOT.jar and have it 
>> work.
>>
>> - Should I include all the needed jars in my SNAPSHOT.jar ? If so how.
>>       or
>> - Can maven echo out the classpath used during compile and test so I
>> can set my classpath to the same so it will execute ?
>>
>>
>> -Thanks
>> Steve More
>>
>> ---------------------------------------------------------------------
>> 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
>
>


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


Re: executing after being built with Maven2

Posted by Stephen More <st...@gmail.com>.
mvn assembly:assembly -DdescriptorId=jar-with-dependencies
         +
<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <configuration>
          <archive>
            <manifest>
              <mainClass>my.package.to.my.MainClass</mainClass>
            </manifest>
          </archive>
        </configuration>
</plugin>

== exactly what I want.

Thank you very much.

-Steve More

On 8/31/06, berndq <be...@gmx.net> wrote:
> Stephen More wrote:
>
> I guess you are looking for the assembly plugin
>
> Here is the docu:
> http://maven.apache.org/plugins/maven-assembly-plugin/howto.html
>
> But I do not know how up to date this is.
>
> Recently on the dev list a staging version of new docu was
> presented for review (this was helpfull for me)
>
> "A staging site is currently available at
> http://people.apache.org/~epunzalan/maven-assembly-plugin.
> Thank you for taking some time to review it."
>
> Bernd
>
>
> > I am fairly new to maven2.
> >
> > Once the dependecies are listed, I see how maven automagically figures
> > out what are the needed jars and downloads them.
> >
> > I can compile, test and jar my maven2 project just fine. My problem is
> > that when I try to run from the SNAPSHOT, I can no longer find all the
> > jars that were used during the compilation process.
> >
> > After a package I would like to: java -jar SNAPSHOT.jar and have it work.
> >
> > - Should I include all the needed jars in my SNAPSHOT.jar ? If so how.
> >       or
> > - Can maven echo out the classpath used during compile and test so I
> > can set my classpath to the same so it will execute ?
> >
> >
> > -Thanks
> > Steve More
> >
> > ---------------------------------------------------------------------
> > 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
>
>

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


Re: executing after being built with Maven2

Posted by berndq <be...@gmx.net>.
Stephen More wrote:

I guess you are looking for the assembly plugin

Here is the docu: 
http://maven.apache.org/plugins/maven-assembly-plugin/howto.html

But I do not know how up to date this is.

Recently on the dev list a staging version of new docu was
presented for review (this was helpfull for me)

"A staging site is currently available at 
http://people.apache.org/~epunzalan/maven-assembly-plugin.
Thank you for taking some time to review it."

Bernd


> I am fairly new to maven2.
> 
> Once the dependecies are listed, I see how maven automagically figures
> out what are the needed jars and downloads them.
> 
> I can compile, test and jar my maven2 project just fine. My problem is
> that when I try to run from the SNAPSHOT, I can no longer find all the
> jars that were used during the compilation process.
> 
> After a package I would like to: java -jar SNAPSHOT.jar and have it work.
> 
> - Should I include all the needed jars in my SNAPSHOT.jar ? If so how.
>       or
> - Can maven echo out the classpath used during compile and test so I
> can set my classpath to the same so it will execute ?
> 
> 
> -Thanks
> Steve More
> 
> ---------------------------------------------------------------------
> 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: executing after being built with Maven2

Posted by Alexandre Russel <al...@russel.fr>.
> After a package I would like to: java -jar SNAPSHOT.jar and have it work.
If it is for testing, I just use Run inside eclipse. The maven 2 plugin set 
the classpath properly so eclipse can launch my app.