Maven2 stuff
Steve Loughran <[email protected]>
| Newsgroups | gmane.comp.java.smartfrog.devel |
|---|---|
| Message-ID | <[email protected]> |
I am adding maven2 support to common.xml.
This adds new targets m2-install (and related things) which
-copy created JAR files into the maven2 repository under
org/smartfrog/${project.name}/${Version}/jar file
-creates a stub maven2 .pom file
-and some checksum files
These files can then be used in a build file to set up the classpath for
things. It uses the maven2 Ant tasks, which can be pulled from
http://maven.apache.org/, and which work in Ant1.6 onwards
<target name="m2-files" depends="m2-init">
<artifact:dependencies pathID="m2.classpath">
<dependency groupID="org.smartfrog"
artifactID="sf-xml"
version="${Version}"/>
<dependency groupID="xom"
artifactID="xom"
version="${xom.version}"/>
<dependency groupID="xalan"
artifactID="xalan"
version="${xalan.version}"/>
<dependency groupID="org.ggf"
artifactID="cddlm"
version="${cddlm.version}"/>
<dependency groupID="commons-logging"
artifactID="commons-logging-api"
version="${commons-logging.version}"/>
</artifact:dependencies>
</target>
This, for example, is me declaring a need for sf-xml, xom, xalan and
commons-logging-api.
The maven2 artifact task will automatically pull down files from the big
repository (http://ibiblio.org/maven2) or a named repository. Many of
the popular OSS projects are listed there, but none of the Sun jars
(click through licensing, see). We do not (yet) have Smartfrog up there,
but we could do it fairly easily.
Using the central repository has the following benefits
-ant will autodownload needed JAR files
-its easier to switch versions on things; just change a properties file
-if an artifacts POM file declares a dependency, Maven2's transitive
dependencies will pull them in. E.g, if we declare we depend on
smartfrog, that is an implicit dependency that goes on the classpath.
-it will eliminate the need for separate JAR files in lib/ dirs for
all the components
-makes it easier to build smartforg components outside the main source
tree. At the very least, it moves cross-dependencies between components.
And the following costs
-unknown security
-POM files are needed for everything
-proxy setup is needed inside hp
-fiddly to get non-mavened third party files into the repository
I am thinking of setting up a repository of libraries (core/repository)
that will let us keep in SCM stuff that isnt in the maven2 repostiory.
That will separate us from the normal per-user cache. I am also
exploring using this stuff in some of the unstable components I'm
working on: sf-xml, sf-cdl, sf-junit.
Note that Smartfrog 3.04.22 unofficially ships with support for maven2
libraries too; lookin services/os/libraries.sf to see the components
that can retrieve JAR files from a repository, to build up a classpath.
-steve
-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click