maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uriel Volovich (JIRA)" <j...@codehaus.org>
Subject [jira] Created: (MENFORCER-105) requirePluginVersions rule doesn't work with POM named other than pom.xml
Date Tue, 07 Sep 2010 12:02:32 GMT
requirePluginVersions rule doesn't work with POM named other than pom.xml
-------------------------------------------------------------------------

                 Key: MENFORCER-105
                 URL: http://jira.codehaus.org/browse/MENFORCER-105
             Project: Maven 2.x Enforcer Plugin
          Issue Type: Bug
          Components: Standard Rules
    Affects Versions: 1.0-beta-2
         Environment: RH-EL 5, java 1.6.0_14, maven 2.2.1
            Reporter: Uriel Volovich


My POM file have name NOT pom.xml. When I runs build enforcer failed with exception:

org.apache.maven.enforcer.rule.api.EnforcerRuleException: Unable to download the artifact
from any repository

The stacktrace of the cause exception:
[DEBUG] Unable to locate resource in repository
org.apache.maven.wagon.ResourceDoesNotExistException: Unable to locate resource in repository
        at org.apache.maven.wagon.providers.http.LightweightHttpWagon.fillInputData(LightweightHttpWagon.java:139)
        at org.apache.maven.wagon.StreamWagon.getInputStream(StreamWagon.java:116)
        at org.apache.maven.wagon.StreamWagon.getIfNewer(StreamWagon.java:88)
        at org.apache.maven.wagon.StreamWagon.get(StreamWagon.java:61)
        at org.apache.maven.artifact.manager.DefaultWagonManager.getRemoteFile(DefaultWagonManager.java:546)
        at org.apache.maven.artifact.manager.DefaultWagonManager.getArtifact(DefaultWagonManager.java:427)
        at org.apache.maven.artifact.manager.DefaultWagonManager.getArtifact(DefaultWagonManager.java:382)
        at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:216)
        at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:90)
        at org.apache.maven.plugins.enforcer.utils.EnforcerRuleUtils.getPomModel(EnforcerRuleUtils.java:210)
        at org.apache.maven.plugins.enforcer.utils.EnforcerRuleUtils.getModelsRecursively(EnforcerRuleUtils.java:237)
        at org.apache.maven.plugins.enforcer.RequirePluginVersions.getAllPluginEntries(RequirePluginVersions.java:1014)
        at org.apache.maven.plugins.enforcer.RequirePluginVersions.execute(RequirePluginVersions.java:219)
        at org.apache.maven.plugins.enforcer.EnforceMojo.execute(EnforceMojo.java:185)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
...

It seems, that bug in the file "enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java"
at line 1014:
 List models = utils.getModelsRecursively( project.getGroupId(), project.getArtifactId(),
project.getVersion(), new File( project.getBasedir(), "pom.xml" ) ); 

POM name is hardcoded as "pom.xml"!!! So it should be replaced with:
List models = utils.getModelsRecursively( project.getGroupId(), project.getArtifactId(), project.getVersion(),
new File( project.getBasedir(), project.getFile().getName() ) ); 


-- 
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

        

Mime
View raw message