You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by jerem <je...@gmail.com> on 2012/01/26 15:08:57 UTC

Deploying snapshots of same artifactId but different types

Hi,

Using Maven 2.2.1, I deployed (with deploy:deploy-file through command-line)
several artifacts with same version (SNAPSHOT), same artifactId and groupId,
but different types.

Here is the list I get in my nexus storage:
myArtifact-1.0-20120106.101541-1.ear
myArtifact-1.0-20120106.101541-1.ear.md5
myArtifact-1.0-20120106.101541-1.ear.sha1
myArtifact-1.0-20120106.101541-1.pom
myArtifact-1.0-20120106.101541-1.pom.md5
myArtifact-1.0-20120106.101541-1.pom.sha1
myArtifact-1.0-20120106.101603-2.jar
myArtifact-1.0-20120106.101603-2.jar.md5
myArtifact-1.0-20120106.101603-2.jar.sha1
myArtifact-1.0-20120106.101603-2.pom
myArtifact-1.0-20120106.101603-2.pom.md5
myArtifact-1.0-20120106.101603-2.pom.sha1
myArtifact-1.0-20120106.101622-3.pom
myArtifact-1.0-20120106.101622-3.pom.md5
myArtifact-1.0-20120106.101622-3.pom.sha1
myArtifact-1.0-20120106.101622-3.war
myArtifact-1.0-20120106.101622-3.war.md5
myArtifact-1.0-20120106.101622-3.war.sha1
maven-metadata.xml
maven-metadata.xml.md5
maven-metadata.xml.sha1

The problem now is that if I add the following dependency to a module pom :

<dependency>
  <groupId>myGroup</groupId>
  <artifactId>myArtifact</artifactId>
  <version>1.0-SNAPSHOT</version>
  <type>ear</type>
</dependency>	

... build fails with following error :

[INFO] snapshot myGroup:myArtifact:1.0-SNAPSHOT: checking for updates from
MYREPO
Downloading:
http://host/nexus/content/repositories/MYREPO//myGroup/myArtifact/1.0-SNAPSHOT/myArtifact-1.0-20120106.101622-3.pom
471b downloaded  (myArtifact-1.0-20120106.101622-3.pom)
Downloading:
http://host/nexus/content/repositories/MYREPO//myGroup/myArtifact/1.0-SNAPSHOT/myArtifact-1.0-20120106.101622-3.ear
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

What happens is that maven, for this artifact, gets "timestamp-3" as last
snapshot version (for the pom), and then tries to retrieve the ear with this
same version with "timestamp-3", and in our case, it does not exist.

If I only leave the "timestamp-1" pom, and rename the war so it has same
version (timestamp-1), then it works and maven is able to download
1.0-SNAPSHOT of both ear or war.

I tried "generatePom=false" for second deploy command but result was the
same - except that only 1 pom was generated of course.
I should I have deployed the war and ear in first place to avoid this issue
? 

Thanks,
Jeremie


--
View this message in context: http://maven.40175.n5.nabble.com/Deploying-snapshots-of-same-artifactId-but-different-types-tp5432928p5432928.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: Deploying snapshots of same artifactId but different types

Posted by jerem <je...@gmail.com>.
Thanks for the tip about "types" and "files".

I agree that these should be deployed with different coordinates, but I
don't want to change names of these "non-maven" project artifacts, because
it would break many existing builds ... But this is what I'll do in the
future.

--
View this message in context: http://maven.40175.n5.nabble.com/Deploying-snapshots-of-same-artifactId-but-different-types-tp5432928p5435462.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: Deploying snapshots of same artifactId but different types

Posted by Wayne Fay <wa...@gmail.com>.
> Try uploading all at once using 'files', 'types' and 'classifiers'.
>
> Or if you are on Nexus, deploy them using the UI, you can attach
> multiple artifacts there.

What Roland said is true and will work. Alternatively you should
reconsider deploying so many artifacts with different types under the
same G/A/V. Obviously this can be a problem. You should use different
coordinates for these artifacts IMO.

Wayne

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


Re: Deploying snapshots of same artifactId but different types

Posted by "Asmann, Roland" <Ro...@adesso.at>.
Try uploading all at once using 'files', 'types' and 'classifiers'.

Or if you are on Nexus, deploy them using the UI, you can attach 
multiple artifacts there.


On 26.01.2012 15:08, jerem wrote:
> Hi,
>
> Using Maven 2.2.1, I deployed (with deploy:deploy-file through command-line)
> several artifacts with same version (SNAPSHOT), same artifactId and groupId,
> but different types.
>
> Here is the list I get in my nexus storage:
> myArtifact-1.0-20120106.101541-1.ear
> myArtifact-1.0-20120106.101541-1.ear.md5
> myArtifact-1.0-20120106.101541-1.ear.sha1
> myArtifact-1.0-20120106.101541-1.pom
> myArtifact-1.0-20120106.101541-1.pom.md5
> myArtifact-1.0-20120106.101541-1.pom.sha1
> myArtifact-1.0-20120106.101603-2.jar
> myArtifact-1.0-20120106.101603-2.jar.md5
> myArtifact-1.0-20120106.101603-2.jar.sha1
> myArtifact-1.0-20120106.101603-2.pom
> myArtifact-1.0-20120106.101603-2.pom.md5
> myArtifact-1.0-20120106.101603-2.pom.sha1
> myArtifact-1.0-20120106.101622-3.pom
> myArtifact-1.0-20120106.101622-3.pom.md5
> myArtifact-1.0-20120106.101622-3.pom.sha1
> myArtifact-1.0-20120106.101622-3.war
> myArtifact-1.0-20120106.101622-3.war.md5
> myArtifact-1.0-20120106.101622-3.war.sha1
> maven-metadata.xml
> maven-metadata.xml.md5
> maven-metadata.xml.sha1
>
> The problem now is that if I add the following dependency to a module pom :
>
> <dependency>
> <groupId>myGroup</groupId>
> <artifactId>myArtifact</artifactId>
> <version>1.0-SNAPSHOT</version>
> <type>ear</type>
> </dependency>
>
> ... build fails with following error :
>
> [INFO] snapshot myGroup:myArtifact:1.0-SNAPSHOT: checking for updates from
> MYREPO
> Downloading:
> http://host/nexus/content/repositories/MYREPO//myGroup/myArtifact/1.0-SNAPSHOT/myArtifact-1.0-20120106.101622-3.pom
> 471b downloaded (myArtifact-1.0-20120106.101622-3.pom)
> Downloading:
> http://host/nexus/content/repositories/MYREPO//myGroup/myArtifact/1.0-SNAPSHOT/myArtifact-1.0-20120106.101622-3.ear
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Failed to resolve artifact.
>
> What happens is that maven, for this artifact, gets "timestamp-3" as last
> snapshot version (for the pom), and then tries to retrieve the ear with this
> same version with "timestamp-3", and in our case, it does not exist.
>
> If I only leave the "timestamp-1" pom, and rename the war so it has same
> version (timestamp-1), then it works and maven is able to download
> 1.0-SNAPSHOT of both ear or war.
>
> I tried "generatePom=false" for second deploy command but result was the
> same - except that only 1 pom was generated of course.
> I should I have deployed the war and ear in first place to avoid this issue
> ?
>
> Thanks,
> Jeremie
>
>
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/Deploying-snapshots-of-same-artifactId-but-different-types-tp5432928p5432928.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
>

-- 
Roland Asmann
Senior Software Engineer

adesso Austria GmbH
Floridotower 26. Stock              T +43 1 2198790-27
Floridsdorfer Hauptstr. 1           F +43 1 2198790-927
A-1210 Wien                         M +43 664 88657566
                                    E roland.asmann@adesso.at
                                    W www.adesso.at

-------------------------------------------------------------
             >>> business. people. technology. <<<
-------------------------------------------------------------

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