Maven/Artifactory를 중지하는 방법 타임 스탬프로 스냅 샷을 유지하는 데
-
12-09-2019 - |
문제
디스크 공간 고려 사항으로 인해 저장소에 스냅 샷의 한 버전을 유지하고 싶습니다. 타임 스탬프 접미사로 여러 버전을 유지하는 대신
예를 들어 전자 상거래 -2.3-20090806.145007-1.ear
이것을 어떻게 설정할 수 있습니까? 이것은 빌드 설정 또는 저장소 (아티팩트) 설정입니까?
감사!
해결책
가장 단순한 (및 추천) 방법은 비 유니 키 스냅 샷을 사용하는 것입니다. 고유 한 스냅 샷을 사용해야하는 경우u003CmaxUniqueSnapshots> 에 속성u003ClocalRepository> artifactory.config.xml의 정의
예를 들어:
<localRepository>
<key>snapshots</key>
<blackedOut>false</blackedOut>
<handleReleases>false</handleReleases>
<handleSnapshots>true</handleSnapshots>
<maxUniqueSnapshots>1</maxUniqueSnapshots>
<includesPattern>**/*</includesPattern>
<snapshotVersionBehavior>non-unique</snapshotVersionBehavior>
</localRepository>
참고 로이 작업을 수행 할 수 있습니다 연결점 (UI를 통해) a 예정된 서비스, 유지할 최소 수, 유지할 최대 기간 및 릴리스 버전이 배포 된 경우 스냅 샷을 제거할지 여부를 지정할 수 있습니다.
다른 팁
이 기능/기능은 Maven 3.0에서 제거되었습니다.
내 질문에 무언가를 추가하십시오.
첨가
<distributionManagement>
...
<snapshotRepository>
...
<uniqueVersion>false</uniqueVersion>
</snapshotRepository>
...
</distributionManagement>
부모님에게 POM 또한 이것의 해결책에 기여했습니다.
보다:
http://i-proving.com/space/jessamyn+smith/blog/2008-06-16_1
Artifactory의 저장소의 고유 한 설정을 변경하려면 - 관리자로 로그인하고 관련 저장소 - 스크린 샷에서 편집을 선택하십시오.
http://wiki.jfrog.org/confluence/display/rtf/understanding+repositories
인공물은 오래된 독특한 스냅 샷을 정리할 수 있습니다. 그러나 우리는 독특한 스냅 샷이 종속성을 추적하거나 특정 버전으로 롤링을 할 목적으로 사용하지 않는 것으로 나타났습니다. 이 작업을 수행하기위한 더 나은 대안이 있습니다. 이는 더 깨끗하고 신뢰할 수 있습니다. 그렇기 때문에 인공 기본 불이행이 아닌 스냅 샷을 선호하는 이유는이 정책이 될 수 있습니다. 중앙 제어 (인공물에 고유 한). 자동 청소 기능뿐만 아니라 이에 대한 자세한 내용을 읽을 수 있습니다. 여기.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>remove-old-artifacts</id>
<phase>package</phase>
<goals>
<goal>remove-project-artifact</goal>
</goals>
<configuration>
<removeAll>true</removeAll><!-- When true, remove all built artifacts including all versions. When false, remove all built artifacts of this project version -->
</configuration>
</execution>
</executions>
</plugin>
비 유니 키 스냅 샷을 사용하는 것은 좋은 방법이 아닙니다. 대신 스냅 샷을 정리하고 디스크 공간을 유지하도록 구성 할 수있는 저장소 관리자를 확보하십시오. 타임 스탬프 스냅 샷을 사용하면 실제로 사용되는 버전을 쉽게 볼 수 있으므로 문제를 쉽게 추적 할 수 있습니다.
아래 Apache가 인용 한 Maven 3에서는 작동하지 않습니다.
It's not recommended to use non-unique snapshots since they lead to non-reproducible builds. The main use case for these was to save disk space in the repository, but this is best handled by scheduling a periodic snapshot removal task to keep the number of versions down