[ 
https://issues.apache.org/jira/browse/MNG-8408?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17907464#comment-17907464
 ] 

Tamas Cservenak commented on MNG-8408:
--------------------------------------

Example use case: Starting with _empty POM_ and:
{noformat}
[cstamas@angeleyes test]$ cat pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<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 
https://maven.apache.org/maven-v4_0_0.xsd";>

    <modelVersion>4.0.0</modelVersion>

    <groupId>org.apache.maven.samples</groupId>
    <artifactId>empty</artifactId>
    <version>1.0.0-SNAPSHOT</version>

</project>
[cstamas@angeleyes test]$ mvn toolbox:lock-plugin-versions -DapplyToPom
[INFO] Scanning for projects...
[INFO] 
[INFO] --------------------------------------------< 
org.apache.maven.samples:empty >--------------------------------------------
[INFO] Building empty 1.0.0-SNAPSHOT
[INFO]   from pom.xml
[INFO] ---------------------------------------------------------[ jar 
]----------------------------------------------------------
[INFO] 
[INFO] --- toolbox:0.6.1:lock-plugin-versions (default-cli) @ empty ---
[INFO] Checking newest versions of managed plugins (0)
[INFO] Checking newest versions of plugins (8)
[INFO] * org.apache.maven.plugins:maven-clean-plugin:jar:3.2.0 -> 3.4.0
[INFO] * org.apache.maven.plugins:maven-compiler-plugin:jar:3.13.0 is up to date
[INFO] * org.apache.maven.plugins:maven-surefire-plugin:jar:3.2.5 -> 3.5.2
[INFO] * org.apache.maven.plugins:maven-jar-plugin:jar:3.4.1 -> 3.4.2
[INFO] * org.apache.maven.plugins:maven-install-plugin:jar:3.1.1 -> 3.1.3
[INFO] * org.apache.maven.plugins:maven-resources-plugin:jar:3.3.1 is up to date
[INFO] * org.apache.maven.plugins:maven-deploy-plugin:jar:3.1.1 -> 3.1.3
[INFO] * org.apache.maven.plugins:maven-site-plugin:jar:3.12.1 -> 3.21.0
[INFO] 
--------------------------------------------------------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] 
--------------------------------------------------------------------------------------------------------------------------
[INFO] Total time:  0.291 s
[INFO] Finished at: 2024-12-20T19:15:57+01:00
[INFO] 
--------------------------------------------------------------------------------------------------------------------------
[cstamas@angeleyes test]$ cat pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<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 
https://maven.apache.org/maven-v4_0_0.xsd";>

    <modelVersion>4.0.0</modelVersion>

    <groupId>org.apache.maven.samples</groupId>
    <artifactId>empty</artifactId>
    <version>1.0.0-SNAPSHOT</version>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.5.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>3.1.3</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>3.4.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>3.21.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.4.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>3.3.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>3.1.3</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.13.0</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

</project>
[cstamas@angeleyes test]$ 
{noformat}

> Provide a simple way to lock plugins
> ------------------------------------
>
>                 Key: MNG-8408
>                 URL: https://issues.apache.org/jira/browse/MNG-8408
>             Project: Maven
>          Issue Type: Bug
>            Reporter: Guillaume Nodet
>            Priority: Major
>             Fix For: 4.0.0
>
>
> Maven warns if stock plugins do not have a version specified.
> We need to provide a simple way to lock those plugins and point users to it 
> in the warning.
> A quick way would be to provide a simple mojo in 
> https://github.com/maveniverse/toolbox to get the latest of each plugin which 
> is not locked and add those to the plugin management section of the root pom.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to