You can sometimes locate artifacts in repositories other than Maven Central,
and then you can not only have Maven download them for you but you can
depend on them in your POMs:

1.  Try Googling "maven activation-1.1.1.jar" and so on to find a suitably
large/public repo holding the artifact you need.  There are some useful repo
index sites out there, e.g. http://mvnrepository.com/ and
http://www.mvnbrowser.com/index.html.

2.  Make the target repo available to your local Maven installation.
Generally, you can either (i) declare the repo in your project's POM, or
(ii) declare it in your Maven installation's settings.xml file (see
http://maven.apache.org/settings.html).  Option (i) means other people to
whom you distribute your POM don't need separate instructions about how to
get access to artifacts, but there's no guarantee someone else's Maven
installation will honour your repo declaration (e.g. their organisation may
confine access to internal repos).  If you go for option (ii), though,
you'll have to tell people how to reach the repos they need.

3.  Declare the dependency's Maven coordinates as appropriate.

activation-1.1.1.jar can be found at the large JBoss public repo:

        <repository>
                <id>jboss</id>
                <name>JBoss Repository</name>
                <url>http://repository.jboss.org/maven2</url>
        </repository>

and its coords are

        <dependency>
                <groupId>javax.activation</groupId>
                <artifactId>activation</artifactId>
                <version>1.1.1</version>
        </dependency>

By the look of it
(http://repository.jboss.org/maven2/org/apache/santuario/xmlsec/1.4.2/)
xmlsec can be found at JBoss too.

Jon  

> -----Original Message-----
> From: Rusty Wright [mailto:[email protected]] 
> Sent: 20 July 2009 16:01
> To: Maven Users List
> Subject: Re: Migrate existing java project to maven2
> 
> What I do is install the jars in my local repository (for 
> example, ~/.m2 on unix).  I use the following shell script to 
> install the hamcrest jars:
> 
> #! /bin/sh
> 
> VERSION=1.2
> DIR=hamcrest-${VERSION}
> 
> for NAME in \
>     hamcrest-all \
>     hamcrest-core \
>     hamcrest-generator \
>     hamcrest-integration \
>     hamcrest-library
> do
>     mvn install:install-file \
>         -DgroupId=org.hamcrest \
>         -DartifactId=${NAME} \
>         -Dversion=${VERSION} \
>         -Dpackaging=jar \
>         -DcreateChecksum=true \
>         -DpomFile=${NAME}-${VERSION}.pom \
>         -Dfile=${DIR}/${NAME}-${VERSION}.jar
> done
> 
> You'll also need to create a pom for each jar, but it's quite 
> small and easy to make; for example:
> 
> <?xml version="1.0" encoding="iso-8859-1"?>
> 
> <project
>     xmlns="http://maven.apache.org/POM/4.0.0";
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>     xsi:schemaLocation="
>         http://maven.apache.org/POM/4.0.0
>         http://maven.apache.org/maven-v4_0_0.xsd";>
> 
>     <modelVersion>4.0.0</modelVersion>
> 
>     <groupId>org.hamcrest</groupId>
>     <artifactId>hamcrest-all</artifactId>
>     <name>hamcrest all</name>
>     <version>1.2</version>
> 
>     <url>http://code.google.com/p/hamcrest/</url>
> </project>
> 
> 
> ykyuen wrote:
> > Hi all,
> > 
> > i am new to maven and i just go thru the examples in the Maven: The 
> > Definitive Guide.
> > 
> > i am going to migrate a project to maven2. but i find that 
> there are 
> > some jars which are not found in the maven repository 
> > http://repo1.maven.org/maven2/.
> > 
> > for example. the java project needs activation-1.1.1.jar, 
> > xmlsec-1.4.2.jar... etc.
> > so i cannot set them as a dependency in the pom.xml
> > 
> > how can i deal with that?
> > 
> > Thanks for your help =)
> > 
> > Regards,
> > Kit
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to