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/02 07:02:34 UTC

how does Maven determine which version to download for a plugin when no version specified

Using Maven 3 beta 1...

I have the following XML snippet in my pom.xml:


        
            env-dev
            
                true
            
            
                
                    
                         
			        maven-antrun-plugin
			        
			        
			          
			            echodir
			            
			              run
			            
			            verify
			            false
			            
			              
			                Build Dir: ${project.build.directory}
			              
			            
			          
			        
			
		       
                  ....


Note that the version tag is commented out.  The version that was downloaded
by Maven was from this URL:
https://repository.jboss.org/nexus/content/groups/public/org/apache/maven/plugins/maven-antrun-plugin/

and specifically it used version 1.3: 

Downloading:
https://repository.jboss.org/nexus/content/groups/public/org/apache/maven/plugins/maven-antrun-plugin/1.3/maven-antrun-plugin-1.3.jar

How does Maven know which version to download when the version is not
specified?  thx.

BTW, I have the following in my settings.xml:


      		
	      
	            jboss-public-repository
	            
	              
	                jboss-public-repository-group
	                JBoss Public Maven Repository Group
	                https://repository.jboss.org/nexus/content/groups/public/
	                default
	                
	                  true
	                  never
	                
	                
	                  true
	                  never
	                
	              
	            
	            
	              
	                jboss-public-repository-group
	                JBoss Public Maven Repository Group
	                https://repository.jboss.org/nexus/content/groups/public/
	                default
	                
	                  true
	                  never
	                
	                
	                  true
	                  never
	                
	              
	            
    		
           
      
      
          jboss-public-repository
      
-- 
View this message in context: http://maven.40175.n5.nabble.com/how-does-Maven-determine-which-version-to-download-for-a-plugin-when-no-version-specified-tp512519p512519.html
Sent from the Maven - Users mailing list archive at Nabble.com.

Re: how does Maven determine which version to download for a plugin when no version specified

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

Anders Hammar wrote:
> 
> I don't know. If i recall correctly, the help:describe mojo by default
> works
> on the latest version of the plugin being described, when  I use it with
> Maven-3.0-beta1. I could be wrong, but that's how I recall tings. So, I
> always specify the version [1] when I use help:describe. That way I have
> full control of what version of the plugin that will be described. This is
> important I think, as there are differences between version of a plugin
> and
> I want to be sure to get the info of the version I'm working with.
> 
> /Anders
> 
> 

I switched from 2.0.8 to 3.0-BETA1 and it used 2.2 again (I have 2.2 and 2.3
in my local repo).  So the behavior is consistent with 2.0 and 3.0...

C:\>mvn --version
Apache Maven 3.0-beta-1 (r935667; 2010-04-19 10:00:39-0700)
Java version: 1.5.0_22
Java home: C:\Program Files\Java\jdk1.5.0_22\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"
C:\>mvn help:describe -DgroupId=org.apache.maven.plugins
-DartifactId=maven-inst
all-plugin -Dmedium=true
[INFO] Scanning for projects...
[INFO]
[INFO]
------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO]
------------------------------------------------------------------------
[INFO]
[INFO] --- maven-help-plugin:2.0.2:describe (default-cli) @ standalone-pom
---
Downloading:
http://repo1.maven.org/maven2/doxia/doxia-sink-api/1.0-alpha-4/doxi
a-sink-api-1.0-alpha-4.jar
Downloading:
http://repo1.maven.org/maven2/org/apache/maven/wagon/wagon-file/1.0
-alpha-5/wagon-file-1.0-alpha-5.jar
Downloading:
http://repo1.maven.org/maven2/org/apache/maven/reporting/maven-repo
rting-api/2.0/maven-reporting-api-2.0.jar
Downloading:
http://repo1.maven.org/maven2/org/apache/maven/wagon/wagon-http-lig
htweight/1.0-alpha-5/wagon-http-lightweight-1.0-alpha-5.jar
Downloaded:
http://repo1.maven.org/maven2/org/apache/maven/wagon/wagon-http-ligh
tweight/1.0-alpha-5/wagon-http-lightweight-1.0-alpha-5.jar (8 KB at 26.6
KB/sec)

Downloaded:
http://repo1.maven.org/maven2/doxia/doxia-sink-api/1.0-alpha-4/doxia
-sink-api-1.0-alpha-4.jar (5 KB at 3.3 KB/sec)
Downloaded:
http://repo1.maven.org/maven2/org/apache/maven/wagon/wagon-file/1.0-
alpha-5/wagon-file-1.0-alpha-5.jar (6 KB at 2.5 KB/sec)
Downloaded:
http://repo1.maven.org/maven2/org/apache/maven/reporting/maven-repor
ting-api/2.0/maven-reporting-api-2.0.jar (7 KB at 2.0 KB/sec)
[INFO] Plugin: 'org.apache.maven.plugins:maven-install-plugin:2.2'
-----------------------------------------------
Group Id:  org.apache.maven.plugins
Artifact Id: maven-install-plugin
Version:     2.2
Goal Prefix: install
Description:

Maven Plugins

Mojos:

Goal: 'install-file'
Description:
Installs a file in local repository.

Goal: 'install'
Description:
Installs project's main artifact in local repository.

[INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 4.875s
[INFO] Finished at: Wed Jul 07 10:01:56 PDT 2010
[INFO] Final Memory: 3M/6M
[INFO]
------------------------------------------------------------------------

-- 
View this message in context: http://maven.40175.n5.nabble.com/how-does-Maven-determine-which-version-to-download-for-a-plugin-when-no-version-specified-tp512519p1044789.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: how does Maven determine which version to download for a plugin when no version specified

Posted by Anders Hammar <an...@hammar.net>.
I don't know. If i recall correctly, the help:describe mojo by default works
on the latest version of the plugin being described, when  I use it with
Maven-3.0-beta1. I could be wrong, but that's how I recall tings. So, I
always specify the version [1] when I use help:describe. That way I have
full control of what version of the plugin that will be described. This is
important I think, as there are differences between version of a plugin and
I want to be sure to get the info of the version I'm working with.

/Anders

[1]
http://maven.apache.org/plugins/maven-help-plugin/describe-mojo.html#version

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

>
>
> When you don't specify the version of a plugin, Maven should download the
> latest version. However, very often the version is defined through a
> pluginManagement section. This could be either in your pom hierarchy or in
> Maven's super-POM. In your case, the version of the antrun-plugin is
> defined
> in the super-POM of Maven 3.0-beta-1.
>
> /Anders
>
> using maven 2.0.8, when i don't specify the version, it uses 2.2 when I run
> this cmd:
>
> C:\projects\clean\com.echo.cis.gui\com.echo.cis.gui.ear>mvn help:describe
> -DgroupId=org.apache.maven.plugins -DartifactId=maven-install-plugin
> -Dmedium=true
>
> I have two versions in my local m2 repo:
>
> C:\Documents and
>
> Settings\asookazian\.m2\repo2\org\apache\maven\plugins\maven-install-plugin\2.2
> C:\Documents and
>
> Settings\asookazian\.m2\repo2\org\apache\maven\plugins\maven-install-plugin\2.3
>
> The pom-4.0.0.xml (the super POM i'm assuming) does not specify the version
> of the maven-install-plugin (there is no reference to maven-install-plugin
> at all).
>
> So how does Maven know to use 2.2 in this case?
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/how-does-Maven-determine-which-version-to-download-for-a-plugin-when-no-version-specified-tp512519p1044765.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: how does Maven determine which version to download for a plugin when no version specified

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

When you don't specify the version of a plugin, Maven should download the
latest version. However, very often the version is defined through a
pluginManagement section. This could be either in your pom hierarchy or in
Maven's super-POM. In your case, the version of the antrun-plugin is defined
in the super-POM of Maven 3.0-beta-1.

/Anders

using maven 2.0.8, when i don't specify the version, it uses 2.2 when I run
this cmd:

C:\projects\clean\com.echo.cis.gui\com.echo.cis.gui.ear>mvn help:describe
-DgroupId=org.apache.maven.plugins -DartifactId=maven-install-plugin
-Dmedium=true

I have two versions in my local m2 repo:

C:\Documents and
Settings\asookazian\.m2\repo2\org\apache\maven\plugins\maven-install-plugin\2.2
C:\Documents and
Settings\asookazian\.m2\repo2\org\apache\maven\plugins\maven-install-plugin\2.3

The pom-4.0.0.xml (the super POM i'm assuming) does not specify the version
of the maven-install-plugin (there is no reference to maven-install-plugin
at all).

So how does Maven know to use 2.2 in this case?
-- 
View this message in context: http://maven.40175.n5.nabble.com/how-does-Maven-determine-which-version-to-download-for-a-plugin-when-no-version-specified-tp512519p1044765.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: how does Maven determine which version to download for a plugin when no version specified

Posted by asookazian <as...@gmail.com>.
answer here:
http://www.sonatype.com/books/mvnref-book/reference/resource-filtering-sect-properties.html
-- 
View this message in context: http://maven.40175.n5.nabble.com/how-does-Maven-determine-which-version-to-download-for-a-plugin-when-no-version-specified-tp512519p512544.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: how does Maven determine which version to download for a plugin when no version specified

Posted by asookazian <as...@gmail.com>.
Where are the variables (properties?) defined?

e.g. <finalName>${project.artifactId}-${project.version}</finalName> 
-- 
View this message in context: http://maven.40175.n5.nabble.com/how-does-Maven-determine-which-version-to-download-for-a-plugin-when-no-version-specified-tp512519p512543.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: how does Maven determine which version to download for a plugin when no version specified

Posted by Anders Hammar <an...@hammar.net>.
This svn path should help you figure that out:
http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-model-builder/src/main/resources/org/apache/maven/model/pom-4.0.0.xml?view=markup

/Anders

On Fri, Jul 2, 2010 at 07:33, asookazian <as...@gmail.com> wrote:

>
> Thanks!
>
> I was able to locate the following relevant XML snippet in pom-4.0.0.xml
> for
> Maven 2.2.1 in the maven-2.2.1-uber.jar:
>
> <plugin>
>           <artifactId>maven-antrun-plugin</artifactId>
>            <version>1.3</version>
>         </plugin>
>
> For Maven 3 beta 1 there is no *uber.jar (it's modularized like Seam 3 and
> Spring 3).
>
> Where is the equivalent to pom-4.0.0.xml located in Maven 3 JAR?  i.e.
> which
> JAR and what path and filename?  thx.
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/how-does-Maven-determine-which-version-to-download-for-a-plugin-when-no-version-specified-tp512519p512527.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: how does Maven determine which version to download for a plugin when no version specified

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

I was able to locate the following relevant XML snippet in pom-4.0.0.xml for
Maven 2.2.1 in the maven-2.2.1-uber.jar:

<plugin>
           <artifactId>maven-antrun-plugin</artifactId>
           <version>1.3</version>
         </plugin> 

For Maven 3 beta 1 there is no *uber.jar (it's modularized like Seam 3 and
Spring 3).

Where is the equivalent to pom-4.0.0.xml located in Maven 3 JAR?  i.e. which
JAR and what path and filename?  thx.
-- 
View this message in context: http://maven.40175.n5.nabble.com/how-does-Maven-determine-which-version-to-download-for-a-plugin-when-no-version-specified-tp512519p512527.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: how does Maven determine which version to download for a plugin when no version specified

Posted by Anders Hammar <an...@hammar.net>.
When you don't specify the version of a plugin, Maven should download the
latest version. However, very often the version is defined through a
pluginManagement section. This could be either in your pom hierarchy or in
Maven's super-POM. In your case, the version of the antrun-plugin is defined
in the super-POM of Maven 3.0-beta-1.

/Anders

On Fri, Jul 2, 2010 at 07:03, asookazian <as...@gmail.com> wrote:

>
> Using Maven 3 beta 1...
>
> I have the following XML snippet in my pom.xml:
>
> <profiles>
>        <profile>
>            <id>env-dev</id>
>            <activation>
>                <activeByDefault>true</activeByDefault>
>            </activation>
>            <build>
>                <pluginManagement>
>                    <plugins>
>                         <plugin>
>                                <artifactId>maven-antrun-plugin</artifactId>
>                                <!-- <version>1.4</version> -->
>                                <executions>
>                                  <execution>
>                                    <id>echodir</id>
>                                    <goals>
>                                      <goal>run</goal>
>                                    </goals>
>                                    <phase>verify</phase>
>                                    <inherited>false</inherited>
>                                    <configuration>
>                                      <tasks>
>                                        <echo>Build Dir:
> ${project.build.directory}</echo>
>                                      </tasks>
>                                    </configuration>
>                                  </execution>
>                                </executions>
>
>                       </plugin>
>                  ....
> </profiles>
>
> Note that the version tag is commented out.  The version that was
> downloaded
> by Maven was from this URL:
>
> https://repository.jboss.org/nexus/content/groups/public/org/apache/maven/plugins/maven-antrun-plugin/
>
> and specifically it used version 1.3:
>
> Downloading:
>
> https://repository.jboss.org/nexus/content/groups/public/org/apache/maven/plugins/maven-antrun-plugin/1.3/maven-antrun-plugin-1.3.jar
>
> How does Maven know which version to download when the version is not
> specified?  thx.
>
> BTW, I have the following in my settings.xml:
>
> <profiles>
>
>              <profile>
>                    <id>jboss-public-repository</id>
>                    <repositories>
>                      <repository>
>                        <id>jboss-public-repository-group</id>
>                        <name>JBoss Public Maven Repository Group</name>
>
> <url>https://repository.jboss.org/nexus/content/groups/public/</url>
>                        <layout>default</layout>
>                        <releases>
>                          <enabled>true</enabled>
>                          <updatePolicy>never</updatePolicy>
>                        </releases>
>                        <snapshots>
>                          <enabled>true</enabled>
>                          <updatePolicy>never</updatePolicy>
>                        </snapshots>
>                      </repository>
>                    </repositories>
>                    <pluginRepositories>
>                      <pluginRepository>
>                        <id>jboss-public-repository-group</id>
>                        <name>JBoss Public Maven Repository Group</name>
>
> <url>https://repository.jboss.org/nexus/content/groups/public/</url>
>                        <layout>default</layout>
>                        <releases>
>                          <enabled>true</enabled>
>                          <updatePolicy>never</updatePolicy>
>                        </releases>
>                        <snapshots>
>                          <enabled>true</enabled>
>                          <updatePolicy>never</updatePolicy>
>                        </snapshots>
>                      </pluginRepository>
>                    </pluginRepositories>
>                </profile>
>      </profiles>
>
>      <activeProfiles>
>          <activeProfile>jboss-public-repository</activeProfile>
>      </activeProfiles>
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/how-does-Maven-determine-which-version-to-download-for-a-plugin-when-no-version-specified-tp512519p512520.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: how does Maven determine which version to download for a plugin when no version specified

Posted by asookazian <as...@gmail.com>.
Using Maven 3 beta 1...

I have the following XML snippet in my pom.xml:

<profiles>
        <profile>
            <id>env-dev</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <build>
                <pluginManagement>
                    <plugins>
                         <plugin>
			        <artifactId>maven-antrun-plugin</artifactId>
			        <!-- <version>1.4</version> -->
			        <executions>
			          <execution>
			            <id>echodir</id>
			            <goals>
			              <goal>run</goal>
			            </goals>
			            <phase>verify</phase>
			            <inherited>false</inherited>
			            <configuration>
			              <tasks>
			                <echo>Build Dir: ${project.build.directory}</echo>
			              </tasks>
			            </configuration>
			          </execution>
			        </executions>
			
		       </plugin>
                  ....
</profiles>

Note that the version tag is commented out.  The version that was downloaded
by Maven was from this URL:
https://repository.jboss.org/nexus/content/groups/public/org/apache/maven/plugins/maven-antrun-plugin/

and specifically it used version 1.3: 

Downloading:
https://repository.jboss.org/nexus/content/groups/public/org/apache/maven/plugins/maven-antrun-plugin/1.3/maven-antrun-plugin-1.3.jar

How does Maven know which version to download when the version is not
specified?  thx.

BTW, I have the following in my settings.xml:

<profiles>
      		
	      <profile>
	            <id>jboss-public-repository</id>
	            <repositories>
	              <repository>
	                <id>jboss-public-repository-group</id>
	                <name>JBoss Public Maven Repository Group</name>
	               
<url>https://repository.jboss.org/nexus/content/groups/public/</url>
	                <layout>default</layout>
	                <releases>
	                  <enabled>true</enabled>
	                  <updatePolicy>never</updatePolicy>
	                </releases>
	                <snapshots>
	                  <enabled>true</enabled>
	                  <updatePolicy>never</updatePolicy>
	                </snapshots>
	              </repository>
	            </repositories>
	            <pluginRepositories>
	              <pluginRepository>
	                <id>jboss-public-repository-group</id>
	                <name>JBoss Public Maven Repository Group</name>
	               
<url>https://repository.jboss.org/nexus/content/groups/public/</url>
	                <layout>default</layout>
	                <releases>
	                  <enabled>true</enabled>
	                  <updatePolicy>never</updatePolicy>
	                </releases>
	                <snapshots>
	                  <enabled>true</enabled>
	                  <updatePolicy>never</updatePolicy>
	                </snapshots>
	              </pluginRepository>
	            </pluginRepositories>
    		</profile>
      </profiles>     
      
      <activeProfiles>
          <activeProfile>jboss-public-repository</activeProfile>
      </activeProfiles>
-- 
View this message in context: http://maven.40175.n5.nabble.com/how-does-Maven-determine-which-version-to-download-for-a-plugin-when-no-version-specified-tp512519p512520.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