You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by ykyuen <yi...@gmail.com> on 2009/07/20 16:16:38 UTC

Migrate existing java project to maven2

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
-- 
View this message in context: http://www.nabble.com/Migrate-existing-java-project-to-maven2-tp24570669p24570669.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: Migration existing java project to maven2

Posted by Juven Xu <ju...@sonatype.com>.
1. central is the biggest, but not the only repo in this world, so you might
be able to search out some other repos containing your required artifacts.

2. if 1) does not work, you can set up a local repo using Nexus (
http://nexus.sonatype.org), then deploy the jars into it manually.

On Mon, Jul 20, 2009 at 10:16 PM, ykyuen <yi...@gmail.com> 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
> --
> View this message in context:
> http://www.nabble.com/Migration-existing-java-project-to-maven2-tp24570669p24570669.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
- juven

RE: Migrate existing java project to maven2

Posted by ykyuen <yi...@gmail.com>.
Thanks for all the suggestions. i will take a look on those repository
managers and then install the missing jars into it. 

Thanks very much for your help =)

Regards,
Kit
-- 
View this message in context: http://www.nabble.com/Migrate-existing-java-project-to-maven2-tp24570669p24580728.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


RE: Migrate existing java project to maven2

Posted by Jonathan Woods <jo...@scintillance.com>.
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:rusty.wright@gmail.com] 
> 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: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 


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


Re: Migrate existing java project to maven2

Posted by Rusty Wright <ru...@gmail.com>.
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: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Migrate existing java project to maven2

Posted by David Hoffer <dh...@gmail.com>.
To take full advantage of maven you are going to want a proxy/repo server
for all your maven projects.  I use Artifactory but there are a number of
them available.  With this in place the is a GUI page for dealing with what
you are describing, you simply manually deploy these few artifacts in
Artifactory and your build doesn't know or care that these were handled as a
special case.

-Dave

On Mon, Jul 20, 2009 at 8:16 AM, ykyuen <yi...@gmail.com> 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
> --
> View this message in context:
> http://www.nabble.com/Migrate-existing-java-project-to-maven2-tp24570669p24570669.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Migrate existing java project to maven2

Posted by suresh <kn...@gmail.com>.
Hi ,
i also faced the same problem while migrating my project to maven2.
What i have done is i have downloaded the jar and installed them
manually using command

 mvn install:install-file -DgroupId=${groupId} -DartifactId=
${artifectId} -Dversion=${version} -Dpackaging=jar -Dfile=/path/to/file

/br
Suresh Singh


On Mon, 2009-07-20 at 07:16 -0700, 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