You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Alok, Niraj" <ni...@gs.com> on 2007/06/15 14:26:37 UTC

0-Snapshot numbering for classifiers

> Hi,
> 
> I have 2 jars that get installed to the repository for the same
> artifact. One is the application jar, and the other is, say sources
> jar. 
> The repository looks something like this: GroupId -> ArtifactId ->
> app-1.0.jar and app-1.0-sources.jar
> 
> When I include both of them in the pom file as dependencies (using
> classifier for sources), both of them get downloaded to my local .m2
> (provided the jars are versioned)
> If the jars are snapshots, then the numbering system is making the
> jars installed in the repository as app-629.jar and
> app-sources-630.jar (numbers are just an example)
> And when I give 0-SNAPSHOT in my dependendencies, only the jar with
> the higher number gets downloaded. 
> 
> I want to download both the jars in cases of versions or snapshots. Am
> I doing something wrong with the way I am installing them, or should I
> do something else while downloading ? 
> 
> Thanks,
> Niraj
> 

RE: 0-Snapshot numbering for classifiers

Posted by "Alok, Niraj" <ni...@gs.com>.
Thanks for the hint !!

This piece did the trick :-) 

projectHelper.attachArtifact( project, "java-source", "db", file ); 

-----Original Message-----
From: Eric Redmond [mailto:eric.redmond@gmail.com] 
Sent: Wednesday, June 20, 2007 9:37 PM
To: Maven Users List
Subject: Re: 0-Snapshot numbering for classifiers

When you create an assembly, executing the assembly:attach within your
pom,
running the "mvn install" phase will install both the normal artifact
(jar)
as well as the assembled artifact.

Eric

On 6/20/07, Alok, Niraj <ni...@gs.com> wrote:
>
>
> Probably I am asking a very specific question..
> On general terms, when I do mvn install, or mvn assembly, and out of
> that command, get 2 jar files created, how do I ensure that they run
> within the same install step ? (I don't want to run separate install
> commands for each jar file that got created)
> Its looking like a lifecycle question but am not able to find anything
> on the web.
>
> -----Original Message-----
> From: Alok, Niraj
> Sent: Wednesday, June 20, 2007 1:00 PM
> To: 'Maven Users List'
> Subject: RE: 0-Snapshot numbering for classifiers
>
> I took a look at the maven assembly plugin, but it just creates the
> assembly and doesn't deploy them into the repository.
> How can I ensure that the assembly gets installed/deployed into the
> local/remote repository??
>
> Thanks,
> Niraj
>
>
> -----Original Message-----
> From: Alok, Niraj
> Sent: Tuesday, June 19, 2007 10:07 PM
> To: 'Maven Users List'
> Subject: RE: 0-Snapshot numbering for classifiers
>
> After close inspection between maven-sources-plugin and my custom
> plugin, I notice some differences finally J
>
> The source plugin just creates a jar file. During mvn install, the
> source jar gets installed to the repository along with the app jar in
> the same execution.
>
> The custom plugin creates a jar file but it doesn't get picked up by
the
> install phase even when the plugin says @phase install.
>
> The question now boils down to is how to ensure that the jar created
> from the custom plugin also gets picked up by the default mvn install?
>
> Thanks for the pointers till now !
>
> Niraj
>
>
> -----Original Message-----
> From: Alok, Niraj
> Sent: Tuesday, June 19, 2007 5:33 PM
> To: 'Maven Users List'
> Subject: RE: 0-Snapshot numbering for classifiers
>
> Im trying to do through code, but the numbering of the jar changes for
> snapshot versions, making them unavailable for download.
> Is there some specific piece of code that is required to attach a
> classifier jar to the same snapshot version  as the app jar ??
> I tried the code from maven-source-plugin, but there it is not
deploying
> the jar explicitly to the repository but I am forced to do in in the
> code to deploy to repository which is probably making all the
> difference...
>
> -----Original Message-----
> From: Eric Redmond [mailto:eric.redmond@gmail.com]
> Sent: Tuesday, June 19, 2007 1:46 AM
> To: Maven Users List
> Subject: Re: 0-Snapshot numbering for classifiers
>
> Sure, I understand the desire to write code rather than learn a
> specification like assembly - however, your ability to find support
for
> a
> custom plugin is going to be drastically more difficult than finding
> support
> for a core plugin.
>
> Just a suggestion, take care;
> Eric
>
> On 6/18/07, Alok, Niraj <ni...@gs.com> wrote:
> >
> > I am more comfortable writing a specific plugin to do this because
we
> > want to introduce custom tags in the pom and assembly wouldn't allow
> us
> > to do.
> > If it can be done through code, it would be perfect !
> >
> >
> > -----Original Message-----
> > From: Eric Redmond [mailto:eric.redmond@gmail.com]
> > Sent: Saturday, June 16, 2007 12:10 AM
> > To: Maven Users List
> > Subject: Re: 0-Snapshot numbering for classifiers
> >
> > Why are you writing code to do this? You should be installing the
> > sources
> > via the source plugin:
> >
> > mvn source:jar
> >
> > Or assembly plugin:
> >
> > http://maven.apache.org/plugins/maven-assembly-plugin/usage.html
> >
>
http://maven.apache.org/plugins/maven-assembly-plugin/descriptor-refs.ht
> > ml
> >
> > Eric
> >
> > On 6/15/07, niraj <ni...@gs.com> wrote:
> > >
> > >
> > > To be more specific, I am installing the app.jar through normal
mvn
> > deploy
> > > and the sources.jar through a custom pojo, as its not sources, but
> > some
> > > other project files,  and the code for that is:
> > >
> > >         Artifact artifact =
> > > m_artifactFactory.createArtifactWithClassifier(m_groupId,
> > >                 m_artifactId, m_version, "jar", jarType);
> > >
> > >         try {
> > >             deployer.deploy(file, artifact,
> > >
> > m_project.getDistributionManagementArtifactRepository(),
> > >                 m_localRepository);
> > >         } catch (ArtifactDeploymentException e) {
> > >             throw new MojoExecutionException(e.getMessage(), e);
> > >         }
> > >
> > > While downloading, I am just adding the classifier element,
jarType
> in
> > the
> > > dependency tag.
> > > It works for versioned jars, not for snapshots. I am using mvn 2.
> > > --
> > > View this message in context:
> > >
> >
>
http://www.nabble.com/0-Snapshot-numbering-for-classifiers-tf3927571s177
> > .html#a11138790
> > > 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
> > >
> > >
> >
> >
> > --
> > Eric Redmond
> > http://www.sonatype.com
> >
> >
---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
>
> --
> Eric Redmond
> http://www.sonatype.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Eric Redmond
http://www.sonatype.com

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


Re: 0-Snapshot numbering for classifiers

Posted by Eric Redmond <er...@gmail.com>.
When you create an assembly, executing the assembly:attach within your pom,
running the "mvn install" phase will install both the normal artifact (jar)
as well as the assembled artifact.

Eric

On 6/20/07, Alok, Niraj <ni...@gs.com> wrote:
>
>
> Probably I am asking a very specific question..
> On general terms, when I do mvn install, or mvn assembly, and out of
> that command, get 2 jar files created, how do I ensure that they run
> within the same install step ? (I don't want to run separate install
> commands for each jar file that got created)
> Its looking like a lifecycle question but am not able to find anything
> on the web.
>
> -----Original Message-----
> From: Alok, Niraj
> Sent: Wednesday, June 20, 2007 1:00 PM
> To: 'Maven Users List'
> Subject: RE: 0-Snapshot numbering for classifiers
>
> I took a look at the maven assembly plugin, but it just creates the
> assembly and doesn't deploy them into the repository.
> How can I ensure that the assembly gets installed/deployed into the
> local/remote repository??
>
> Thanks,
> Niraj
>
>
> -----Original Message-----
> From: Alok, Niraj
> Sent: Tuesday, June 19, 2007 10:07 PM
> To: 'Maven Users List'
> Subject: RE: 0-Snapshot numbering for classifiers
>
> After close inspection between maven-sources-plugin and my custom
> plugin, I notice some differences finally J
>
> The source plugin just creates a jar file. During mvn install, the
> source jar gets installed to the repository along with the app jar in
> the same execution.
>
> The custom plugin creates a jar file but it doesn't get picked up by the
> install phase even when the plugin says @phase install.
>
> The question now boils down to is how to ensure that the jar created
> from the custom plugin also gets picked up by the default mvn install?
>
> Thanks for the pointers till now !
>
> Niraj
>
>
> -----Original Message-----
> From: Alok, Niraj
> Sent: Tuesday, June 19, 2007 5:33 PM
> To: 'Maven Users List'
> Subject: RE: 0-Snapshot numbering for classifiers
>
> Im trying to do through code, but the numbering of the jar changes for
> snapshot versions, making them unavailable for download.
> Is there some specific piece of code that is required to attach a
> classifier jar to the same snapshot version  as the app jar ??
> I tried the code from maven-source-plugin, but there it is not deploying
> the jar explicitly to the repository but I am forced to do in in the
> code to deploy to repository which is probably making all the
> difference...
>
> -----Original Message-----
> From: Eric Redmond [mailto:eric.redmond@gmail.com]
> Sent: Tuesday, June 19, 2007 1:46 AM
> To: Maven Users List
> Subject: Re: 0-Snapshot numbering for classifiers
>
> Sure, I understand the desire to write code rather than learn a
> specification like assembly - however, your ability to find support for
> a
> custom plugin is going to be drastically more difficult than finding
> support
> for a core plugin.
>
> Just a suggestion, take care;
> Eric
>
> On 6/18/07, Alok, Niraj <ni...@gs.com> wrote:
> >
> > I am more comfortable writing a specific plugin to do this because we
> > want to introduce custom tags in the pom and assembly wouldn't allow
> us
> > to do.
> > If it can be done through code, it would be perfect !
> >
> >
> > -----Original Message-----
> > From: Eric Redmond [mailto:eric.redmond@gmail.com]
> > Sent: Saturday, June 16, 2007 12:10 AM
> > To: Maven Users List
> > Subject: Re: 0-Snapshot numbering for classifiers
> >
> > Why are you writing code to do this? You should be installing the
> > sources
> > via the source plugin:
> >
> > mvn source:jar
> >
> > Or assembly plugin:
> >
> > http://maven.apache.org/plugins/maven-assembly-plugin/usage.html
> >
> http://maven.apache.org/plugins/maven-assembly-plugin/descriptor-refs.ht
> > ml
> >
> > Eric
> >
> > On 6/15/07, niraj <ni...@gs.com> wrote:
> > >
> > >
> > > To be more specific, I am installing the app.jar through normal mvn
> > deploy
> > > and the sources.jar through a custom pojo, as its not sources, but
> > some
> > > other project files,  and the code for that is:
> > >
> > >         Artifact artifact =
> > > m_artifactFactory.createArtifactWithClassifier(m_groupId,
> > >                 m_artifactId, m_version, "jar", jarType);
> > >
> > >         try {
> > >             deployer.deploy(file, artifact,
> > >
> > m_project.getDistributionManagementArtifactRepository(),
> > >                 m_localRepository);
> > >         } catch (ArtifactDeploymentException e) {
> > >             throw new MojoExecutionException(e.getMessage(), e);
> > >         }
> > >
> > > While downloading, I am just adding the classifier element, jarType
> in
> > the
> > > dependency tag.
> > > It works for versioned jars, not for snapshots. I am using mvn 2.
> > > --
> > > View this message in context:
> > >
> >
> http://www.nabble.com/0-Snapshot-numbering-for-classifiers-tf3927571s177
> > .html#a11138790
> > > 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
> > >
> > >
> >
> >
> > --
> > Eric Redmond
> > http://www.sonatype.com
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
>
> --
> Eric Redmond
> http://www.sonatype.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Eric Redmond
http://www.sonatype.com

RE: 0-Snapshot numbering for classifiers

Posted by "Alok, Niraj" <ni...@gs.com>.
 
Probably I am asking a very specific question..
On general terms, when I do mvn install, or mvn assembly, and out of
that command, get 2 jar files created, how do I ensure that they run
within the same install step ? (I don't want to run separate install
commands for each jar file that got created) 
Its looking like a lifecycle question but am not able to find anything
on the web.

-----Original Message-----
From: Alok, Niraj 
Sent: Wednesday, June 20, 2007 1:00 PM
To: 'Maven Users List'
Subject: RE: 0-Snapshot numbering for classifiers

I took a look at the maven assembly plugin, but it just creates the
assembly and doesn't deploy them into the repository.
How can I ensure that the assembly gets installed/deployed into the
local/remote repository?? 

Thanks,
Niraj


-----Original Message-----
From: Alok, Niraj 
Sent: Tuesday, June 19, 2007 10:07 PM
To: 'Maven Users List'
Subject: RE: 0-Snapshot numbering for classifiers

 After close inspection between maven-sources-plugin and my custom
plugin, I notice some differences finally J

The source plugin just creates a jar file. During mvn install, the
source jar gets installed to the repository along with the app jar in
the same execution. 

The custom plugin creates a jar file but it doesn't get picked up by the
install phase even when the plugin says @phase install. 

The question now boils down to is how to ensure that the jar created
from the custom plugin also gets picked up by the default mvn install? 

Thanks for the pointers till now ! 

Niraj


-----Original Message-----
From: Alok, Niraj 
Sent: Tuesday, June 19, 2007 5:33 PM
To: 'Maven Users List'
Subject: RE: 0-Snapshot numbering for classifiers

Im trying to do through code, but the numbering of the jar changes for
snapshot versions, making them unavailable for download. 
Is there some specific piece of code that is required to attach a
classifier jar to the same snapshot version  as the app jar ??
I tried the code from maven-source-plugin, but there it is not deploying
the jar explicitly to the repository but I am forced to do in in the
code to deploy to repository which is probably making all the
difference...

-----Original Message-----
From: Eric Redmond [mailto:eric.redmond@gmail.com] 
Sent: Tuesday, June 19, 2007 1:46 AM
To: Maven Users List
Subject: Re: 0-Snapshot numbering for classifiers

Sure, I understand the desire to write code rather than learn a
specification like assembly - however, your ability to find support for
a
custom plugin is going to be drastically more difficult than finding
support
for a core plugin.

Just a suggestion, take care;
Eric

On 6/18/07, Alok, Niraj <ni...@gs.com> wrote:
>
> I am more comfortable writing a specific plugin to do this because we
> want to introduce custom tags in the pom and assembly wouldn't allow
us
> to do.
> If it can be done through code, it would be perfect !
>
>
> -----Original Message-----
> From: Eric Redmond [mailto:eric.redmond@gmail.com]
> Sent: Saturday, June 16, 2007 12:10 AM
> To: Maven Users List
> Subject: Re: 0-Snapshot numbering for classifiers
>
> Why are you writing code to do this? You should be installing the
> sources
> via the source plugin:
>
> mvn source:jar
>
> Or assembly plugin:
>
> http://maven.apache.org/plugins/maven-assembly-plugin/usage.html
>
http://maven.apache.org/plugins/maven-assembly-plugin/descriptor-refs.ht
> ml
>
> Eric
>
> On 6/15/07, niraj <ni...@gs.com> wrote:
> >
> >
> > To be more specific, I am installing the app.jar through normal mvn
> deploy
> > and the sources.jar through a custom pojo, as its not sources, but
> some
> > other project files,  and the code for that is:
> >
> >         Artifact artifact =
> > m_artifactFactory.createArtifactWithClassifier(m_groupId,
> >                 m_artifactId, m_version, "jar", jarType);
> >
> >         try {
> >             deployer.deploy(file, artifact,
> >
> m_project.getDistributionManagementArtifactRepository(),
> >                 m_localRepository);
> >         } catch (ArtifactDeploymentException e) {
> >             throw new MojoExecutionException(e.getMessage(), e);
> >         }
> >
> > While downloading, I am just adding the classifier element, jarType
in
> the
> > dependency tag.
> > It works for versioned jars, not for snapshots. I am using mvn 2.
> > --
> > View this message in context:
> >
>
http://www.nabble.com/0-Snapshot-numbering-for-classifiers-tf3927571s177
> .html#a11138790
> > 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
> >
> >
>
>
> --
> Eric Redmond
> http://www.sonatype.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Eric Redmond
http://www.sonatype.com

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


RE: 0-Snapshot numbering for classifiers

Posted by "Alok, Niraj" <ni...@gs.com>.
I took a look at the maven assembly plugin, but it just creates the
assembly and doesn't deploy them into the repository.
How can I ensure that the assembly gets installed/deployed into the
local/remote repository?? 

Thanks,
Niraj


-----Original Message-----
From: Alok, Niraj 
Sent: Tuesday, June 19, 2007 10:07 PM
To: 'Maven Users List'
Subject: RE: 0-Snapshot numbering for classifiers

 After close inspection between maven-sources-plugin and my custom
plugin, I notice some differences finally J

The source plugin just creates a jar file. During mvn install, the
source jar gets installed to the repository along with the app jar in
the same execution. 

The custom plugin creates a jar file but it doesn't get picked up by the
install phase even when the plugin says @phase install. 

The question now boils down to is how to ensure that the jar created
from the custom plugin also gets picked up by the default mvn install? 

Thanks for the pointers till now ! 

Niraj


-----Original Message-----
From: Alok, Niraj 
Sent: Tuesday, June 19, 2007 5:33 PM
To: 'Maven Users List'
Subject: RE: 0-Snapshot numbering for classifiers

Im trying to do through code, but the numbering of the jar changes for
snapshot versions, making them unavailable for download. 
Is there some specific piece of code that is required to attach a
classifier jar to the same snapshot version  as the app jar ??
I tried the code from maven-source-plugin, but there it is not deploying
the jar explicitly to the repository but I am forced to do in in the
code to deploy to repository which is probably making all the
difference...

-----Original Message-----
From: Eric Redmond [mailto:eric.redmond@gmail.com] 
Sent: Tuesday, June 19, 2007 1:46 AM
To: Maven Users List
Subject: Re: 0-Snapshot numbering for classifiers

Sure, I understand the desire to write code rather than learn a
specification like assembly - however, your ability to find support for
a
custom plugin is going to be drastically more difficult than finding
support
for a core plugin.

Just a suggestion, take care;
Eric

On 6/18/07, Alok, Niraj <ni...@gs.com> wrote:
>
> I am more comfortable writing a specific plugin to do this because we
> want to introduce custom tags in the pom and assembly wouldn't allow
us
> to do.
> If it can be done through code, it would be perfect !
>
>
> -----Original Message-----
> From: Eric Redmond [mailto:eric.redmond@gmail.com]
> Sent: Saturday, June 16, 2007 12:10 AM
> To: Maven Users List
> Subject: Re: 0-Snapshot numbering for classifiers
>
> Why are you writing code to do this? You should be installing the
> sources
> via the source plugin:
>
> mvn source:jar
>
> Or assembly plugin:
>
> http://maven.apache.org/plugins/maven-assembly-plugin/usage.html
>
http://maven.apache.org/plugins/maven-assembly-plugin/descriptor-refs.ht
> ml
>
> Eric
>
> On 6/15/07, niraj <ni...@gs.com> wrote:
> >
> >
> > To be more specific, I am installing the app.jar through normal mvn
> deploy
> > and the sources.jar through a custom pojo, as its not sources, but
> some
> > other project files,  and the code for that is:
> >
> >         Artifact artifact =
> > m_artifactFactory.createArtifactWithClassifier(m_groupId,
> >                 m_artifactId, m_version, "jar", jarType);
> >
> >         try {
> >             deployer.deploy(file, artifact,
> >
> m_project.getDistributionManagementArtifactRepository(),
> >                 m_localRepository);
> >         } catch (ArtifactDeploymentException e) {
> >             throw new MojoExecutionException(e.getMessage(), e);
> >         }
> >
> > While downloading, I am just adding the classifier element, jarType
in
> the
> > dependency tag.
> > It works for versioned jars, not for snapshots. I am using mvn 2.
> > --
> > View this message in context:
> >
>
http://www.nabble.com/0-Snapshot-numbering-for-classifiers-tf3927571s177
> .html#a11138790
> > 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
> >
> >
>
>
> --
> Eric Redmond
> http://www.sonatype.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Eric Redmond
http://www.sonatype.com

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


RE: 0-Snapshot numbering for classifiers

Posted by "Alok, Niraj" <ni...@gs.com>.
 After close inspection between maven-sources-plugin and my custom
plugin, I notice some differences finally J

The source plugin just creates a jar file. During mvn install, the
source jar gets installed to the repository along with the app jar in
the same execution. 

The custom plugin creates a jar file but it doesn't get picked up by the
install phase even when the plugin says @phase install. 

The question now boils down to is how to ensure that the jar created
from the custom plugin also gets picked up by the default mvn install? 

Thanks for the pointers till now ! 

Niraj


-----Original Message-----
From: Alok, Niraj 
Sent: Tuesday, June 19, 2007 5:33 PM
To: 'Maven Users List'
Subject: RE: 0-Snapshot numbering for classifiers

Im trying to do through code, but the numbering of the jar changes for
snapshot versions, making them unavailable for download. 
Is there some specific piece of code that is required to attach a
classifier jar to the same snapshot version  as the app jar ??
I tried the code from maven-source-plugin, but there it is not deploying
the jar explicitly to the repository but I am forced to do in in the
code to deploy to repository which is probably making all the
difference...

-----Original Message-----
From: Eric Redmond [mailto:eric.redmond@gmail.com] 
Sent: Tuesday, June 19, 2007 1:46 AM
To: Maven Users List
Subject: Re: 0-Snapshot numbering for classifiers

Sure, I understand the desire to write code rather than learn a
specification like assembly - however, your ability to find support for
a
custom plugin is going to be drastically more difficult than finding
support
for a core plugin.

Just a suggestion, take care;
Eric

On 6/18/07, Alok, Niraj <ni...@gs.com> wrote:
>
> I am more comfortable writing a specific plugin to do this because we
> want to introduce custom tags in the pom and assembly wouldn't allow
us
> to do.
> If it can be done through code, it would be perfect !
>
>
> -----Original Message-----
> From: Eric Redmond [mailto:eric.redmond@gmail.com]
> Sent: Saturday, June 16, 2007 12:10 AM
> To: Maven Users List
> Subject: Re: 0-Snapshot numbering for classifiers
>
> Why are you writing code to do this? You should be installing the
> sources
> via the source plugin:
>
> mvn source:jar
>
> Or assembly plugin:
>
> http://maven.apache.org/plugins/maven-assembly-plugin/usage.html
>
http://maven.apache.org/plugins/maven-assembly-plugin/descriptor-refs.ht
> ml
>
> Eric
>
> On 6/15/07, niraj <ni...@gs.com> wrote:
> >
> >
> > To be more specific, I am installing the app.jar through normal mvn
> deploy
> > and the sources.jar through a custom pojo, as its not sources, but
> some
> > other project files,  and the code for that is:
> >
> >         Artifact artifact =
> > m_artifactFactory.createArtifactWithClassifier(m_groupId,
> >                 m_artifactId, m_version, "jar", jarType);
> >
> >         try {
> >             deployer.deploy(file, artifact,
> >
> m_project.getDistributionManagementArtifactRepository(),
> >                 m_localRepository);
> >         } catch (ArtifactDeploymentException e) {
> >             throw new MojoExecutionException(e.getMessage(), e);
> >         }
> >
> > While downloading, I am just adding the classifier element, jarType
in
> the
> > dependency tag.
> > It works for versioned jars, not for snapshots. I am using mvn 2.
> > --
> > View this message in context:
> >
>
http://www.nabble.com/0-Snapshot-numbering-for-classifiers-tf3927571s177
> .html#a11138790
> > 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
> >
> >
>
>
> --
> Eric Redmond
> http://www.sonatype.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Eric Redmond
http://www.sonatype.com

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


RE: 0-Snapshot numbering for classifiers

Posted by "Alok, Niraj" <ni...@gs.com>.
Im trying to do through code, but the numbering of the jar changes for
snapshot versions, making them unavailable for download. 
Is there some specific piece of code that is required to attach a
classifier jar to the same snapshot version  as the app jar ??
I tried the code from maven-source-plugin, but there it is not deploying
the jar explicitly to the repository but I am forced to do in in the
code to deploy to repository which is probably making all the
difference...

-----Original Message-----
From: Eric Redmond [mailto:eric.redmond@gmail.com] 
Sent: Tuesday, June 19, 2007 1:46 AM
To: Maven Users List
Subject: Re: 0-Snapshot numbering for classifiers

Sure, I understand the desire to write code rather than learn a
specification like assembly - however, your ability to find support for
a
custom plugin is going to be drastically more difficult than finding
support
for a core plugin.

Just a suggestion, take care;
Eric

On 6/18/07, Alok, Niraj <ni...@gs.com> wrote:
>
> I am more comfortable writing a specific plugin to do this because we
> want to introduce custom tags in the pom and assembly wouldn't allow
us
> to do.
> If it can be done through code, it would be perfect !
>
>
> -----Original Message-----
> From: Eric Redmond [mailto:eric.redmond@gmail.com]
> Sent: Saturday, June 16, 2007 12:10 AM
> To: Maven Users List
> Subject: Re: 0-Snapshot numbering for classifiers
>
> Why are you writing code to do this? You should be installing the
> sources
> via the source plugin:
>
> mvn source:jar
>
> Or assembly plugin:
>
> http://maven.apache.org/plugins/maven-assembly-plugin/usage.html
>
http://maven.apache.org/plugins/maven-assembly-plugin/descriptor-refs.ht
> ml
>
> Eric
>
> On 6/15/07, niraj <ni...@gs.com> wrote:
> >
> >
> > To be more specific, I am installing the app.jar through normal mvn
> deploy
> > and the sources.jar through a custom pojo, as its not sources, but
> some
> > other project files,  and the code for that is:
> >
> >         Artifact artifact =
> > m_artifactFactory.createArtifactWithClassifier(m_groupId,
> >                 m_artifactId, m_version, "jar", jarType);
> >
> >         try {
> >             deployer.deploy(file, artifact,
> >
> m_project.getDistributionManagementArtifactRepository(),
> >                 m_localRepository);
> >         } catch (ArtifactDeploymentException e) {
> >             throw new MojoExecutionException(e.getMessage(), e);
> >         }
> >
> > While downloading, I am just adding the classifier element, jarType
in
> the
> > dependency tag.
> > It works for versioned jars, not for snapshots. I am using mvn 2.
> > --
> > View this message in context:
> >
>
http://www.nabble.com/0-Snapshot-numbering-for-classifiers-tf3927571s177
> .html#a11138790
> > 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
> >
> >
>
>
> --
> Eric Redmond
> http://www.sonatype.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Eric Redmond
http://www.sonatype.com

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


Re: 0-Snapshot numbering for classifiers

Posted by Eric Redmond <er...@gmail.com>.
Sure, I understand the desire to write code rather than learn a
specification like assembly - however, your ability to find support for a
custom plugin is going to be drastically more difficult than finding support
for a core plugin.

Just a suggestion, take care;
Eric

On 6/18/07, Alok, Niraj <ni...@gs.com> wrote:
>
> I am more comfortable writing a specific plugin to do this because we
> want to introduce custom tags in the pom and assembly wouldn't allow us
> to do.
> If it can be done through code, it would be perfect !
>
>
> -----Original Message-----
> From: Eric Redmond [mailto:eric.redmond@gmail.com]
> Sent: Saturday, June 16, 2007 12:10 AM
> To: Maven Users List
> Subject: Re: 0-Snapshot numbering for classifiers
>
> Why are you writing code to do this? You should be installing the
> sources
> via the source plugin:
>
> mvn source:jar
>
> Or assembly plugin:
>
> http://maven.apache.org/plugins/maven-assembly-plugin/usage.html
> http://maven.apache.org/plugins/maven-assembly-plugin/descriptor-refs.ht
> ml
>
> Eric
>
> On 6/15/07, niraj <ni...@gs.com> wrote:
> >
> >
> > To be more specific, I am installing the app.jar through normal mvn
> deploy
> > and the sources.jar through a custom pojo, as its not sources, but
> some
> > other project files,  and the code for that is:
> >
> >         Artifact artifact =
> > m_artifactFactory.createArtifactWithClassifier(m_groupId,
> >                 m_artifactId, m_version, "jar", jarType);
> >
> >         try {
> >             deployer.deploy(file, artifact,
> >
> m_project.getDistributionManagementArtifactRepository(),
> >                 m_localRepository);
> >         } catch (ArtifactDeploymentException e) {
> >             throw new MojoExecutionException(e.getMessage(), e);
> >         }
> >
> > While downloading, I am just adding the classifier element, jarType in
> the
> > dependency tag.
> > It works for versioned jars, not for snapshots. I am using mvn 2.
> > --
> > View this message in context:
> >
> http://www.nabble.com/0-Snapshot-numbering-for-classifiers-tf3927571s177
> .html#a11138790
> > 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
> >
> >
>
>
> --
> Eric Redmond
> http://www.sonatype.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Eric Redmond
http://www.sonatype.com

RE: 0-Snapshot numbering for classifiers

Posted by "Alok, Niraj" <ni...@gs.com>.
I am more comfortable writing a specific plugin to do this because we
want to introduce custom tags in the pom and assembly wouldn't allow us
to do.
If it can be done through code, it would be perfect !
 

-----Original Message-----
From: Eric Redmond [mailto:eric.redmond@gmail.com] 
Sent: Saturday, June 16, 2007 12:10 AM
To: Maven Users List
Subject: Re: 0-Snapshot numbering for classifiers

Why are you writing code to do this? You should be installing the
sources
via the source plugin:

mvn source:jar

Or assembly plugin:

http://maven.apache.org/plugins/maven-assembly-plugin/usage.html
http://maven.apache.org/plugins/maven-assembly-plugin/descriptor-refs.ht
ml

Eric

On 6/15/07, niraj <ni...@gs.com> wrote:
>
>
> To be more specific, I am installing the app.jar through normal mvn
deploy
> and the sources.jar through a custom pojo, as its not sources, but
some
> other project files,  and the code for that is:
>
>         Artifact artifact =
> m_artifactFactory.createArtifactWithClassifier(m_groupId,
>                 m_artifactId, m_version, "jar", jarType);
>
>         try {
>             deployer.deploy(file, artifact,
>
m_project.getDistributionManagementArtifactRepository(),
>                 m_localRepository);
>         } catch (ArtifactDeploymentException e) {
>             throw new MojoExecutionException(e.getMessage(), e);
>         }
>
> While downloading, I am just adding the classifier element, jarType in
the
> dependency tag.
> It works for versioned jars, not for snapshots. I am using mvn 2.
> --
> View this message in context:
>
http://www.nabble.com/0-Snapshot-numbering-for-classifiers-tf3927571s177
.html#a11138790
> 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
>
>


-- 
Eric Redmond
http://www.sonatype.com

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


RE: 0-Snapshot numbering for classifiers

Posted by "Alok, Niraj" <ni...@gs.com>.
 seems the attachment didn't work..
Pasting the code:

import org.apache.maven.archiver.MavenArchiveConfiguration;
import org.apache.maven.archiver.MavenArchiver;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.deployer.ArtifactDeployer;
import org.apache.maven.artifact.deployer.ArtifactDeploymentException;
import org.apache.maven.artifact.factory.ArtifactFactory;
import
org.apache.maven.artifact.installer.ArtifactInstallationException;
import org.apache.maven.artifact.installer.ArtifactInstaller;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.project.MavenProject;

import org.codehaus.plexus.archiver.jar.JarArchiver;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;


/**
  * @goal installer
 */
public class InstallerMojo extends AbstractMojo {
    /**
     * The Maven Project.
     *
     * @parameter expression="${project}"
     * @required
     * @readonly
     */
    protected MavenProject m_project;

    /**
     * Specify the install prefix
     *
     * @parameter expression="${project.groupId}/${project.artifactId}"
     */
    protected String installPrefix;

    /**
     * Specify the database source
     *
     * @parameter default-value="${basedir}/src/main/database"
     */
    protected String databaseSourceDirectory;

    /**
     * Specify the autosys source
     *
     * @parameter default-value="${basedir}/src/main/autosys"
     */
    protected String autosysSourceDirectory;

    /**
     * Specify the runtime source
     *
     * @parameter default-value="${basedir}/src/main/runtime"
     */
    protected String runtimeSourceDirectory;

    /**
     * Specify the database outpur
     *
     * @parameter default-value="${basedir}/target/database"
     */
    protected String m_databaseOutputDirectory;

    /**
     * Specify the autosys output
     *
     * @parameter default-value="${basedir}/target/autosys"
     */
    protected String m_autosysOutputDirectory;

    /**
     * Specify the runtime output
     *
     * @parameter default-value="${basedir}/target/runtime"
     */
    protected String m_runtimeOutputDirectory;

    /**
     * Name of the generated JAR.
     *
     * @parameter alias="jarName"
expression="${project.build.finalName}"
     */
    private String m_finalName;

    /**
     * The Jar archiver.
     *
     * @parameter
expression="${component.org.codehaus.plexus.archiver.Archiver#jar}"
     * @required
     */
    private JarArchiver m_jarArchiver;

    /**
     * @parameter
expression="${component.org.apache.maven.artifact.factory.ArtifactFactor
y}"
     * @required
     * @readonly
     */
    private ArtifactFactory m_artifactFactory;

    /**
     * @parameter
expression="${component.org.apache.maven.artifact.installer.ArtifactInst
aller}"
     * @readonly
     */
    protected ArtifactInstaller m_installer;

    /**
      * @parameter
expression="${component.org.apache.maven.artifact.deployer.ArtifactDeplo
yer}"
      * @required
      * @readonly
      */
    private ArtifactDeployer deployer;

    /**
      * Mode in which the packager is run, either hdev or hpackage
      *
      * @parameter   expression="${mode}"
      */
    protected String m_mode;

    /**
     * @parameter expression="${localRepository}"
     * @readonly
     */
    protected ArtifactRepository m_localRepository;
    protected String m_groupId;
    protected String m_artifactId;
    protected String m_version;
    protected String m_type;

    /**
     * method called upon execution of the plugin
     *
     * @throws MojoExecutionException
     * @throws MojoFailureException
     */
    public void execute() throws MojoExecutionException,
MojoFailureException {
        //Setup
        init();

        // Install the db related artifacts
        installFile(databaseSourceDirectory, m_databaseOutputDirectory,
"db");

    }

    // Initialize the params
    protected void init() {
        m_groupId = m_project.getGroupId();
        m_artifactId = m_project.getArtifactId();
        m_version = m_project.getVersion();
        m_type = m_project.getPackaging();
        installPrefix = installPrefix.replace('.', File.separatorChar);
    }

    /**
     * Installs the jar file in the repository for the artifacts present
in source.
     * The jar is appended with the jarType.
     *
     * @param source
     * @param destination
     * @param jarType
     * @throws MojoExecutionException
     */
    public void installFile(String source, String destination, String
jarType)
        throws MojoExecutionException {
        if (!new File(source).exists()) {
            return;
        }

        //Copy artifacts from source to destination
        getLog().info("Copying files from :" + source + " to " +
destination +
            File.separatorChar + installPrefix);

        try {
            copyFiles(source, destination + File.separatorChar +
installPrefix);
            getLog().info("Copy completed");
        } catch (IOException e) {
            throw new MojoExecutionException("Error copying files from "
+
                source + " to " + destination + e.getMessage(), e);
        }

            //Deploy the jar archive
            deploy(createArchive(destination, jarType), jarType);
     }

    private void deploy(File file, String jarType)
        throws MojoExecutionException {
        if (!file.exists()) {
            throw new MojoExecutionException(file.getPath() + " not
found.");
        }

        // Create the artifact
        Artifact artifact =
m_artifactFactory.createArtifactWithClassifier(m_groupId,
                m_artifactId, m_version, "jar", jarType);

        try {
            deployer.deploy(file, artifact,
                m_project.getDistributionManagementArtifactRepository(),
                m_localRepository);
        } catch (ArtifactDeploymentException e) {
            throw new MojoExecutionException(e.getMessage(), e);
        }
    }

    /**
     * Copy files from strPath to dstPath
     *
     * @param strPath
     * @param dstPath
     * @throws IOException
     */
    protected void copyFiles(String strPath, String dstPath)
        throws IOException {
        File src = new File(strPath);
        File dest = new File(dstPath);

        if (!src.getName().equals("CVS")) {
            if (src.isDirectory()) {
                if (!dest.exists()) {
                    dest.mkdirs();
                }

                String[] list = src.list();

                for (int i = 0; i < list.length; i++) {
                    String dest1 = dest.getAbsolutePath() +
File.separatorChar +
                        list[i];
                    String src1 = src.getAbsolutePath() +
File.separatorChar +
                        list[i];
                    copyFiles(src1, dest1);
                }
            } else {
                FileInputStream fin = new FileInputStream(src);
                FileOutputStream fout = new FileOutputStream(dest);
                int c;

                while ((c = fin.read()) >= 0)
                    fout.write(c);

                fin.close();
                fout.close();
            }
        }
    }

    /**
     * Generates the jar file, by archiving the output directory.
     * The jar is named as groupId.artifactId-version-type.jar
     *
     * @param outputDirectory
     * @param type
     * @return jarfile
     * @throws MojoExecutionException
     */
    protected File createArchive(String outputDirectory, String type)
        throws MojoExecutionException {
        MavenArchiveConfiguration archive = new
MavenArchiveConfiguration();

        if ((m_finalName == null) || m_finalName.equals("")) {
            m_finalName = m_groupId + "." + m_artifactId + "-" +
m_version;
        }

        File targetLocation = new File(outputDirectory);
        File jarFile = new File(targetLocation.getParent(),
                m_finalName + "." + type + ".jar");
        getLog().info("Creating jar file:" + jarFile.getAbsolutePath());

        MavenArchiver archiver = new MavenArchiver();

        archiver.setArchiver(m_jarArchiver);

        archiver.setOutputFile(jarFile);

        try {
            File contentDirectory = new File(outputDirectory);

            if (!contentDirectory.exists()) {
                getLog().warn("JAR will be empty - no content was marked
for inclusion!");
            } else {
                archiver.getArchiver().addDirectory(contentDirectory);
            }

            archiver.createArchive(m_project, archive);

            return jarFile;
        } catch (Exception e) {
            throw new MojoExecutionException("Error assembling JAR", e);
        }
    }
}

-----Original Message-----
From: Alok, Niraj 
Sent: Saturday, June 16, 2007 12:34 AM
To: 'Maven Users List'
Subject: RE: 0-Snapshot numbering for classifiers

I need to write another plugin to do this because the sources here are
not java files, but database files which are stored in cvs. 
The directory structure is src/main/database and we want all the files
inside the database folder to be put in the repository for use in
dependencies by other modules. 

To check if there was a problem with the way I wrote the plugin, I also
included sources plugin in the pom and found that app-sources.jar is
getting generated with the same build number as app.jar, but app-db.jar
is getting installed with one number less. This is alteast pointing me
that there's something wrong in my plugin, but cant figure out exactly
what. 

I am attaching the code here also for help.

Thanks!
Niraj

-----Original Message-----
From: Eric Redmond [mailto:eric.redmond@gmail.com] 
Sent: Saturday, June 16, 2007 12:10 AM
To: Maven Users List
Subject: Re: 0-Snapshot numbering for classifiers

Why are you writing code to do this? You should be installing the
sources
via the source plugin:

mvn source:jar

Or assembly plugin:

http://maven.apache.org/plugins/maven-assembly-plugin/usage.html
http://maven.apache.org/plugins/maven-assembly-plugin/descriptor-refs.ht
ml

Eric

On 6/15/07, niraj <ni...@gs.com> wrote:
>
>
> To be more specific, I am installing the app.jar through normal mvn
deploy
> and the sources.jar through a custom pojo, as its not sources, but
some
> other project files,  and the code for that is:
>
>         Artifact artifact =
> m_artifactFactory.createArtifactWithClassifier(m_groupId,
>                 m_artifactId, m_version, "jar", jarType);
>
>         try {
>             deployer.deploy(file, artifact,
>
m_project.getDistributionManagementArtifactRepository(),
>                 m_localRepository);
>         } catch (ArtifactDeploymentException e) {
>             throw new MojoExecutionException(e.getMessage(), e);
>         }
>
> While downloading, I am just adding the classifier element, jarType in
the
> dependency tag.
> It works for versioned jars, not for snapshots. I am using mvn 2.
> --
> View this message in context:
>
http://www.nabble.com/0-Snapshot-numbering-for-classifiers-tf3927571s177
.html#a11138790
> 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
>
>


-- 
Eric Redmond
http://www.sonatype.com

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


Re: 0-Snapshot numbering for classifiers

Posted by Eric Redmond <er...@gmail.com>.
This is what the assembly plugin is for:

http://sonatype.com/book/assemblies.html
http://maven.apache.org/plugins/maven-assembly-plugin/

Eric

On 6/15/07, Alok, Niraj <ni...@gs.com> wrote:
>
> I need to write another plugin to do this because the sources here are
> not java files, but database files which are stored in cvs.
> The directory structure is src/main/database and we want all the files
> inside the database folder to be put in the repository for use in
> dependencies by other modules.
>
> To check if there was a problem with the way I wrote the plugin, I also
> included sources plugin in the pom and found that app-sources.jar is
> getting generated with the same build number as app.jar, but app-db.jar
> is getting installed with one number less. This is alteast pointing me
> that there's something wrong in my plugin, but cant figure out exactly
> what.
>
> I am attaching the code here also for help.
>
> Thanks!
> Niraj
>
> -----Original Message-----
> From: Eric Redmond [mailto:eric.redmond@gmail.com]
> Sent: Saturday, June 16, 2007 12:10 AM
> To: Maven Users List
> Subject: Re: 0-Snapshot numbering for classifiers
>
> Why are you writing code to do this? You should be installing the
> sources
> via the source plugin:
>
> mvn source:jar
>
> Or assembly plugin:
>
> http://maven.apache.org/plugins/maven-assembly-plugin/usage.html
> http://maven.apache.org/plugins/maven-assembly-plugin/descriptor-refs.ht
> ml
>
> Eric
>
> On 6/15/07, niraj <ni...@gs.com> wrote:
> >
> >
> > To be more specific, I am installing the app.jar through normal mvn
> deploy
> > and the sources.jar through a custom pojo, as its not sources, but
> some
> > other project files,  and the code for that is:
> >
> >         Artifact artifact =
> > m_artifactFactory.createArtifactWithClassifier(m_groupId,
> >                 m_artifactId, m_version, "jar", jarType);
> >
> >         try {
> >             deployer.deploy(file, artifact,
> >
> m_project.getDistributionManagementArtifactRepository(),
> >                 m_localRepository);
> >         } catch (ArtifactDeploymentException e) {
> >             throw new MojoExecutionException(e.getMessage(), e);
> >         }
> >
> > While downloading, I am just adding the classifier element, jarType in
> the
> > dependency tag.
> > It works for versioned jars, not for snapshots. I am using mvn 2.
> > --
> > View this message in context:
> >
> http://www.nabble.com/0-Snapshot-numbering-for-classifiers-tf3927571s177
> .html#a11138790
> > 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
> >
> >
>
>
> --
> Eric Redmond
> http://www.sonatype.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>



-- 
Eric Redmond
http://www.sonatype.com

RE: 0-Snapshot numbering for classifiers

Posted by "Alok, Niraj" <ni...@gs.com>.
I need to write another plugin to do this because the sources here are
not java files, but database files which are stored in cvs. 
The directory structure is src/main/database and we want all the files
inside the database folder to be put in the repository for use in
dependencies by other modules. 

To check if there was a problem with the way I wrote the plugin, I also
included sources plugin in the pom and found that app-sources.jar is
getting generated with the same build number as app.jar, but app-db.jar
is getting installed with one number less. This is alteast pointing me
that there's something wrong in my plugin, but cant figure out exactly
what. 

I am attaching the code here also for help.

Thanks!
Niraj

-----Original Message-----
From: Eric Redmond [mailto:eric.redmond@gmail.com] 
Sent: Saturday, June 16, 2007 12:10 AM
To: Maven Users List
Subject: Re: 0-Snapshot numbering for classifiers

Why are you writing code to do this? You should be installing the
sources
via the source plugin:

mvn source:jar

Or assembly plugin:

http://maven.apache.org/plugins/maven-assembly-plugin/usage.html
http://maven.apache.org/plugins/maven-assembly-plugin/descriptor-refs.ht
ml

Eric

On 6/15/07, niraj <ni...@gs.com> wrote:
>
>
> To be more specific, I am installing the app.jar through normal mvn
deploy
> and the sources.jar through a custom pojo, as its not sources, but
some
> other project files,  and the code for that is:
>
>         Artifact artifact =
> m_artifactFactory.createArtifactWithClassifier(m_groupId,
>                 m_artifactId, m_version, "jar", jarType);
>
>         try {
>             deployer.deploy(file, artifact,
>
m_project.getDistributionManagementArtifactRepository(),
>                 m_localRepository);
>         } catch (ArtifactDeploymentException e) {
>             throw new MojoExecutionException(e.getMessage(), e);
>         }
>
> While downloading, I am just adding the classifier element, jarType in
the
> dependency tag.
> It works for versioned jars, not for snapshots. I am using mvn 2.
> --
> View this message in context:
>
http://www.nabble.com/0-Snapshot-numbering-for-classifiers-tf3927571s177
.html#a11138790
> 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
>
>


-- 
Eric Redmond
http://www.sonatype.com


Re: 0-Snapshot numbering for classifiers

Posted by Eric Redmond <er...@gmail.com>.
Why are you writing code to do this? You should be installing the sources
via the source plugin:

mvn source:jar

Or assembly plugin:

http://maven.apache.org/plugins/maven-assembly-plugin/usage.html
http://maven.apache.org/plugins/maven-assembly-plugin/descriptor-refs.html

Eric

On 6/15/07, niraj <ni...@gs.com> wrote:
>
>
> To be more specific, I am installing the app.jar through normal mvn deploy
> and the sources.jar through a custom pojo, as its not sources, but some
> other project files,  and the code for that is:
>
>         Artifact artifact =
> m_artifactFactory.createArtifactWithClassifier(m_groupId,
>                 m_artifactId, m_version, "jar", jarType);
>
>         try {
>             deployer.deploy(file, artifact,
>                 m_project.getDistributionManagementArtifactRepository(),
>                 m_localRepository);
>         } catch (ArtifactDeploymentException e) {
>             throw new MojoExecutionException(e.getMessage(), e);
>         }
>
> While downloading, I am just adding the classifier element, jarType in the
> dependency tag.
> It works for versioned jars, not for snapshots. I am using mvn 2.
> --
> View this message in context:
> http://www.nabble.com/0-Snapshot-numbering-for-classifiers-tf3927571s177.html#a11138790
> 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
>
>


-- 
Eric Redmond
http://www.sonatype.com

Re: 0-Snapshot numbering for classifiers

Posted by niraj <ni...@gs.com>.
To be more specific, I am installing the app.jar through normal mvn deploy
and the sources.jar through a custom pojo, as its not sources, but some
other project files,  and the code for that is:

        Artifact artifact =
m_artifactFactory.createArtifactWithClassifier(m_groupId,
                m_artifactId, m_version, "jar", jarType);

        try {
            deployer.deploy(file, artifact,
                m_project.getDistributionManagementArtifactRepository(),
                m_localRepository);
        } catch (ArtifactDeploymentException e) {
            throw new MojoExecutionException(e.getMessage(), e);
        }

While downloading, I am just adding the classifier element, jarType in the
dependency tag. 
It works for versioned jars, not for snapshots. I am using mvn 2. 
-- 
View this message in context: http://www.nabble.com/0-Snapshot-numbering-for-classifiers-tf3927571s177.html#a11138790
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