You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Mark Donszelmann <Ma...@slac.stanford.edu> on 2007/06/16 00:29:06 UTC
Deployed attached snapshot artifacts have version number one higher than expected.
Hi
I am attaching artifacts to the main (jar) artifact in my plugin for
maven. All works fine for versioned plugins,
but for SNAPSHOTS I see the following behavior:
1. mvn install
installs the SNAPSHOT correctly in my local repository (correctly).
2. mvn deploy
-retrieves the latest build number from the remote repository (lets
say 2).
-deploys the main SNAPSHOT artifact with build number 3 (correctly).
-deploys the pom SNAPSHOT with build number 3 (correctly).
-retrieves the latest build number again (now 3, incorrectly, it
should not have retrieved it).
-deploys the attached SNAPSHOT artifact with build numb er 4 (should
have been 3, but got confused with the previous call).
this uses mvn 2.0.6 and attaches the extra artifact with a call to
project.addAttachedArtifact(artifact);
in the "package" phase.
The standard deploy plugin and deploy goal is used.
any idea why maven looks up the latest build number twice? Did I
order some calls wrongly?
Regards
Mark Donszelmann
Re: Deployed attached snapshot artifacts have version number one higher than expected.
Posted by Mark Donszelmann <Ma...@slac.stanford.edu>.
Hi Kenney,
your solution worked fine (in 2.0.6). The problem also existed
in 2.0.5. I must have created and attached the Artifact wrongly.
bedankt
Mark
On Jun 15, 2007, at 11:19 PM, Kenney Westerhof wrote:
> Hi,
>
> haven't tested this myself with 2.0.6, but take a look at
> some other plugins that attach artifacts (javadoc, source,
> assembly:attached etc) to see what the differences are.
> Those plugins use the ProjectHelper to attach an artifact:
>
> /**
> * Used for attaching the artifact in the project
> *
> * @component
> */
> private MavenProjectHelper projectHelper;
>
> ....
>
> projectHelper.attachArtifact( project,
> "javadoc", "javadoc", outputFile );
>
> for instance. Perhaps the Artifact you created is not constructed
> properly.
> If you could try this approach and it still creates the wrong
> timestamp/buildnumber
> then you've found a bug.
>
> -- Kenney
>
>
> Mark Donszelmann wrote:
>> Hi
>> I am attaching artifacts to the main (jar) artifact in my plugin
>> for maven. All works fine for versioned plugins,
>> but for SNAPSHOTS I see the following behavior:
>> 1. mvn install
>> installs the SNAPSHOT correctly in my local repository (correctly).
>> 2. mvn deploy
>> -retrieves the latest build number from the remote repository
>> (lets say 2).
>> -deploys the main SNAPSHOT artifact with build number 3 (correctly).
>> -deploys the pom SNAPSHOT with build number 3 (correctly).
>> -retrieves the latest build number again (now 3, incorrectly, it
>> should not have retrieved it).
>> -deploys the attached SNAPSHOT artifact with build numb er 4
>> (should have been 3, but got confused with the previous call).
>> this uses mvn 2.0.6 and attaches the extra artifact with a call to
>> project.addAttachedArtifact(artifact);
>> in the "package" phase.
>> The standard deploy plugin and deploy goal is used.
>> any idea why maven looks up the latest build number twice? Did I
>> order some calls wrongly?
>> Regards
>> Mark Donszelmann
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Deployed attached snapshot artifacts have version number one
higher than expected.
Posted by Kenney Westerhof <ke...@apache.org>.
Hi,
haven't tested this myself with 2.0.6, but take a look at
some other plugins that attach artifacts (javadoc, source,
assembly:attached etc) to see what the differences are.
Those plugins use the ProjectHelper to attach an artifact:
/**
* Used for attaching the artifact in the project
*
* @component
*/
private MavenProjectHelper projectHelper;
....
projectHelper.attachArtifact( project, "javadoc", "javadoc", outputFile );
for instance. Perhaps the Artifact you created is not constructed properly.
If you could try this approach and it still creates the wrong timestamp/buildnumber
then you've found a bug.
-- Kenney
Mark Donszelmann wrote:
> Hi
>
> I am attaching artifacts to the main (jar) artifact in my plugin for
> maven. All works fine for versioned plugins,
> but for SNAPSHOTS I see the following behavior:
>
> 1. mvn install
>
> installs the SNAPSHOT correctly in my local repository (correctly).
>
> 2. mvn deploy
>
> -retrieves the latest build number from the remote repository (lets say 2).
> -deploys the main SNAPSHOT artifact with build number 3 (correctly).
> -deploys the pom SNAPSHOT with build number 3 (correctly).
> -retrieves the latest build number again (now 3, incorrectly, it should
> not have retrieved it).
> -deploys the attached SNAPSHOT artifact with build numb er 4 (should
> have been 3, but got confused with the previous call).
>
> this uses mvn 2.0.6 and attaches the extra artifact with a call to
>
> project.addAttachedArtifact(artifact);
>
> in the "package" phase.
>
> The standard deploy plugin and deploy goal is used.
>
> any idea why maven looks up the latest build number twice? Did I order
> some calls wrongly?
>
> Regards
> Mark Donszelmann
>
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org