Bukama opened a new issue, #11212:
URL: https://github.com/apache/maven/issues/11212

   ### Affected version
   
   current 4.0.x-branch: Maven 4.0.0-SNAPSHOT 
(b2e4fd4763e216df3865c2b32dc568e439013bdf)
   
   ### Bug description
   
   
   
   Given the following pom, we have a plugin bound to a phase (here clean) and 
its "surrounding", in Maven 3 existing `pre-*`/`post-*` phase.
   
   
   ```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/xsd/maven-4.0.0.xsd";>
     <modelVersion>4.0.0</modelVersion>
     <groupId>test.bukama.maven</groupId>
     <artifactId>rumspielstuff</artifactId>
     <version>0.0.1-SNAPSHOT</version>
     <packaging>pom</packaging>
     <name>Upgrading phases</name>
   
     <build>
       <plugins>
         <plugin>
           <groupId>com.github.ekryd.echo-maven-plugin</groupId>
           <artifactId>echo-maven-plugin</artifactId>
           <version>1.2.0</version>
           <executions>
             <execution>
              <id>msg3</id>
               <phase>post-clean</phase>
               <goals>
                 <goal>echo</goal>
               </goals>
               <configuration>
                 <message>post-clean phase from child</message>
               </configuration>
             </execution>
             <execution>
              <id>msg2</id>
               <phase>pre-clean</phase>
               <goals>
                 <goal>echo</goal>
               </goals>
               <configuration>
                 <message>pre-clean phase from child</message>
               </configuration>
             </execution>
             <execution>
              <id>msg1</id>
               <phase>clean</phase>
               <goals>
                 <goal>echo</goal>
               </goals>
               <configuration>
                 <message>clean phase from child</message>
               </configuration>
             </execution>
           </executions>
         </plugin>
       </plugins>
     </build>
   </project>
   ```
   
   When upgrading this pom the following happens:
   
   * to model version 4.0.0: Nothing
   * to model version 4.1.0: Only namespaces are adjusted, but not phases.
   
   This is not what I expected. I did expect that, when uprading to model 
version 4.1.0, the deprecated `pre-*`/`post-*` would be replaced by Maven 4's 
`before:*`/`after:*` phases and not rely on the deprecated aliases.
   I'm fine that those stay when upgrading to model version 4.0.0 as this is 
said to be also executed with Maven 3.
   
   
   Logs:
   
   **Used version: current maven-4.0.x- branch**
   
   ```
   D:\Github\rumspielstuff - Kopie>mvn --version
   Apache Maven 4.0.0-SNAPSHOT (b2e4fd4763e216df3865c2b32dc568e439013bdf)
   Maven home: C:\apache-maven-4.0.x-SNAPSHOT
   Java version: 21.0.1, vendor: Eclipse Adoptium, runtime: C:\JDK\Java21
   Default locale: de_DE, platform encoding: UTF-8
   OS name: "windows 11", version: "10.0", arch: "amd64", family: "winnt"
   ```
   
   **applying 4.0.0**
   
   ```
   D:\Github\rumspielstuff - Kopie>mvnup apply --model-version 4.0.0
   [INFO]
   [INFO] 1 problem was encountered while building the effective settings (use 
-e to see details)
   [INFO]
   [INFO] Maven Upgrade Tool - Apply
   [INFO]
   [INFO] Discovering POM files...
   [INFO] Found 1 POM file(s)
   [INFO]
   [INFO] Maven Upgrade Tool
   [INFO] → Upgrade options:
   [INFO]   • --model-version 4.0.0
   [INFO]   • Skipping strategy: Upgrading POM model version (not applicable)
   [INFO]   • Skipping strategy: Applying Maven inference optimizations (not 
applicable)
   [INFO]   • Skipping strategy: Applying Maven 4 compatibility fixes (not 
applicable)
   [INFO]
   [INFO]   → Executing strategy: Upgrading Maven plugins to recommended 
versions
   [INFO]     Upgrading Maven plugins to recommended versions
   [INFO]       D:\Github\rumspielstuff - Kopie\pom.xml (checking for plugin 
upgrades)
   [INFO]         ✓ No plugin upgrades needed
   [INFO]
   [INFO]       Upgrading Maven plugins to recommended versions Summary:
   [INFO]         0 POM(s) modified
   [INFO]         1 POM(s) needed no changes
   [INFO]     ✓ Strategy completed successfully
   [INFO]
   [INFO] Overall Upgrade Summary:
   [INFO]   1 POM(s) processed
   [INFO]   0 POM(s) modified
   [INFO]   1 POM(s) needed no changes
   [INFO]   0 error(s) encountered
   [INFO]
   [INFO] Executed Strategies:
   [INFO]   • Upgrading Maven plugins to recommended versions
   [INFO] ✓ No upgrades needed - all POMs are up to date
   [INFO]
   [INFO] Creating .mvn directory if needed to avoid root directory warnings...
   [INFO] ✓ Created .mvn directory at D:\Github\rumspielstuff - Kopie\.mvn
   [INFO]
   [INFO] Saving modified POMs...
   ```
   
   **applying 4.1.0**
   
   ```
   D:\Github\rumspielstuff - Kopie>mvnup apply --model-version 4.1.0
   [INFO]
   [INFO] 1 problem was encountered while building the effective settings (use 
-e to see details)
   [INFO]
   [INFO] Maven Upgrade Tool - Apply
   [INFO]
   [INFO] Discovering POM files...
   [INFO] Found 1 POM file(s)
   [INFO]
   [INFO] Maven Upgrade Tool
   [INFO] → Upgrade options:
   [INFO]   • --model-version 4.1.0
   [INFO]
   [INFO]   → Executing strategy: Upgrading POM model version
   [INFO]     Upgrading POM model version
   [INFO]       D:\Github\rumspielstuff - Kopie\pom.xml (current: 4.0.0)
   [INFO]         → Upgrading from 4.0.0 to 4.1.0
   [INFO]           • Updated namespace to http://maven.apache.org/POM/4.1.0
   [INFO]           • Updated xsi:schemaLocation
   [INFO]           • Updated modelVersion to 4.1.0
   [INFO]         ✓ Model upgrade completed
   [INFO]
   [INFO]       Upgrading POM model version Summary:
   [INFO]         1 POM(s) modified
   [INFO]         0 POM(s) needed no changes
   [INFO]     ✓ Strategy completed successfully
   [INFO]   • Skipping strategy: Applying Maven inference optimizations (not 
applicable)
   [INFO]   • Skipping strategy: Applying Maven 4 compatibility fixes (not 
applicable)
   [INFO]
   [INFO]   → Executing strategy: Upgrading Maven plugins to recommended 
versions
   [INFO]     Upgrading Maven plugins to recommended versions
   [INFO]       D:\Github\rumspielstuff - Kopie\pom.xml (checking for plugin 
upgrades)
   [INFO]         ✓ No plugin upgrades needed
   [INFO]
   [INFO]       Upgrading Maven plugins to recommended versions Summary:
   [INFO]         0 POM(s) modified
   [INFO]         1 POM(s) needed no changes
   [INFO]     ✓ Strategy completed successfully
   [INFO]
   [INFO] Overall Upgrade Summary:
   [INFO]   1 POM(s) processed
   [INFO]   1 POM(s) modified
   [INFO]   0 POM(s) needed no changes
   [INFO]   0 error(s) encountered
   [INFO]
   [INFO] Executed Strategies:
   [INFO]   • Upgrading POM model version
   [INFO]   • Upgrading Maven plugins to recommended versions
   [INFO] ✓ All upgrades completed successfully!
   [INFO]
   [INFO] Creating .mvn directory if needed to avoid root directory warnings...
   [INFO] ✓ .mvn directory already exists at D:\Github\rumspielstuff - 
Kopie\.mvn
   [INFO]
   [INFO] Saving modified POMs...
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to