unable to resolve profile properties from a parent pom
------------------------------------------------------

                 Key: MNG-3289
                 URL: http://jira.codehaus.org/browse/MNG-3289
             Project: Maven 2
          Issue Type: Bug
          Components: POM
    Affects Versions: 2.0.7
            Reporter: Rot Ulet


I defined some properties in the default profile in the settings.xml :

<settings>
  <profiles>
    <profile>
      <id>profile01</id>
      <activation> 
        <activeByDefault>true</activeByDefault>
      </activation> 
      <properties>
        <scm.connection>scm:svn:svn://linux-dev/source</scm.connection>
        <issue.url>http://linux-dev/bugzilla</issue.url>
      </properties>
    </profile>
  </profiles>
</settings>

I have defined a parent pom file named BaseProject (for default configuration, 
report, etc.) used in all project I use. I can compile and install this pom to 
my local repository. I reference this pom as the parent for my other projects. 

* For a project with parent defined to my BaseProject-pom and without 
dependencies to other project, there is no problem : I can compile and install 
without any warning. 

* But for a project with parent defined to my BaseProject-pom and with some 
dependencies to other project (previously compiled and installed), I have this 
warning :

[WARNING] POM for 'net.dummy:FW-Interfaces:pom:1.0-SNAPSHOT:compile' is 
invalid. It will be ignored for artifact resolution. Reason: The POM 
expression: ${pom.scm.connection} could not be evaluated. Reason: Expression 
value '${pom.scm.connection}/FW/FW-Interfaces' references itself in 
'net.dummy:FW-Interfaces:jar:1.0-SNAPSHOT'. for project net.dummy:FW-Interfaces 
at Artifact [net.dummy:FW-Interfaces:pom:1.0-SNAPSHOT:compile]

But ${pom.scm.connection} (or ${scm.connection}) is defined  in the default 
profile of the settings.xml.

But It is just a warning and can go through all the compilation steps.

* And for an helper project (called 'all_project.pom') without parent and 
dependencies but with all the project in need to compile in the 'modules' 
section. I got this : 
[WARNING] POM for 'net.dummy:BaseProject-Conf:pom:1.0-SNAPSHOT:runtime' is 
invalid. It will be ignored for artifact resolution. Reason: The POM 
expression: ${pom.scm.connection} could not be evaluated. Reason: Expression 
value '${pom.scm.connection}/BaseProject-Conf' references itself in 
'net.dummy:BaseProject-Conf:jar:1.0-SNAPSHOT'. for project 
net.dummy:BaseProject-Conf at Artifact 
[net.dummy:BaseProject-Conf:pom:1.0-SNAPSHOT:runtime]
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] null
[INFO] ------------------------------------------------------------------------
[INFO] Trace
java.lang.UnsupportedOperationException
        at java.util.AbstractCollection.add(AbstractCollection.java:221)
        at 
org.apache.maven.plugin.DefaultPluginManager.checkPlexusUtils(DefaultPluginManager.java:743)
        at 
org.apache.maven.extension.DefaultExtensionManager.addExtension(DefaultExtensionManager.java:112)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.findExtensions(DefaultLifecycleExecutor.java:158)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:141)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:280)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)

(BaseProject-Conf is the first 'module' of BaseProject)

Also see Wish n° MNG-2896.

Regards.

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


Reply via email to