You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Michael Schneider <m_...@informatik.uni-frankfurt.de> on 2006/10/17 20:03:21 UTC

creating string of all dependencies

Hi!

Within my assembly I want to have a batch script (Unix shell), which
starts the java interpreter for some given class. The "-classpath"
parameter should be build from all dependency jars given in the POM. So
I want to have something like this:

      DEPSPATH=<dep1>:<dep2>:...:<depn>
      java -classpath $DEPSPATH <class>

Therefore in my src/main/scripts directory I want to have something like

      DEPSPATH=${dependencies}
      java -classpath $DEPSPATH <class>

The filtering should then be done in phase "process-sources".

Is there a maven property '${dependencies}' to create a list (at least
space separated) of all dependencies? And if not, what is the easiest
way to achieve what I want?

Cheers,
Michael




Re: creating string of all dependencies

Posted by Dirk Olmes <di...@xanthippe.ping.de>.
Michael Schneider wrote:
> Hi!
> 
> Within my assembly I want to have a batch script (Unix shell), which
> starts the java interpreter for some given class. The "-classpath"
> parameter should be build from all dependency jars given in the POM. So
> I want to have something like this:
> 
>      DEPSPATH=<dep1>:<dep2>:...:<depn>
>      java -classpath $DEPSPATH <class>
[...]

How about the appassembler-maven-plugin? It creates a complete bundle
including all dependencies and a script (bat/sh) for running.

http://mojo.codehaus.org/appassembler/appassembler-maven-plugin/

HTH,

-dirk

-- 
A: Maybe because some people are too annoyed by top-posting.
Q: Why do I not get an answer to my question(s)?
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?


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


Re: creating string of all dependencies

Posted by Brett Porter <br...@gmail.com>.
Assuming all your libs are in 'lib' subdirectory of the assembly, I usually use:

CP=`ls -1 lib/*.jar | tr '\n' ':'`

java -classpath $CP ...

Cheers,
Brett

On 18/10/06, Michael Schneider <m_...@informatik.uni-frankfurt.de> wrote:
> Hi!
>
> Within my assembly I want to have a batch script (Unix shell), which
> starts the java interpreter for some given class. The "-classpath"
> parameter should be build from all dependency jars given in the POM. So
> I want to have something like this:
>
>       DEPSPATH=<dep1>:<dep2>:...:<depn>
>       java -classpath $DEPSPATH <class>
>
> Therefore in my src/main/scripts directory I want to have something like
>
>       DEPSPATH=${dependencies}
>       java -classpath $DEPSPATH <class>
>
> The filtering should then be done in phase "process-sources".
>
> Is there a maven property '${dependencies}' to create a list (at least
> space separated) of all dependencies? And if not, what is the easiest
> way to achieve what I want?
>
> Cheers,
> Michael
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Apache Maven - http://maven.apache.org
"Better Builds with Maven" book - http://library.mergere.com/

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