Jenkins Maven pom jar packaging does not pull the latest package solution, personal test is feasible

Encountered a magical problem. After the package version number has not changed, Jenkins packaging will not pull the latest package.

Confirm that the package is deployed to the remote warehouse normally. PS: After deleting the warehouse package, it will be automatically pulled, but it is too unfriendly.

It turned out to be the reason for the package version naming. Solution: Modify the package version and add -SNAPSHOT

    <groupId>com.frame</groupId>
    <artifactId>ca-mesh-test</artifactId>
    <version>1.2.5</version>

There will be problems with the above version numbers. The correct ones are as follows:

    <groupId>com.frame</groupId>
    <artifactId>ca-mesh-test</artifactId>
    <version>1.2.5-SNAPSHOT</version>

1. Publish a new version of the snapshots version of the jar package. By default, Jenkins packaging does not pull the snapshots package.

Need to modify:

<repositories>
    <repository>
        <id>nexus</id>
        <url>maven 私库 public地址</url>
        <releases>
            <enabled>true</enabled>
            <updatePolicy>always</updatePolicy>
        </releases>
        <snapshots>
            <enabled>true</enabled>
            <updatePolicy>always</updatePolicy>
        </snapshots>
    </repository>
</repositories>

2. After setting up snapshot pull, some packages have not been updated yet, so the package version needs to end with snapshot.

    <groupId>com.frame</groupId>
    <artifactId>ca-mesh-test</artifactId>
    <version>1.2.5</version>

There will be problems with the above version numbers. The correct ones are as follows:

    <groupId>com.frame</groupId>
    <artifactId>ca-mesh-test</artifactId>
    <version>1.2.5-SNAPSHOT</version>

3. IDEA cannot update the snapshots package, which can be set

Insert image description here

reference

Guess you like

Origin blog.csdn.net/qq_40985985/article/details/132907264