수색…


소개

릴리스 프로세스에서 사용하는 표준 Maven 플러그인은 maven-release-plugin입니다.이 플러그인의 구성은 최소입니다.

Maven pom의 SCM : 릴리즈 프로세스는 프로젝트의 소스 제어와 상호 작용합니다. 즉, 우리는 pom.xml에서 "scm"요소를 정의해야합니다. 릴리스 빌드의 "scm"요소에는 이 릴리스 용으로 작성된 태그를 확인하십시오.

비고

참고 : 메이븐 릴리스 플러그인 2.5 이상을 사용하여 메이븐 관련 문제를 피하십시오. 릴리스 프로세스

mvn release:clean

위의 명령은 다음을 수행합니다. 릴리즈 설명자 삭제 (release.properties) 백업 POM 파일 삭제

mvn release:prepare

릴리스 프로세스의 다음 부분은 릴리스 준비입니다. 일부 점검 수행 - 커밋되지 않은 변경 사항이 없어야하며 프로젝트가 SNAPSHOT 종속성에 의존하지 않아야합니다. pom 파일의 프로젝트 버전을 전체 릴리스 번호 (SNAPSHOT 접미사 제거)로 변경하십시오. -이 예에서는 - 0.0.1 프로젝트 테스트 슈트를 실행하고 변경 사항을 푸시합니다.이 비 SNAPSHOT 버전 코드에서 태그를 생성합니다.이 예에서는 0.0.2-SNAPSHOT 커밋과 변경 사항을 푸시합니다.

mvn release:perform

릴리스 프로세스의 후반부는 릴리스 수행입니다. SCM의 checkout 릴리스 태그는 릴리스 된 코드를 빌드하고 배포합니다.이 프로세스의 두 번째 단계는 준비 단계 (release.properties)의 출력에 의존합니다.

Nexus 저장소에 대한 릴리스를 수행하는 POM.xml

<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.codezarvis.artifactory</groupId>
<artifactId>nexusrelease</artifactId>
<version>0.0.5-SNAPSHOT</version>
<packaging>jar</packaging>

<name>nexusrelease</name>
<url>http://maven.apache.org</url>

<scm>
<connection>scm:git:[email protected]:isudarshan/nexuspractice.git</connection>
<url>scm:git:[email protected]:isudarshan/nexuspractice.git</url>
<developerConnection>scm:git:[email protected]:isudarshan/nexuspractice.git</developerConnection>
<tag>HEAD</tag>
</scm>

<distributionManagement>
<!-- Publish the versioned snapshot here -->
<repository>
<id>codezarvis</id>
<name>codezarvis-nexus</name>
<url>http://localhost:8080/nexus/content/repositories/releases</url>
</repository>

<!-- Publish the versioned releases here -->
<snapshotRepository>
<id>codezarvis</id>
<name>codezarvis-nexus</name>
<url>http://localhost:8080/nexus/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.2</version>
<executions>
<execution>
<id>default</id>
<goals>
<goal>perform</goal>
</goals>
<configuration>
<pomFileName>${project.name}/pom.xml</pomFileName>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>


Modified text is an extract of the original Stack Overflow Documentation
아래 라이선스 CC BY-SA 3.0
와 제휴하지 않음 Stack Overflow