You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Sean Davis <sd...@mail.nih.gov> on 2009/10/15 19:35:43 UTC

Building a project that includes scripts

Sorry for the naive question.  I'm using maven2 in eclipse and now have a
project that includes a script folder that has shell scripts for common java
-cp ..... command-line interactions.  I would like to build a project that
has a lib folder, a scripts folder (with scripts that refer to the lib
folder), and potentially other top-level directories or documents in it.
One way to do this would be to use an ant build script for everything, but I
wanted to see if that was the "maven" way of doing things.

Thanks,
Sean

Re: Building a project that includes scripts

Posted by Barrie Treloar <ba...@gmail.com>.
On Fri, Oct 16, 2009 at 4:29 AM, Wendy Smoak <ws...@gmail.com> wrote:
> On Thu, Oct 15, 2009 at 10:35 AM, Sean Davis <sd...@mail.nih.gov> wrote:
>> Sorry for the naive question.  I'm using maven2 in eclipse and now have a
>> project that includes a script folder that has shell scripts for common java
>> -cp ..... command-line interactions.  I would like to build a project that
>> has a lib folder, a scripts folder (with scripts that refer to the lib
>> folder), and potentially other top-level directories or documents in it.
>> One way to do this would be to use an ant build script for everything, but I
>> wanted to see if that was the "maven" way of doing things.
>
> Many projects use the Assembly plugin to create a binary (and source)
> distributions.

Also see http://maven.apache.org/shared/maven-archiver/examples/classpath.html
for how to make an executable jar.
Then all you need to do is get the assembly plugin to copy and layout
the dependency libraries in the correct place (say lib/) and you are
done.

Unfortunately I see no examples of how to write your own scripts.

Here are the ones I have used internally. The use of the variables
means I can use the same scripts for any standalone java project.
We pass in an argument to our programs (start or stop) as we use JMX
to manage the lifecycles.

== start.bat ==
java -jar ${project.artifactId}-${project.version}.jar start
==

== start.sh ==
nohup java -jar ${project.artifactId}-${project.version}.jar start >
/dev/null 2>&1 &
==

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


Re: Building a project that includes scripts

Posted by Wendy Smoak <ws...@gmail.com>.
On Thu, Oct 15, 2009 at 10:35 AM, Sean Davis <sd...@mail.nih.gov> wrote:
> Sorry for the naive question.  I'm using maven2 in eclipse and now have a
> project that includes a script folder that has shell scripts for common java
> -cp ..... command-line interactions.  I would like to build a project that
> has a lib folder, a scripts folder (with scripts that refer to the lib
> folder), and potentially other top-level directories or documents in it.
> One way to do this would be to use an ant build script for everything, but I
> wanted to see if that was the "maven" way of doing things.

Many projects use the Assembly plugin to create a binary (and source)
distributions.

-- 
Wendy

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