You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Christian Schulte (JIRA)" <ji...@apache.org> on 2016/07/23 18:20:20 UTC

[jira] [Updated] (MNG-6070) Default profile in settings.xml must not use an id possibly already in use.

     [ https://issues.apache.org/jira/browse/MNG-6070?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christian Schulte updated MNG-6070:
-----------------------------------
    Summary: Default profile in settings.xml must not use an id possibly already in use.   (was: [REGRESSION] Profile activation based on a property does not work correctly)

> Default profile in settings.xml must not use an id possibly already in use. 
> ----------------------------------------------------------------------------
>
>                 Key: MNG-6070
>                 URL: https://issues.apache.org/jira/browse/MNG-6070
>             Project: Maven
>          Issue Type: Bug
>    Affects Versions: 3.4.0
>         Environment: ~/ws-git-maven-bugs/profiles (master)$ ~/tools/maven-test/apache-maven-3.4.0-SNAPSHOT/bin/mvn --version
> Apache Maven 3.4.0-SNAPSHOT (90f26c279af9738735be8f84f60dcf21b6244e24; 2016-07-23T16:24:50+02:00)
> Maven home: /Users/kama/tools/maven-test/apache-maven-3.4.0-SNAPSHOT
> Java version: 1.7.0_79, vendor: Oracle Corporation
> Java home: /Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/jre
> Default locale: en_US, platform encoding: UTF-8
> OS name: "Mac OS X", version: "10.8.5", arch: "x86_64", family: "Unix"
>            Reporter: Karl Heinz Marbaise
>            Assignee: Christian Schulte
>            Priority: Blocker
>             Fix For: 3.4.0
>
>
> I have created a simple example project with the following pom file:
> {code:xml}
> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
>   <modelVersion>4.0.0</modelVersion>
>   <groupId>com.soebes.maven.example</groupId>
>   <artifactId>example</artifactId>
>   <packaging>jar</packaging>
>   <version>1.0-SNAPSHOT</version>
>   <properties>
>     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
>   </properties>
>   <build>
>     <pluginManagement>
>       <plugins>
>         <plugin>
>           <groupId>com.soebes.maven.plugins</groupId>
>           <artifactId>echo-maven-plugin</artifactId>
>           <version>0.3.0</version>
>         </plugin>
>       </plugins>
>     </pluginManagement>
>   </build>
>   <profiles>
>     <profile>
>       <activation>
>         <property>
>           <name>performRelease</name>
>           <value>true</value>
>         </property>
>       </activation>
>       <build>
>         <plugins>
>           <plugin>
>             <groupId>com.soebes.maven.plugins</groupId>
>             <artifactId>echo-maven-plugin</artifactId>
>             <executions>
>               <execution>
>                 <phase>initialize</phase>
>                 <goals>
>                   <goal>echo</goal>
>                 </goals>
>               </execution>
>             </executions>
>             <configuration>
>               <echos>
>                 <echo>Profile: performRelease property is activated '${performRelease}'.</echo>
>               </echos>
>             </configuration>
>           </plugin>
>         </plugins>
>       </build>
>     </profile>
>   </profiles>
> </project>
> {code}
> If I use Maven 3.3.9 (also 3.0.5, 3.1.1, 3.2.5) and run it like this:
> {code}
> ~/ws-git-maven-bugs/profiles (master)$ mvn initialize
> [INFO] Scanning for projects...
> [INFO]
> [INFO] ------------------------------------------------------------------------
> [INFO] Building example 1.0-SNAPSHOT
> [INFO] ------------------------------------------------------------------------
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD SUCCESS
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 0.401 s
> [INFO] Finished at: 2016-07-23T18:11:47+02:00
> [INFO] Final Memory: 7M/245M
> [INFO] ------------------------------------------------------------------------
> {code}
> If I run the current master of Maven Core (sha: 90f26c279af9738735be8f84f60dcf21b6244e24) I got the following result:
> {code}
> ~/ws-git-maven-bugs/profiles (master)$ ~/tools/maven-test/apache-maven-3.4.0-SNAPSHOT/bin/mvn initialize
> [INFO] Scanning for projects...
> [INFO]
> [INFO] ------------------------------------------------------------------------
> [INFO] Building example 1.0-SNAPSHOT
> [INFO] ------------------------------------------------------------------------
> [INFO]
> [INFO] --- echo-maven-plugin:0.3.0:echo (default) @ example ---
> [INFO] Profile: performRelease property is activated '${performRelease}'.
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD SUCCESS
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 0.478 s
> [INFO] Finished at: 2016-07-23T18:12:54+02:00
> [INFO] Final Memory: 9M/245M
> [INFO] ------------------------------------------------------------------------
> {code}
> This means the profile will be erroneously activated but the property does not contain a value.
> If I add an id to the profile like this:
> {code:xml}
>   <profiles>
>     <profile>
>       <id>an-other-profile</id>
>       <activation>
>         <property>
>           <name>performRelease</name>
>           <value>true</value>
>         </property>
>       </activation>
>   ..
> {code}
> It will produce the following (correct) result:
> {code}
> ~/ws-git-maven-bugs/profiles (master *)$ ~/tools/maven-test/apache-maven-3.4.0-SNAPSHOT/bin/mvn initialize
> [INFO] Scanning for projects...
> [INFO]
> [INFO] ------------------------------------------------------------------------
> [INFO] Building example 1.0-SNAPSHOT
> [INFO] ------------------------------------------------------------------------
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD SUCCESS
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 0.279 s
> [INFO] Finished at: 2016-07-23T18:18:23+02:00
> [INFO] Final Memory: 8M/245M
> [INFO] ------------------------------------------------------------------------
> {code}
> I have create a full working example here: https://github.com/khmarbaise/mng-6070



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Re: [jira] [Updated] (MNG-6070) Default profile in settings.xml must not use an id possibly already in use.

Posted by Christian Schulte <cs...@schulte.it>.
Am 07/23/16 um 20:31 schrieb Karl Heinz Marbaise:
> Hi Christian,
> 
> Ok first activation problem looks like being solved I've retested this 
> with my example project...Thanks for fixing that...
> 
> 
> But what is unclear to me why during the run information from another 
> profile in particular the one which is defined in the parent of my 
> echo-maven-plugin will leak into my example project?

Does that really happen?

> The questions is profiles are read which are in the plugins which I'm 
> using in my project...that sounds like they are not clearly separated....
> 
> ?

What profile are you referring to in the example? The plugin profiles
are not applied to the POMs by the model builder. I could be wrong.

Regards,
-- 
Christian


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: [jira] [Updated] (MNG-6070) Default profile in settings.xml must not use an id possibly already in use.

Posted by Christian Schulte <cs...@schulte.it>.
Am 07/23/16 um 20:31 schrieb Karl Heinz Marbaise:
> Hi Christian,
> 
> Ok first activation problem looks like being solved I've retested this 
> with my example project...Thanks for fixing that...
> 
> 
> But what is unclear to me why during the run information from another 
> profile in particular the one which is defined in the parent of my 
> echo-maven-plugin will leak into my example project? (Described in the 
> issue MNG-6070)...I never thought profiles used in a plugin could have 
> influence into my own project which only use those plugins? But those 
> profiles are read....
> 
> The questions is profiles are read which are in the plugins which I'm 
> using in my project...that sounds like they are not clearly separated....
> 
> ?
> 

The output may be different due to
<https://issues.apache.org/jira/browse/MNG-5984>. But that happens in
MavenCLI before anything else is executed. Does not influence the model
builder in any way. That's the only changes I know of regarding profiles
done in 3.4.

Regards,
-- 
Christian


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: [jira] [Updated] (MNG-6070) Default profile in settings.xml must not use an id possibly already in use.

Posted by Karl Heinz Marbaise <kh...@gmx.de>.
Hi Christian,

Ok first activation problem looks like being solved I've retested this 
with my example project...Thanks for fixing that...


But what is unclear to me why during the run information from another 
profile in particular the one which is defined in the parent of my 
echo-maven-plugin will leak into my example project? (Described in the 
issue MNG-6070)...I never thought profiles used in a plugin could have 
influence into my own project which only use those plugins? But those 
profiles are read....

The questions is profiles are read which are in the plugins which I'm 
using in my project...that sounds like they are not clearly separated....

?

Kind regards
Karl Heinz


On 7/23/16 8:20 PM, Christian Schulte (JIRA) wrote:
>
>      [ https://issues.apache.org/jira/browse/MNG-6070?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
>
> Christian Schulte updated MNG-6070:
> -----------------------------------
>     Summary: Default profile in settings.xml must not use an id possibly already in use.   (was: [REGRESSION] Profile activation based on a property does not work correctly)
>
>> Default profile in settings.xml must not use an id possibly already in use.
>> ----------------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org