maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ed Hillmann <ed.hillm...@gmail.com>
Subject Re: Maven Question
Date Thu, 05 Nov 2009 04:55:34 GMT
On Thu, Nov 5, 2009 at 10:24 AM, Roger Studner <rstudner@gmail.com> wrote:
> I've dodged(?) using Maven since its inception, but quite clearly that isn't
> possible anymore.
>
> I was thinking of using the Jboss RESTEasy project, and then reailty struck.
>
> There are 471,932 jars (okay, that isn't true).  They don't list which are
> for what.  But of course, there are a variety of core and option maven
> dependencies for a pom.
>
> Now, to use RESTEasy, I'd rather not convert 10+ projects to be 100%
> required to use maven :).
>
> Is there an easy way, using maven, to have mvn simply resolve each of those
> and put the necessary jars into folders?  So I then can determine which I
> truely need and copy them over as appropriate.

Have a look at the maven-dependency-plugin

http://maven.apache.org/plugins/maven-dependency-plugin/

For a project, it can show what artifacts are being used.  It has a
handy utility that displayed the dependencies in a tree.  You can also
copy out the dependencies from the repository to the filesystem (which
is what I think you're looking to do).

For example, here's a POM file that takes an artifact from the local
repository and writes it out to a directory

        <profile>
            <id>icefaces.push-server</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>org.icefaces</groupId>
                                    <artifactId>push-server</artifactId>
                                    <version>${icefaces.version}</version>
                                    <type>war</type>
                                    <destFileName>push-server.war</destFileName>
                                    <overWrite>true</overWrite>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>


Also, look at the assembly plugin

http://maven.apache.org/plugins/maven-assembly-plugin/examples/single/including-and-excluding-artifacts.html

This has a handy feature of packaging up any artifacts you depend on,
along with any of the artifacts they depend on.  Using this, you can
copy out all the required libraries, even if you only declare one
artifact as a dependency.

Hope this helps,
Ed

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


Mime
View raw message