You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Derek Clarkson (JIRA)" <ji...@codehaus.org> on 2008/12/01 13:13:19 UTC

[jira] Created: (MNG-3881) Properties in plugin poms are not resolved.

Properties in plugin poms are not resolved.
-------------------------------------------

                 Key: MNG-3881
                 URL: http://jira.codehaus.org/browse/MNG-3881
             Project: Maven 2
          Issue Type: Bug
          Components: Plugins and Lifecycle
    Affects Versions: 2.1.0-M1
         Environment: Mac ox s
            Reporter: Derek Clarkson


I'm testing a plugin I have written to run JUnit 4.x tests. The pom for this plug uses properties to specify the versions of dependencies. ie. 

		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>${junit.version}</version>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
			<version>${slf4j.version}</version>
		</dependency>

After compiling and installing the plugin into my local repository, I then attempt to use in in another project. The project compiles correcly, but then fails when attempting to resolve the dependecies of my plugin. The faiures appear to be the plugins dependencies which are versioned by properties. HEre's an example:

6) org.slf4j:slf4j-api:jar:${slf4j.version}

  Try downloading the file manually from the project website.

  Then, install it using the command: 
      mvn install:install-file -DgroupId=org.slf4j -DartifactId=slf4j-api -Dversion=${slf4j.version} -Dpackaging=jar -Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the file there: 
      mvn deploy:deploy-file -DgroupId=org.slf4j -DartifactId=slf4j-api -Dversion=${slf4j.version} -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

  Path to dependency: 
  	1) dhc.maven2:maven-junit4x-plugin:maven-plugin:0.0.3-SNAPSHOT
  	2) org.slf4j:slf4j-api:jar:${slf4j.version}

I also see stack traces like this:

Caused by: java.io.FileNotFoundException: http://repo1.maven.org/maven2/org/apache/maven/reporting/maven-reporting-impl/${maven.reporting.version}/maven-reporting-impl-${maven.reporting.version}.jar
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1239)
	at org.apache.maven.wagon.providers.http.LightweightHttpWagon.fillInputData(LightweightHttpWagon.java:83)
	... 35 more
[DEBUG] Unable to download the artifact from any repository

And ....

7 required artifacts are missing.

for artifact: 
  dhc.maven2:maven-junit4x-plugin:maven-plugin:0.0.3-SNAPSHOT

from the specified remote repositories:
  central (http://repo1.maven.org/maven2)

	at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTransitively(DefaultArtifactResolver.java:482)
	at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTransitively(DefaultArtifactResolver.java:394)
	at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTransitively(DefaultArtifactResolver.java:337)
	at org.apache.maven.plugin.DefaultPluginManager.getPluginArtifacts(DefaultPluginManager.java:436)
	at org.apache.maven.plugin.DefaultPluginManager.addPlugin(DefaultPluginManager.java:279)
	at org.apache.maven.plugin.DefaultPluginManager.verifyVersionedPlugin(DefaultPluginManager.java:211)
	at org.apache.maven.plugin.DefaultPluginManager.verifyPlugin(DefaultPluginManager.java:186)
	at org.apache.maven.plugin.loader.DefaultPluginLoader.loadPlugin(DefaultPluginLoader.java:79)
	... 20 more

Plaing around with this I found that if I go into the repository and edit the pom file to specify the dependency version then that dependency resolves. 

>From this I'm inclined to think that when resolving dependencies of plugins, that the plugin's pom is not being processed to look for properties to be inserted.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MNG-3881) Properties in plugin poms are not resolved.

Posted by "Anders Kr. Andersen (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-3881?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=156860#action_156860 ] 

Anders Kr. Andersen commented on MNG-3881:
------------------------------------------

Hi

I have seen the same thing on 2.0.9

I belive you want to specify the actual version of ${junit.version} in the project pom.xml that uses the plugin.

This will not work. In my case I wanted to specify ${WL_HOME} from i.e. property in settings.xml

The plugin does not read that.

A solution can be to add the dependencies as plugin dependencies in the project pom.xml, because the project pom.xml will resolve properties. 

> Properties in plugin poms are not resolved.
> -------------------------------------------
>
>                 Key: MNG-3881
>                 URL: http://jira.codehaus.org/browse/MNG-3881
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Plugins and Lifecycle
>    Affects Versions: 2.1.0-M1
>         Environment: Mac ox s
>            Reporter: Derek Clarkson
>
> I'm testing a plugin I have written to run JUnit 4.x tests. The pom for this plug uses properties to specify the versions of dependencies. ie. 
> 		<dependency>
> 			<groupId>junit</groupId>
> 			<artifactId>junit</artifactId>
> 			<version>${junit.version}</version>
> 		</dependency>
> 		<dependency>
> 			<groupId>org.slf4j</groupId>
> 			<artifactId>slf4j-api</artifactId>
> 			<version>${slf4j.version}</version>
> 		</dependency>
> After compiling and installing the plugin into my local repository, I then attempt to use in in another project. The project compiles correcly, but then fails when attempting to resolve the dependecies of my plugin. The faiures appear to be the plugins dependencies which are versioned by properties. HEre's an example:
> 6) org.slf4j:slf4j-api:jar:${slf4j.version}
>   Try downloading the file manually from the project website.
>   Then, install it using the command: 
>       mvn install:install-file -DgroupId=org.slf4j -DartifactId=slf4j-api -Dversion=${slf4j.version} -Dpackaging=jar -Dfile=/path/to/file
>   Alternatively, if you host your own repository you can deploy the file there: 
>       mvn deploy:deploy-file -DgroupId=org.slf4j -DartifactId=slf4j-api -Dversion=${slf4j.version} -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
>   Path to dependency: 
>   	1) dhc.maven2:maven-junit4x-plugin:maven-plugin:0.0.3-SNAPSHOT
>   	2) org.slf4j:slf4j-api:jar:${slf4j.version}
> I also see stack traces like this:
> Caused by: java.io.FileNotFoundException: http://repo1.maven.org/maven2/org/apache/maven/reporting/maven-reporting-impl/${maven.reporting.version}/maven-reporting-impl-${maven.reporting.version}.jar
> 	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1239)
> 	at org.apache.maven.wagon.providers.http.LightweightHttpWagon.fillInputData(LightweightHttpWagon.java:83)
> 	... 35 more
> [DEBUG] Unable to download the artifact from any repository
> And ....
> 7 required artifacts are missing.
> for artifact: 
>   dhc.maven2:maven-junit4x-plugin:maven-plugin:0.0.3-SNAPSHOT
> from the specified remote repositories:
>   central (http://repo1.maven.org/maven2)
> 	at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTransitively(DefaultArtifactResolver.java:482)
> 	at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTransitively(DefaultArtifactResolver.java:394)
> 	at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTransitively(DefaultArtifactResolver.java:337)
> 	at org.apache.maven.plugin.DefaultPluginManager.getPluginArtifacts(DefaultPluginManager.java:436)
> 	at org.apache.maven.plugin.DefaultPluginManager.addPlugin(DefaultPluginManager.java:279)
> 	at org.apache.maven.plugin.DefaultPluginManager.verifyVersionedPlugin(DefaultPluginManager.java:211)
> 	at org.apache.maven.plugin.DefaultPluginManager.verifyPlugin(DefaultPluginManager.java:186)
> 	at org.apache.maven.plugin.loader.DefaultPluginLoader.loadPlugin(DefaultPluginLoader.java:79)
> 	... 20 more
> Plaing around with this I found that if I go into the repository and edit the pom file to specify the dependency version then that dependency resolves. 
> From this I'm inclined to think that when resolving dependencies of plugins, that the plugin's pom is not being processed to look for properties to be inserted.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MNG-3881) Properties in plugin poms are not resolved.

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-3881?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=158440#action_158440 ] 

Brett Porter commented on MNG-3881:
-----------------------------------

are the properties actually specified in the plugin POM, or do you set them on the command line when installing?

The POM properties are self-contained, they should not apply to dependencies, so POMs in the repository need to be completely resolvable on their own. I'm inclined to say this is not a bug and refer to MARTIFACT-32 as a solution.

> Properties in plugin poms are not resolved.
> -------------------------------------------
>
>                 Key: MNG-3881
>                 URL: http://jira.codehaus.org/browse/MNG-3881
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Plugins and Lifecycle
>    Affects Versions: 2.1.0-M1
>         Environment: Mac ox s
>            Reporter: Derek Clarkson
>
> I'm testing a plugin I have written to run JUnit 4.x tests. The pom for this plug uses properties to specify the versions of dependencies. ie. 
> 		<dependency>
> 			<groupId>junit</groupId>
> 			<artifactId>junit</artifactId>
> 			<version>${junit.version}</version>
> 		</dependency>
> 		<dependency>
> 			<groupId>org.slf4j</groupId>
> 			<artifactId>slf4j-api</artifactId>
> 			<version>${slf4j.version}</version>
> 		</dependency>
> After compiling and installing the plugin into my local repository, I then attempt to use in in another project. The project compiles correcly, but then fails when attempting to resolve the dependecies of my plugin. The faiures appear to be the plugins dependencies which are versioned by properties. HEre's an example:
> 6) org.slf4j:slf4j-api:jar:${slf4j.version}
>   Try downloading the file manually from the project website.
>   Then, install it using the command: 
>       mvn install:install-file -DgroupId=org.slf4j -DartifactId=slf4j-api -Dversion=${slf4j.version} -Dpackaging=jar -Dfile=/path/to/file
>   Alternatively, if you host your own repository you can deploy the file there: 
>       mvn deploy:deploy-file -DgroupId=org.slf4j -DartifactId=slf4j-api -Dversion=${slf4j.version} -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
>   Path to dependency: 
>   	1) dhc.maven2:maven-junit4x-plugin:maven-plugin:0.0.3-SNAPSHOT
>   	2) org.slf4j:slf4j-api:jar:${slf4j.version}
> I also see stack traces like this:
> Caused by: java.io.FileNotFoundException: http://repo1.maven.org/maven2/org/apache/maven/reporting/maven-reporting-impl/${maven.reporting.version}/maven-reporting-impl-${maven.reporting.version}.jar
> 	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1239)
> 	at org.apache.maven.wagon.providers.http.LightweightHttpWagon.fillInputData(LightweightHttpWagon.java:83)
> 	... 35 more
> [DEBUG] Unable to download the artifact from any repository
> And ....
> 7 required artifacts are missing.
> for artifact: 
>   dhc.maven2:maven-junit4x-plugin:maven-plugin:0.0.3-SNAPSHOT
> from the specified remote repositories:
>   central (http://repo1.maven.org/maven2)
> 	at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTransitively(DefaultArtifactResolver.java:482)
> 	at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTransitively(DefaultArtifactResolver.java:394)
> 	at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTransitively(DefaultArtifactResolver.java:337)
> 	at org.apache.maven.plugin.DefaultPluginManager.getPluginArtifacts(DefaultPluginManager.java:436)
> 	at org.apache.maven.plugin.DefaultPluginManager.addPlugin(DefaultPluginManager.java:279)
> 	at org.apache.maven.plugin.DefaultPluginManager.verifyVersionedPlugin(DefaultPluginManager.java:211)
> 	at org.apache.maven.plugin.DefaultPluginManager.verifyPlugin(DefaultPluginManager.java:186)
> 	at org.apache.maven.plugin.loader.DefaultPluginLoader.loadPlugin(DefaultPluginLoader.java:79)
> 	... 20 more
> Plaing around with this I found that if I go into the repository and edit the pom file to specify the dependency version then that dependency resolves. 
> From this I'm inclined to think that when resolving dependencies of plugins, that the plugin's pom is not being processed to look for properties to be inserted.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (MNG-3881) Properties in plugin poms are not resolved.

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-3881?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brett Porter closed MNG-3881.
-----------------------------

      Assignee: Brett Porter
    Resolution: Not A Bug

> Properties in plugin poms are not resolved.
> -------------------------------------------
>
>                 Key: MNG-3881
>                 URL: http://jira.codehaus.org/browse/MNG-3881
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Plugins and Lifecycle
>    Affects Versions: 2.1.0-M1
>         Environment: Mac ox s
>            Reporter: Derek Clarkson
>            Assignee: Brett Porter
>
> I'm testing a plugin I have written to run JUnit 4.x tests. The pom for this plug uses properties to specify the versions of dependencies. ie. 
> 		<dependency>
> 			<groupId>junit</groupId>
> 			<artifactId>junit</artifactId>
> 			<version>${junit.version}</version>
> 		</dependency>
> 		<dependency>
> 			<groupId>org.slf4j</groupId>
> 			<artifactId>slf4j-api</artifactId>
> 			<version>${slf4j.version}</version>
> 		</dependency>
> After compiling and installing the plugin into my local repository, I then attempt to use in in another project. The project compiles correcly, but then fails when attempting to resolve the dependecies of my plugin. The faiures appear to be the plugins dependencies which are versioned by properties. HEre's an example:
> 6) org.slf4j:slf4j-api:jar:${slf4j.version}
>   Try downloading the file manually from the project website.
>   Then, install it using the command: 
>       mvn install:install-file -DgroupId=org.slf4j -DartifactId=slf4j-api -Dversion=${slf4j.version} -Dpackaging=jar -Dfile=/path/to/file
>   Alternatively, if you host your own repository you can deploy the file there: 
>       mvn deploy:deploy-file -DgroupId=org.slf4j -DartifactId=slf4j-api -Dversion=${slf4j.version} -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
>   Path to dependency: 
>   	1) dhc.maven2:maven-junit4x-plugin:maven-plugin:0.0.3-SNAPSHOT
>   	2) org.slf4j:slf4j-api:jar:${slf4j.version}
> I also see stack traces like this:
> Caused by: java.io.FileNotFoundException: http://repo1.maven.org/maven2/org/apache/maven/reporting/maven-reporting-impl/${maven.reporting.version}/maven-reporting-impl-${maven.reporting.version}.jar
> 	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1239)
> 	at org.apache.maven.wagon.providers.http.LightweightHttpWagon.fillInputData(LightweightHttpWagon.java:83)
> 	... 35 more
> [DEBUG] Unable to download the artifact from any repository
> And ....
> 7 required artifacts are missing.
> for artifact: 
>   dhc.maven2:maven-junit4x-plugin:maven-plugin:0.0.3-SNAPSHOT
> from the specified remote repositories:
>   central (http://repo1.maven.org/maven2)
> 	at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTransitively(DefaultArtifactResolver.java:482)
> 	at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTransitively(DefaultArtifactResolver.java:394)
> 	at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTransitively(DefaultArtifactResolver.java:337)
> 	at org.apache.maven.plugin.DefaultPluginManager.getPluginArtifacts(DefaultPluginManager.java:436)
> 	at org.apache.maven.plugin.DefaultPluginManager.addPlugin(DefaultPluginManager.java:279)
> 	at org.apache.maven.plugin.DefaultPluginManager.verifyVersionedPlugin(DefaultPluginManager.java:211)
> 	at org.apache.maven.plugin.DefaultPluginManager.verifyPlugin(DefaultPluginManager.java:186)
> 	at org.apache.maven.plugin.loader.DefaultPluginLoader.loadPlugin(DefaultPluginLoader.java:79)
> 	... 20 more
> Plaing around with this I found that if I go into the repository and edit the pom file to specify the dependency version then that dependency resolves. 
> From this I'm inclined to think that when resolving dependencies of plugins, that the plugin's pom is not being processed to look for properties to be inserted.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira