jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Maven 2 & 3
  • MNG-2485

Profile compiler plugin configuration not inherited

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Won't Fix
  • Affects Version/s: 2.0.4
  • Fix Version/s: None
  • Component/s: Inheritance and Interpolation
  • Labels:
    None
  • Environment:
    Windows XP, 2K
  • Complexity:
    Intermediate

Description

Compiler plugin configuration in parent pom profile is ignored by child pom.

Parent pom includes a profile which sets the compiler plugin's source and target settings to 1.5:
<project>
...
<profiles>
<profile>
<id>test</id>
<activation>
<property>
<name>test</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<inherited>true</inherited>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<target>1.5</target>
<source>1.5</source>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

When running the test-compile phase on a child pom, the profile is ignored. Maven complains about annotations not being allowed with -source=1.3.
This occurs when the profile is activated eitherwith the -Ptest or with the -Dtest=true CLI parameters.

The above configuration works perfectly well when the <profiles> element is copied/pasted to the child pom.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Olivier Pichon added a comment - 04/Aug/06 1:23 PM

Running mvn help:effective-pom (assuming that the child pom has no <profiles> section) shows that the parent's <profiles> section is not inherited. . The last line of the "Introduction to the POM" page says (in broken English):
"NOTE: Profile inheritance the same inheritance strategy as used for the POM itself."
What does this mean?

Show
Olivier Pichon added a comment - 04/Aug/06 1:23 PM Running mvn help:effective-pom (assuming that the child pom has no <profiles> section) shows that the parent's <profiles> section is not inherited. . The last line of the "Introduction to the POM" page says (in broken English): "NOTE: Profile inheritance the same inheritance strategy as used for the POM itself." What does this mean?
Hide
Permalink
Dave Syer added a comment - 09/Aug/06 7:28 AM

This looks like a showstopper for any reasonably complex multi-project build. Is there any reason why a child project should not inherit the parent's profiles?

Show
Dave Syer added a comment - 09/Aug/06 7:28 AM This looks like a showstopper for any reasonably complex multi-project build. Is there any reason why a child project should not inherit the parent's profiles?
Hide
Permalink
Brian Fox added a comment - 07/Mar/08 7:52 PM

A parent's profiles are not inherited, however the effect of activating that profile is inherited. There are some proposals for 2.1 to make this behavior more flexible.

Show
Brian Fox added a comment - 07/Mar/08 7:52 PM A parent's profiles are not inherited, however the effect of activating that profile is inherited. There are some proposals for 2.1 to make this behavior more flexible.

People

  • Assignee:
    Unassigned
    Reporter:
    Olivier Pichon
Vote (6)
Watch (1)

Dates

  • Created:
    04/Aug/06 10:14 AM
    Updated:
    07/Mar/08 7:52 PM
    Resolved:
    07/Mar/08 7:52 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.