updatePolicy - maven

maven 2023. 9. 18. 16:38


- Force Repository Update with Maven
https://www.baeldung.com/maven-force-update

- force re-download project dependencies
https://mkyong.com/maven/maven-how-to-force-re-download-project-dependencies/

mvn dependency:purge-local-repository

https://maven.apache.org/plugins/maven-dependency-plugin/examples/purging-local-repository.html

https://maven.apache.org/plugins/maven-dependency-plugin/purge-local-repository-mojo.html

- 특정 library만  re-download
mvn dependency:purge-local-repository -DmanualInclude=GROUP_ID(OR GROUP_ID:ARTIFACT_ID:VERSION,GROUP_ID2:ARTIFACT_ID2:VERSION2) clean package -Pprd




mvn clean package(OR install) -U
-U force update

- maven build 할 때마다 repository 체크하도록 하는 옵션

<repositories>
    <repository>
        <id>nexus</id>
        <name>nexus-public</name>
        <url>http://localhost:8081/repository/maven-public/</url>
        <layout>default</layout>
        <releases>
            <enabled>true</enabled>
            <updatePolicy>always</updatePolicy>
        </releases>
        <snapshots>
            <enabled>true</enabled>
            <updatePolicy>always</updatePolicy>
        </snapshots>
    </repository>
</repositories>


- repository server 배포시 releases와 snapshots 배포 설정

<distributionManagement>
    <repository>
        <id>nexus</id>
        <name>nexus-release</name>
        <url>http://localhost:8081/repository/maven-releases/</url>
        <layout>default</layout>
    </repository>
    <snapshotRepository>
        <id>nexus</id>
        <name>nexus-snapshot</name>
        <url>http://localhost:8081/repository/maven-snapshots/</url>
        <layout>default</layout>
    </snapshotRepository>
</distributionManagement>




- 공식문서
https://maven.apache.org/ref/3.9.4/maven-settings/settings.html

Maven Settings – Settings

Settings This is a reference for the user-specific configuration for Maven. Includes things that should not be distributed with the pom.xml file, such as developer identity, along with local settings, like proxy information. The default location for the se

maven.apache.org


-설명
https://recordsoflife.tistory.com/m/1158

Maven 스냅샷 리포지토리와 릴리스 리포지토리 비교

1. 개요 이 예제에서는 Maven 스냅샷과 릴리스 리포지토리의 차이점을 설명합니다. 2. 메이븐 리포지토리 Maven 리포지토리는 애플리케이션에서 의존성으로 사용할 수 있는 사전 컴파일된 아티팩트

recordsoflife.tistory.com

 

'maven' 카테고리의 다른 글

spring boot maven offline build error  (0) 2023.11.21
Versions Maven Plugin  (0) 2023.10.19
maven TroubkeShooting  (0) 2023.09.13
A Guide to Maven Artifact Classifiers  (0) 2023.03.05
maven 호환성  (0) 2023.02.26
Posted by 張's blog
,