maven不会更改本地存储库中的快照jar文件

时间:2015-01-13 13:54:00

标签: maven

我们成功配置jfrog artifactory并创建一个pom.xml来构建我们的基本jar文件并将其作为快照部署到其中。然后我们配置另一个项目来从存储库中获取那些jar文件并且它也成功了,然后我们尝试更改基本库并将其再次作为相同的快照名称进行部署,并且它正确地执行但是当我们想要再次获取这些库时,maven不会更改本地存储库中的基本库,除非我们更改快照的版本但我们不想这样做。

部署pom.xml配置文件

<plugin>
                <groupId>org.jfrog.buildinfo</groupId>
                <artifactId>artifactory-maven-plugin</artifactId>
                <version>2.2.2</version>
                <inherited>false</inherited>
                <executions>
                    <execution>
                        <id>build-info</id>
                        <goals>
                            <goal>publish</goal>
                        </goals>
                        <configuration>
                            <deployProperties>
                                <gradle>awesome</gradle>
                            </deployProperties>
                            <artifactory>
                                <includeEnvVars>true</includeEnvVars>
                                <timeoutSec>60</timeoutSec>
                                <propertiesFile>publish.properties</propertiesFile>
                            </artifactory>
                            <publisher>
                                <contextUrl>{{ARTIFACTORY_CONTEXT_URL|"http://tls.local:9081/artifactory"}}</contextUrl>
                                <username>admin</username>
                                <password>AP5PqkrxgwKVMBeY6wxPYr66R3M</password>
                                <excludePatterns>*-tests.jar</excludePatterns>
                                <repoKey>libs-release-local</repoKey>
                                <snapshotRepoKey>libs-snapshot-local</snapshotRepoKey>
                            </publisher>
                            <buildInfo>
                                <buildName>plugin-demo</buildName>
                                <buildNumber>{{DRONE_BUILD_NUMBER|TRAVIS_BUILD_NUMBER|CI_BUILD_NUMBER|BUILD_NUMBER}}
                                </buildNumber>
                                <buildUrl>{{DRONE_BUILD_URL|CI_BUILD_URL|BUILD_URL}}</buildUrl>
                            </buildInfo>
                            <licenses>
                                <autoDiscover>true</autoDiscover>
                                <includePublishedArtifacts>false</includePublishedArtifacts>
                                <runChecks>true</runChecks>
                                <scopes>compile,runtime</scopes>
                                <violationRecipients>build@organisation.com</violationRecipients>
                            </licenses>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <addMavenDescriptor>false</addMavenDescriptor>
                    </archive>
                </configuration>
            </plugin>

第三方pom.xml配置文件:

 <repository>           
      <id>snapshots</id>
      <name>libs-snapshot</name>
      <url>http://tls.local:9081/artifactory/libs-snapshot</url>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
        <updatePolicy>always</updatePolicy>
      </snapshots>
    </repository>

我们如何实现目标?

1 个答案:

答案 0 :(得分:1)

首先我们必须将我们的jfrog存储库的maven快照版本行为配置为唯一并检查句柄版本并处理快照,然后完全删除我们的本地存储库快照