maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander <the.malk...@gmail.com>
Subject Re: maven assembly: how to create an execution JAR without packing the dependencies
Date Tue, 17 Nov 2009 18:05:54 GMT
Dont be shy, just try it.

2009/11/17 eyal edri <eyal.edri@gmail.com>

> can i use the 'dependency:copy-dependencies<
> http://maven.apache.org/plugins/maven-dependency-plugin/copy-dependencies-mojo.html
> >'
> goal in this project to tell it to copy all it's
> dependencies to the "lib" dir?
> like shown in here:
>
>
> <build>
>    <plugins>
>      <plugin>
>        <groupId>org.apache.maven.plugins</groupId>
>        <artifactId>maven-dependency-plugin</artifactId>
>        <executions>
>          <execution>
>            <id>copy-dependencies</id>
>            <phase>package</phase>
>            <goals>
>              <goal>copy-dependencies</goal>
>            </goals>
>            <configuration>
>              <outputDirectory>/usr/local/app</outputDirectory>
>              <overWriteReleases>false</overWriteReleases>
>              <overWriteSnapshots>false</overWriteSnapshots>
>              <overWriteIfNewer>true</overWriteIfNewer>
>            </configuration>
>          </execution>
>        </executions>
>      </plugin>
>    </plugins>
>  </build>
>
>
>
> btw: (when you said  <classpathPrefix>*lib*</classpathPrefix>,
>
> does this means "projectHome/lib" is the classPath?)
>
>
> On Tue, Nov 17, 2009 at 4:51 PM, Alexander <the.malkolm@gmail.com> wrote:
>
> > You could do this without assembly plugin.
> >
> > Just copy all dependencies with maven-dependency-plugin to some folder
> and
> > than add this folder as classpath prefix in maven-jar-plugin.
> >
> > example for second part
> >
> >            <plugin>
> >                <artifactId>maven-jar-plugin</artifactId>
> >                <configuration>
> >                    <archive>
> >                        <manifest>
> >                            <mainClass>you.main.class</mainClass>
> >                            <addClasspath>true</addClasspath>
> >                            <classpathPrefix>lib</classpathPrefix>
> >                        </manifest>
> >                    </archive>
> >                </configuration>
> >            </plugin>
> >
> > 2009/11/17 eyal edri <eyal.edri@gmail.com>
> >
> > > Hi,
> > >
> > > i'm trying to figure out how can i create a working executable JAR that
> > has
> > > dependencies
> > > (in-house maven projects plus external lib such as Log4J).
> > >
> > > I tried using the assembly plugin by creating a
> "jar-with-dependencies".
> > >
> > > but this creates a big JAR with all the dependencies included.
> > >
> > > I want to be able to install commons dependencies in a commons
> directory
> > > (/usr/lib/maven-projects/ for e.g.),
> > > and that every project that depends on them can use them.
> > >
> > > What should i do in the pom file of the infrastructure project and the
> > > project that depends on it?
> > >
> > > i've read almost all the complete "maven-definite-guide", but didn't
> find
> > a
> > > concise answer...
> > >
> > > thanks,
> > > --
> > > Eyal Edri
> > >
> >
> >
> >
> > --
> > Regards,
> > Alexander
> >
>
>
>
> --
> Eyal Edri
>



-- 
Regards,
Alexander

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message