You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by asookazian <as...@gmail.com> on 2010/07/07 19:37:39 UTC

which version of a plugin will Maven use?

So I just ran 'mvn archetype:generate' and it's not finding that goal.  So I
download version 2.0-alpha5 from here:
http://mvnrepository.com/artifact/org.apache.maven.plugins/maven-archetype-plugin/2.0-alpha-5
by simply adding the following POM snippet in a pom.xml and running 'mvn
clean install'.

<dependency>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-archetype-plugin</artifactId>
    <version>2.0-alpha-5</version>
</dependency>

Now when I run this cmd: 

C:\Documents and Settings\asookazian\My
Documents\ubuntu_projects.tar\projects>m
vn help:describe -DgroupId=org.apache.maven.plugins
-DartifactId=maven-archetype
-plugin -Dversion=2.0-alpha-5 -Dmedium=true

the generate goal is listed.

But when I run 'mvn archetype:generate' again, it can't find the generate
goal.  This means Maven is using a different version of the plugin in my
local repo (I have three).

How does Maven know which version to use when you exec 'mvn
archetype:generate' or any other goal for a plugin?

I would imagine it should be the latest version.  How would I change which
version I want it to use when I issue the cmd?  thx.
-- 
View this message in context: http://maven.40175.n5.nabble.com/which-version-of-a-plugin-will-Maven-use-tp1044797p1044797.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: which version of a plugin will Maven use?

Posted by Wayne Fay <wa...@gmail.com>.
> 1) It's possible to exec 'mvn archetype:generate' in a directory that does
> not have a pom.xml in it (I just did this).  In this case, the

If you care about what version of a plugin is being used, you MUST
specify it explicitly. Otherwise you must be willing to accept
non-deterministic results.

Wayne

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


Re: which version of a plugin will Maven use?

Posted by Anders Hammar <an...@hammar.net>.
1) the super-POM still applies.

2) Right. There is one for each repo. Maven will merge these, but also check
the remote repos. Don't bother with this, I just mentioned it as there could
be cases where Maven isn't pulling the latest due to incorrect meta data.

/Anders

On Wed, Jul 7, 2010 at 21:57, asookazian <as...@gmail.com> wrote:

>
>
> Anders Hammar wrote:
> >
> > I already explained this. If the version is not defined/locked through
> > pluginManagement, Maven selects the latest version (by looking in the
> > maven-metadata.xml file in the repos, so if the metadat is incorrect, it
> > might not get the actual latest version). The pluginManagement section
> > could
> > either be in your project (pom), in a parent pom, or in the super-POM.
> Use
> > help:effective-pom to see the effective pom in use.
> > But, as I said, I've already explained this for you.
> >
> > /Anders
> >
> >
>
> 1) It's possible to exec 'mvn archetype:generate' in a directory that does
> not have a pom.xml in it (I just did this).  In this case, the
> pluginManagement, etc. is irrelevant (why should you need a POM to create a
> new project based on a template?)
>
> 2) There are many maven-metadata*.xml files in
> .m2\repo2\org\apache\maven\plugins\maven-archetype-plugin directory.  Which
> one does Maven use?
>
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/which-version-of-a-plugin-will-Maven-use-tp1044797p1044824.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: which version of a plugin will Maven use?

Posted by asookazian <as...@gmail.com>.

Anders Hammar wrote:
> 
> I already explained this. If the version is not defined/locked through
> pluginManagement, Maven selects the latest version (by looking in the
> maven-metadata.xml file in the repos, so if the metadat is incorrect, it
> might not get the actual latest version). The pluginManagement section
> could
> either be in your project (pom), in a parent pom, or in the super-POM. Use
> help:effective-pom to see the effective pom in use.
> But, as I said, I've already explained this for you.
> 
> /Anders
> 
> 

1) It's possible to exec 'mvn archetype:generate' in a directory that does
not have a pom.xml in it (I just did this).  In this case, the
pluginManagement, etc. is irrelevant (why should you need a POM to create a
new project based on a template?)

2) There are many maven-metadata*.xml files in
.m2\repo2\org\apache\maven\plugins\maven-archetype-plugin directory.  Which
one does Maven use?

-- 
View this message in context: http://maven.40175.n5.nabble.com/which-version-of-a-plugin-will-Maven-use-tp1044797p1044824.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: which version of a plugin will Maven use?

Posted by Anders Hammar <an...@hammar.net>.
I already explained this. If the version is not defined/locked through
pluginManagement, Maven selects the latest version (by looking in the
maven-metadata.xml file in the repos, so if the metadat is incorrect, it
might not get the actual latest version). The pluginManagement section could
either be in your project (pom), in a parent pom, or in the super-POM. Use
help:effective-pom to see the effective pom in use.
But, as I said, I've already explained this for you.

/Anders

On Wed, Jul 7, 2010 at 19:45, asookazian <as...@gmail.com> wrote:

>
> well, I answered one of my questions:
>
> mvn org.apache.maven.plugins:maven-archetype-plugin:2.0-alpha-5:generate
>
> which worked.
>
> So I'm using mvn 2.0.8, but I believe the algorithm it uses to select the
> plugin version (when not explicitly specified) may be the same with 3.0...
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/which-version-of-a-plugin-will-Maven-use-tp1044797p1044799.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: which version of a plugin will Maven use?

Posted by asookazian <as...@gmail.com>.
well, I answered one of my questions:

mvn org.apache.maven.plugins:maven-archetype-plugin:2.0-alpha-5:generate

which worked.

So I'm using mvn 2.0.8, but I believe the algorithm it uses to select the
plugin version (when not explicitly specified) may be the same with 3.0...
-- 
View this message in context: http://maven.40175.n5.nabble.com/which-version-of-a-plugin-will-Maven-use-tp1044797p1044799.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