You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Qureshi,Shahzad [Ontario]" <Sh...@ec.gc.ca> on 2009/07/31 20:52:11 UTC

Uploading a new version to internal remote repository

Hi all,

I've an internal remote repository setup which is working fine. I just
have one confusion.

I uploaded a internally developed library to the internal remote
repository a few months ago which worked fine. However, now there is a
new version for it available and I wanted to upload the new version but
I also don't want to remove the older version yet as there are few
modules that require the old version. 

I simply updated the version number in the pom file of the library and
updated the file name in the upload script and it was uploaded fine.

I updated the pom file on my module to the new version, however I still
get the older version downloaded in the module that needs to use the new
version.

Someone had mentioned to me before that if I use SNAPSHOT I won't get
this problem however, is that the rite approach though? I thought
SNAPSHOT is used only for the libraries/modules that are actively under
development and not for the stable/production versions?

Hows do log4j for instance do this? I can simply change the version for
log4j in my pom file to whatever I want and I'll get that version.



--------------------------------------------
Shahzad Qureshi
Systems Analyst/Programmer
Applications Directorate, CIOB
Environment Canada
416-739-4702
shahzad.qureshi@ec.gc.ca


RE: Uploading a new version to internal remote repository

Posted by "Qureshi,Shahzad [Ontario]" <Sh...@ec.gc.ca>.
This is what I did

The pom for version 2.0 is 

<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>xx.xy.xz.abc.commons</groupId>
	<artifactId>abc-commons</artifactId>
	<version>2.0</version>
	<name>DMS Commons</name>
	<description>
	description of the lib
	</description>
	<organization>
		<name>Environment Canada</name>
		<url>http://path/</url>
	</organization>
</project> 

And upload script for 2.0 is
mvn deploy:deploy-file -Durl=scp://path -DrepositoryId=maven-repo
-Dfile=commons-2.0.jar -DpomFile=pom.xml


And pom for version 3.0 is

<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>xx.xy.xz.abc.commons</groupId>
	<artifactId>abc-commons</artifactId>
	<version>3.0</version>
	<name>DMS Commons</name>
	<description>
	description of the lib
	</description>
	<organization>
		<name>Environment Canada</name>
		<url>http://path/</url>
	</organization>
</project> 

And upload script for 3.0 is
mvn deploy:deploy-file -Durl=scp://path -DrepositoryId=maven-repo
-Dfile=commons-3.0.jar -DpomFile=pom.xml


--------------------------------------------
Shahzad Qureshi
Systems Analyst/Programmer
Applications Directorate, CIOB
Environment Canada
416-739-4702
shahzad.qureshi@ec.gc.ca

-----Original Message-----
From: adasal [mailto:adam.saltiel@gmail.com] 
Sent: Friday, July 31, 2009 3:07 PM
To: Maven Users List
Subject: Re: Uploading a new version to internal remote repository

Are you sure?
I think you have misconfigured something.
The pom dictates the version of artifact you are using.
This doesn't make sense to me.
Adam

2009/7/31 Qureshi,Shahzad [Ontario] <Sh...@ec.gc.ca>

> Hi all,
>
> I've an internal remote repository setup which is working fine. I just

> have one confusion.
>
> I uploaded a internally developed library to the internal remote 
> repository a few months ago which worked fine. However, now there is a

> new version for it available and I wanted to upload the new version 
> but I also don't want to remove the older version yet as there are few

> modules that require the old version.
>
> I simply updated the version number in the pom file of the library and

> updated the file name in the upload script and it was uploaded fine.
>
> I updated the pom file on my module to the new version, however I 
> still get the older version downloaded in the module that needs to use

> the new version.
>
> Someone had mentioned to me before that if I use SNAPSHOT I won't get 
> this problem however, is that the rite approach though? I thought 
> SNAPSHOT is used only for the libraries/modules that are actively 
> under development and not for the stable/production versions?
>
> Hows do log4j for instance do this? I can simply change the version 
> for log4j in my pom file to whatever I want and I'll get that version.
>
>
>
> --------------------------------------------
> Shahzad Qureshi
> Systems Analyst/Programmer
> Applications Directorate, CIOB
> Environment Canada
> 416-739-4702
> shahzad.qureshi@ec.gc.ca
>
>

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


Re: Uploading a new version to internal remote repository

Posted by Alexander <th...@gmail.com>.
Just be sure you got it. There is no difference between your internal
developed libraries and external downloaded dependencies (as log4j).
Artifact at repostory level it is no more than set of files. Get right
feeling for repositories. [?]

2009/8/1 Qureshi,Shahzad [Ontario] <Sh...@ec.gc.ca>

> Nevermind, it works fine. I had not enabled dependency management in
> eclipse and kept thinking that it wasn't getting latest version.
>
> Thanks adasal for your input
>
>
> --------------------------------------------
> Shahzad Qureshi
> Systems Analyst/Programmer
> Applications Directorate, CIOB
> Environment Canada
> 416-739-4702
> shahzad.qureshi@ec.gc.ca
>
> -----Original Message-----
> From: adasal [mailto:adam.saltiel@gmail.com]
> Sent: Friday, July 31, 2009 3:07 PM
> To: Maven Users List
> Subject: Re: Uploading a new version to internal remote repository
>
> Are you sure?
> I think you have misconfigured something.
> The pom dictates the version of artifact you are using.
> This doesn't make sense to me.
> Adam
>
> 2009/7/31 Qureshi,Shahzad [Ontario] <Sh...@ec.gc.ca>
>
> > Hi all,
> >
> > I've an internal remote repository setup which is working fine. I just
>
> > have one confusion.
> >
> > I uploaded a internally developed library to the internal remote
> > repository a few months ago which worked fine. However, now there is a
>
> > new version for it available and I wanted to upload the new version
> > but I also don't want to remove the older version yet as there are few
>
> > modules that require the old version.
> >
> > I simply updated the version number in the pom file of the library and
>
> > updated the file name in the upload script and it was uploaded fine.
> >
> > I updated the pom file on my module to the new version, however I
> > still get the older version downloaded in the module that needs to use
>
> > the new version.
> >
> > Someone had mentioned to me before that if I use SNAPSHOT I won't get
> > this problem however, is that the rite approach though? I thought
> > SNAPSHOT is used only for the libraries/modules that are actively
> > under development and not for the stable/production versions?
> >
> > Hows do log4j for instance do this? I can simply change the version
> > for log4j in my pom file to whatever I want and I'll get that version.
> >
> >
> >
> > --------------------------------------------
> > Shahzad Qureshi
> > Systems Analyst/Programmer
> > Applications Directorate, CIOB
> > Environment Canada
> > 416-739-4702
> > shahzad.qureshi@ec.gc.ca
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Alexander

Re: Uploading a new version to internal remote repository

Posted by adasal <ad...@gmail.com>.
I believe the following is correct.
groupId
artifactId
version
triangulate the POM and, therefore, the artifact for which this POM is
responsible.
By enabling dependency management you have made your second POM the child of
the first and allowed any version of a dependencies artifact to be overriden
in this child.
If you are using eclipse have you looked at the POM xml it produces?
Within the dependency management tags there should be the 'long' description
of your artifacts.
Without dependency management, the <dependencyManagement> tag, declared you
would just depend on the <dependencies> tag to define all needed artifacts.
I believe there is still some confusion here as the POMs you show are the
artifact POMs, not the project POMs, but my guess is that you have created
two project POMs unintentionally?
For your scenario you would do one of three things.
Define both artifact versions within the same project POM. Both artifacts
sit side by side and both are on the class path - which class path depends
on how scope is defined.
Define both artifact versions with the same POM, but use profiles so that
only one of them is 'seen' in any one situation.
Have different local project POMs depending on need of the user each with
only one of the different artifacts defined.
Adam

2009/7/31 Qureshi,Shahzad [Ontario] <Sh...@ec.gc.ca>

> Nevermind, it works fine. I had not enabled dependency management in
> eclipse and kept thinking that it wasn't getting latest version.
>
> Thanks adasal for your input
>
>
> --------------------------------------------
> Shahzad Qureshi
> Systems Analyst/Programmer
> Applications Directorate, CIOB
> Environment Canada
> 416-739-4702
> shahzad.qureshi@ec.gc.ca
>
> -----Original Message-----
> From: adasal [mailto:adam.saltiel@gmail.com]
> Sent: Friday, July 31, 2009 3:07 PM
> To: Maven Users List
> Subject: Re: Uploading a new version to internal remote repository
>
> Are you sure?
> I think you have misconfigured something.
> The pom dictates the version of artifact you are using.
> This doesn't make sense to me.
> Adam
>
> 2009/7/31 Qureshi,Shahzad [Ontario] <Sh...@ec.gc.ca>
>
> > Hi all,
> >
> > I've an internal remote repository setup which is working fine. I just
>
> > have one confusion.
> >
> > I uploaded a internally developed library to the internal remote
> > repository a few months ago which worked fine. However, now there is a
>
> > new version for it available and I wanted to upload the new version
> > but I also don't want to remove the older version yet as there are few
>
> > modules that require the old version.
> >
> > I simply updated the version number in the pom file of the library and
>
> > updated the file name in the upload script and it was uploaded fine.
> >
> > I updated the pom file on my module to the new version, however I
> > still get the older version downloaded in the module that needs to use
>
> > the new version.
> >
> > Someone had mentioned to me before that if I use SNAPSHOT I won't get
> > this problem however, is that the rite approach though? I thought
> > SNAPSHOT is used only for the libraries/modules that are actively
> > under development and not for the stable/production versions?
> >
> > Hows do log4j for instance do this? I can simply change the version
> > for log4j in my pom file to whatever I want and I'll get that version.
> >
> >
> >
> > --------------------------------------------
> > Shahzad Qureshi
> > Systems Analyst/Programmer
> > Applications Directorate, CIOB
> > Environment Canada
> > 416-739-4702
> > shahzad.qureshi@ec.gc.ca
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

RE: Uploading a new version to internal remote repository

Posted by "Qureshi,Shahzad [Ontario]" <Sh...@ec.gc.ca>.
Nevermind, it works fine. I had not enabled dependency management in
eclipse and kept thinking that it wasn't getting latest version.

Thanks adasal for your input 


--------------------------------------------
Shahzad Qureshi
Systems Analyst/Programmer
Applications Directorate, CIOB
Environment Canada
416-739-4702
shahzad.qureshi@ec.gc.ca

-----Original Message-----
From: adasal [mailto:adam.saltiel@gmail.com] 
Sent: Friday, July 31, 2009 3:07 PM
To: Maven Users List
Subject: Re: Uploading a new version to internal remote repository

Are you sure?
I think you have misconfigured something.
The pom dictates the version of artifact you are using.
This doesn't make sense to me.
Adam

2009/7/31 Qureshi,Shahzad [Ontario] <Sh...@ec.gc.ca>

> Hi all,
>
> I've an internal remote repository setup which is working fine. I just

> have one confusion.
>
> I uploaded a internally developed library to the internal remote 
> repository a few months ago which worked fine. However, now there is a

> new version for it available and I wanted to upload the new version 
> but I also don't want to remove the older version yet as there are few

> modules that require the old version.
>
> I simply updated the version number in the pom file of the library and

> updated the file name in the upload script and it was uploaded fine.
>
> I updated the pom file on my module to the new version, however I 
> still get the older version downloaded in the module that needs to use

> the new version.
>
> Someone had mentioned to me before that if I use SNAPSHOT I won't get 
> this problem however, is that the rite approach though? I thought 
> SNAPSHOT is used only for the libraries/modules that are actively 
> under development and not for the stable/production versions?
>
> Hows do log4j for instance do this? I can simply change the version 
> for log4j in my pom file to whatever I want and I'll get that version.
>
>
>
> --------------------------------------------
> Shahzad Qureshi
> Systems Analyst/Programmer
> Applications Directorate, CIOB
> Environment Canada
> 416-739-4702
> shahzad.qureshi@ec.gc.ca
>
>

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


Re: Uploading a new version to internal remote repository

Posted by adasal <ad...@gmail.com>.
Are you sure?
I think you have misconfigured something.
The pom dictates the version of artifact you are using.
This doesn't make sense to me.
Adam

2009/7/31 Qureshi,Shahzad [Ontario] <Sh...@ec.gc.ca>

> Hi all,
>
> I've an internal remote repository setup which is working fine. I just
> have one confusion.
>
> I uploaded a internally developed library to the internal remote
> repository a few months ago which worked fine. However, now there is a
> new version for it available and I wanted to upload the new version but
> I also don't want to remove the older version yet as there are few
> modules that require the old version.
>
> I simply updated the version number in the pom file of the library and
> updated the file name in the upload script and it was uploaded fine.
>
> I updated the pom file on my module to the new version, however I still
> get the older version downloaded in the module that needs to use the new
> version.
>
> Someone had mentioned to me before that if I use SNAPSHOT I won't get
> this problem however, is that the rite approach though? I thought
> SNAPSHOT is used only for the libraries/modules that are actively under
> development and not for the stable/production versions?
>
> Hows do log4j for instance do this? I can simply change the version for
> log4j in my pom file to whatever I want and I'll get that version.
>
>
>
> --------------------------------------------
> Shahzad Qureshi
> Systems Analyst/Programmer
> Applications Directorate, CIOB
> Environment Canada
> 416-739-4702
> shahzad.qureshi@ec.gc.ca
>
>