Maven 의 사용 에 대해 당신 은 정말 알 고 있 습 니까?
이 문 서 는 Maven 의 기본 적 인 사용 방식 과 사용 과정 에서 어떤 기본 적 인 준칙 을 지 켜 야 하 는 지 설명 한다.
우 리 는 업무 중 에 Maven 의 설정 을 자주 쓰 지만,많은 Maven 이 디 테 일 을 사용 하 는 것 은 모 를 수도 있 지만,당신 이 파악 한 후에 Maven 을 사용 하면 더욱 손 에 넣 을 수 있 습 니 다.
MAVEN 이 뭐 예요?
Apache Maven 은 소프트웨어 프로젝트 관리 도구 입 니 다.프로젝트 대상 모델(POM)의 개념 을 바탕 으로 Maven 은 짧 은 설명 정 보 를 통 해 프로젝트 의 구축,보고 와 문 서 를 관리 할 수 있다.
Maven 의 핵심 은 플러그 인 실행 프레임 워 크 입 니 다.모든 작업 은 플러그 인 을 통 해 이 루어 집 니 다.
가장 익숙 한 플러그 인 은 우리 가 자주 사용 하 는 것 과 같다.
clean compiler install deploy이러한 기본 프로 세 스 플러그 인 을 제외 하고 저 희 는 Maven 의 작업 체제 에 대해 서도 자신의 플러그 인 을 만 들 었 습 니 다.예 를 들 어 권한 수여 시스템 에서 api.json 파일 의 플러그 인 을 추출 하 는 것,예 를 들 어 erm 대상 설명 파일 을 통 해 Entity 실 체 를 만 드 는 플러그 인 등 입 니 다.기본 사용
기초 정보
pom 모델 의 기본 정보 정의
Maven 으로 구 축 된 프로젝트 를 사용 하려 면 먼저 pom.xml 파일 에 기본 정 보 를 써 야 합 니 다.예 를 들 어:
<groupId>com.yudianbank.project</groupId> //  ID
    <artifactId>salesAppParent</artifactId>//    
    <packaging>pom</packaging>//    , :jar、war、pom、rar 
    <version>1.0-RELEASES</version> //   모듈 노드,집합 서브 모듈
다 중 모듈 항목 에서 사용 하여 하위 모듈 을 정의 합 니 다.일반 다 중 모듈 항목 에서 부모 모듈 의 packaging 은 모두 pom 으로 정의 합 니 다.
<modules>
        <module>api</module>
        <module>producer</module>
    </modules>예 를 들 어 spring boot 프로젝트 에 서 는 spring boot 가 정의 한 pom 을 계승 하기 위해 다음 과 같은 parent 노드 가 있 습 니 다.
<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.5.7.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>이 노드 는 플러그 인의 기본 값 으로 속성 을 정의 하 는 데 사 용 됩 니 다.여기에서 정 의 된 속성 은 Maven build 의 전체 생명 주 기 를 관통 할 수 있 습 니 다.Maven 속성 은 값 자리 표시 자 입 니 다.pom 에서${XXX}기 호 를 통 해 사용 할 수 있 습 니 다.
<properties>
        <spring-cloud.version>Dalston.SR3</spring-cloud.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <compiler.version>1.8</compiler.version>
        <powermock.version>1.6.4</powermock.version>
        <checkstyle.version>6.18</checkstyle.version>
    </properties>env.X:"env."를 사용 하여 변 수 를 접두사 합 니 다.셸 의 환경 변 수 를 되 돌려 줍 니 다.예 를 들 어${env.PATH}은 PATH 환경 변 수 를 포함 합 니 다.메모:환경 변수 자 체 는 Windows 에서 대소 문 자 를 구분 하지 않 지만 속성 검색 은 대소 문 자 를 구분 합 니 다.다시 말 하면 윈도 셸 이%PATH%와%Path%로 같은 값 을 되 돌 릴 때 Maven 은${env.PATH}과${env.Path}을 구분 합 니 다.Maven 2.1.0 부터 신뢰성 을 위해 환경 변수의 이름 이 모든 대문자 로 귀 일 됩 니 다.project.x:POM 의 태그 경 로 는 해당 요소 의 값 을 포함 합 니 다.예 를 들 어settings.x:Mavne Home 경로 의 settings.xml 는 해당 요소 의 값 을 포함 합 니 다.예 를 들 어
<dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>${spring-cloud.version}</version>
            </dependency>
        </dependencies>type :의존 하 는 유형,기본 값 은 jar classifier :분류 기,추가 jar 좌표 표 시 는 같은 POM 에서 나 온 서로 다른 jar 가방 에 의존 합 니 다.scope :의존 하 는 jar 의 역할 범위,선택 가능(copile,runtime,test,system,provided)compile :이것 은 기본 범위 입 니 다.모든 클래스 경로 에서 컴 파일 의존 항목 을 제공 합 니 다.그 밖 에 이런 의존 항 은 의존 항목 runtime :copile 과 같 지만 JDK 나 용기 가 실 행 될 때 제공 하 기 를 바 랍 니 다.컴 파일 과 테스트 클래스 경로 에서 만 사용 할 수 있 으 며 전달 할 수 없습니다.test :이 범 위 는 프로그램 을 정상적으로 사용 할 때 의존 항목 이 필요 하지 않 고 테스트 컴 파일 과 실행 단계 에 만 적용 된다 는 것 을 나타 낸다.그것 은 전달 적 인 것 이 아니다.provided :copile 과 같 지만 JDK 나 용기 가 실 행 될 때 제공 하 기 를 바 랍 니 다.컴 파일 과 테스트 클래스 경로 에서 만 사용 할 수 있 으 며 전달 할 수 없습니다.system :이 범 위 는 provided 와 유사 합 니 다.다만 명확 하 게 포 함 된 JAR 을 제공 해 야 합 니 다.성명 후 저장 소 에서 Systempath:scope 가 system 으로 효력 이 발생 하면 로 컬 의존 경 로 를 정의 하 는 데 사 용 됩 니 다 optional :의존 전달 을 사용 할 지 여부 입 니 다.기본 false 는 전달 에 의존 해 야 합 니 다.예 를 들 어 A 는 B 에 의존 하고 B 는 C 에 의존 합 니 다.기본 적 인 상황 에서 A 는 C 에 의존 합 니 다.B 에 의존 할 때 optional 을 true 로 설정 하면 A 에서 C 에 의존 하 는 exclusions :의존 전달 배제 프로젝트 의존 충돌 을 해결 하기 위해 서 는 의존 하 는 jar 가방 이 Maven 을 통 해 전달 특성 에 의존 하여 참조 하 는 다른 jar 를 제거 해 야 합 니 다.예 를 들 어:
<dependency>
            <groupId>com.yudianbank.public</groupId>
            <artifactId>pdf</artifactId>
            <version>1.1-RELEASES</version>
            <exclusions>
                <exclusion>
                    <groupId>commons-pool</groupId>
                    <artifactId>commons-pool</artifactId>
                </exclusion>
            </exclusions>
        </dependency>dependency Management 노드,성명 의존 항목
dependency Management 는 성명 의존 항목 을 관리 하 는 데 사 용 됩 니 다.spring boot 프로젝트 에서 가장 흔히 볼 수 있 습 니 다.의존 노드 는 groupId,artifactId 만 쓰 면 jar 좌 표를 찾 을 수 있 습 니 다.spring boot 의 부모 pom 에서 dependency Management 를 사용 하여 자주 사용 하 는 의존 항목 을 설명 하기 때 문 입 니 다.예 를 들 어:
<dependencyManagement>
  <dependencies>
   <!-- Spring Boot -->
   <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot</artifactId>
    <version>1.5.7.RELEASE</version>
   </dependency>
   .......
  </dependencies>
   </dependencyManagement>profiles->profile 노드,서로 다른 환경의 구축 속성 정의
소프트웨어 프로젝트 의 교체 에 있어 개발,테스트,생산 등 서로 다른 운영 환경 이 있다.많은 경우 에 서로 다른 환경 은 서로 다른 의존 속성 을 필요 로 한다.이런 장면 은 profiles 를 사용 하여 서로 다른 환경 에서 의 변 수 를 정의 할 수 있다.예 를 들 어:
<profiles>
        <profile>
            <id>dev</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <!--     api  -->
                <sales.api.version>1.0-SNAPSHOT</sales.api.version>
                <!--        -->
                <logging.path>${basedir}/target/logs</logging.path>
            </properties>
        </profile>
        <profile>
            <id>uat</id>
            <properties>
                <sales.api.version>1.0-SNAPSHOT</sales.api.version>
                <logging.path>/data/logs/${appName}</logging.path>
            </properties>
        </profile>
        <profile>
            <id>prod</id>
            <properties>
                <sales.api.version>1.0-RELEASES</sales.api.version>
                <logging.path>/data/logs/${appName}</logging.path>
            </properties>
        </profile>   
    </profiles>jar 가 가 져 온 창고 주 소 를 정의 할 수 있 습 니 다.Apache 중앙 창 고 를 제외 하고 spring 과 같은 다른 오픈 소스 창고 도 많 습 니 다.
<repositories>
    <repository>
      <id>central</id>
      <name>Central Repository</name>
      <url>http://repo.maven.apache.org/maven2</url>
      <layout>default</layout>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
  </repositories>
 
  <pluginRepositories>
    <pluginRepository>
      <id>central</id>
      <name>Central Repository</name>
      <url>http://repo.maven.apache.org/maven2</url>
      <layout>default</layout>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <releases>
        <updatePolicy>never</updatePolicy>
      </releases>
    </pluginRepository>
  </pluginRepositories>build 노드,입 출력 경로 설정
Maven 을 사용 하여 구 축 된 프로젝트 에서 프로젝트 를 컴 파일 한 후 pom 이 있 는 디 렉 터 리 에서 target 디 렉 터 리 를 생 성 하 는 이 유 는 무엇 입 니까?build 구축 노드 에 다음 과 같은 기본 설정 이 있 기 때 문 입 니 다.
물론 다음 속성 을 표시 하면 컴 파일 된 파일 의 출력 디 렉 터 리 를 지정 할 수 있 습 니 다.
<build>
    <sourceDirectory>${basedir}/src/main/java</sourceDirectory>
    <scriptSourceDirectory>${basedir}/src/main/scripts</scriptSourceDirectory>
    <testSourceDirectory>${basedir}/src/test/java</testSourceDirectory>
    <outputDirectory>${basedir}/target/classes</outputDirectory>
    <testOutputDirectory>${basedir}/target/test-classes</testOutputDirectory>
    ...
  </build>resources 는 프로젝트 의 자원 경 로 를 정의 합 니 다.기본 경 로 는${basedir}/src/main/resources 입 니 다.spring boot 환경 에서 spring boot 의 부모 pom 속성 을 계승 하 였 습 니 다.resources 의 정 의 는 다음 과 같 습 니 다.
<resources>
   <resource>
    <directory>${basedir}/src/main/resources</directory>
    <filtering>true</filtering>
    <includes>
     <include>**/application*.yml</include>
     <include>**/application*.yaml</include>
     <include>**/application*.properties</include>
    </includes>
   </resource>
   <resource>
    <directory>${basedir}/src/main/resources</directory>
    <excludes>
     <exclude>**/application*.yml</exclude>
     <exclude>**/application*.yaml</exclude>
     <exclude>**/application*.properties</exclude>
    </excludes>
   </resource>
  </resources>프로젝트 에 다른 파일 형식 이 있 거나 application 시작 이 아 닐 때 Maven 은 걸 러 냅 니 다.
또한 spring boot 에서 속성 대체 자 를@기호 로 정의 하기 때문에 자원 파일 에서${}을 사용 할 때 유효 하지 않 습 니 다.
이 문 제 를 해결 하기 위해 서 는 pom 에서 resources 속성 이 부모 pom 을 덮어 쓰 는 행 위 를 정의 할 수 있 습 니 다.예 를 들 어,
<resources>
            <resource>
                <directory>src/main/resources</directory>
                <includes>
                    <include>**/*</include>
                </includes>
                <filtering>true</filtering>
            </resource>
        </resources>plugin 이 노드 는 사용자 정의 와 중앙 창고 에 발 표 된 플러그 인 을 포함 하여 구 축 된 플러그 인 을 정의 하 는 데 사 용 됩 니 다.spring boot 환경 에서 실행 가능 한 jar 를 구축 하려 면 spring-boot-maven-plugin 플러그 인 을 추가 해 야 합 니 다.
<plugins>
            <!  url-->
            <plugin>
                <groupId>com.yudianbank.plugin</groupId>
                <artifactId>api-abstractor</artifactId>
                <version>1.1.1-RELEASE</version>
                <executions>
                    <execution>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>createAbstract</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>distributionManagement 노드,deploy 의 창고 주 소 를 설정 합 니 다.
우리 가 스스로 사복 을 만 들 었 을 때 jar 가방 을 컴 파일 해서 사복 에 올 리 려 면 이 노드 에 창고 의 주 소 를 설정 해 야 합 니 다.예 를 들 어:
<distributionManagement>
        <repository>
            <id>repo</id>
            <name>User Project Releases</name>
            <url>http://192.168.1.204:8081/nexus/content/repositories/releases</url>
        </repository>
        <snapshotRepository>
            <id>repo</id>
            <name>User Project SNAPSHOTS</name>
            <url>http://192.168.1.204:8081/nexus/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>루트 노드 아래 name,description,url 등 노드
루트 노드 의 name,description,url 등 노드 는 프로젝트 의 기본 정 보 를 설명 합 니 다.예 를 들 어:
<name>sales</name>
      <description>        </description>
      <url>http://www.kailing.pub</url>
<licenses>
  <license>
    <name>Apache License, Version 2.0</name>
    <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
    <distribution>repo</distribution>
    <comments>A business-friendly OSS license</comments>
  </license>
</licenses>
<organization>
    <name>keking</name>
    <url>http://www.keking.cn</url>
  </organization>준수 한 준칙 과 규범
MAVEN 좌표 VERSION 속성 설정
일반적으로 개발 과 테스트 환경 에서 jar 를 SNAPSHOT 로 하고 생산 환경의 버 전 을 RELEASES 로 하 는 것 을 권장 합 니 다.이것 은 위의 profiles 노드 를 통 해 제어 할 수 있 습 니 다.그들의 차 이 는 다음 과 같 습 니 다.
SNAPSHOT :버 전 번호 에'-SNAPSHOT'접미사 가 있 을 때 발 표 된 jar 를 스냅 샷 버 전 으로 정의 하고 의존 할 때 항상 최신 스냅 샷 버 전 을 끌 어 옵 니 다.RELEASES :버 전 번호 가'-RELEASES'접 두 사 를 가 져 올 때 발 표 된 jar 를 발행 판 으로 정의 하고 응용 의존 도 를 가 질 때 처음으로 원 격 창고 에서 가 져 옵 니 다.로 컬 창고 가 이미 있 을 때 원 격 창고 에서 최신 의존 도 를 끌 지 않 습 니 다.RELEASES 버 전의 매번 업 데 이 트 는 버 전 번 호 를 지정 해 야 합 니 다.일부 모듈 을 사용 하려 면 api 모듈,comon 모듈 등 다른 사람 에 게 의존 해 야 합 니 다.개발 할 때 인터페이스 가 바 뀔 때마다 mvn deploy 에서 jar 를 사복 에 올 리 는 것 을 기억 하 세 요.
의존 하 는 JAR 버 전 속성 제어 사용
다른 jar 에 의존 할 때 죽은 jar 버 전 을 쓰 지 말고 properties 노드 가 정의 하 는 속성 을 통 해 제어 하 는 것 을 권장 합 니 다.pom 이 다른 사람 에 게 의존 할 때 상층 pom 은 부모 pom 의 속성 을 정의 하여 의존 하 는 버 전 을 제어 할 수 있 습 니 다.
다 중 모듈 항목 시 모듈 이름 규범
다 중 모듈 에서 하위 모듈 의 이름 은 부모 모듈 을 접두사 로 사용 하 는 것 을 권장 합 니 다.예 를 들 어 sales 시스템,api 모듈 은 sales-api 이 고 app 모듈 은 sales-app 입 니 다.
부록,INCUBATOR-SKYWALKING 의 MAVEN 설정,참고 제공
<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.apache.skywalking</groupId>
    <artifactId>apm</artifactId>
    <version>6.1.0-SNAPSHOT</version>
    <parent>
        <groupId>org.apache</groupId>
        <artifactId>apache</artifactId>
        <version>21</version>
    </parent>
    <modules>
        <module>oap-server</module>
        <module>apm-commons</module>
        <module>apm-sniffer</module>
        <module>apm-application-toolkit</module>
        <module>apm-protocol</module>
        <module>apm-webapp</module>
        <module>apm-dist</module>
        <module>apm-checkstyle</module>
    </modules>
    <packaging>pom</packaging>
    <name>apm</name>
    <url>https://github.com/apache/incubator-skywalking</url>
    <scm>
        <url>https://github.com/apache/incubator-skywalking</url>
        <connection>scm:git:https://github.com/apache/incubator-skywalking.git</connection>
        <developerConnection>scm:git:https://github.com/apache/incubator-skywalking.git</developerConnection>
        <tag>HEAD</tag>
    </scm>
    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/apache/incubator-skywalking/issues</url>
    </issueManagement>
    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>
    <mailingLists>
        <mailingList>
            <name>SkyWalking Developer List</name>
            <post>[email protected]</post>
            <subscribe>[email protected]</subscribe>
            <unsubscribe>[email protected]</unsubscribe>
        </mailingList>
        <mailingList>
            <name>SkyWalking Commits</name>
            <post>[email protected]</post>
            <subscribe>[email protected]</subscribe>
            <unsubscribe>[email protected]</unsubscribe>
        </mailingList>
    </mailingLists>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <compiler.version>1.8</compiler.version>
        <powermock.version>1.6.4</powermock.version>
        <checkstyle.version>6.18</checkstyle.version>
        <junit.version>4.12</junit.version>
        <mockito-all.version>1.10.19</mockito-all.version>
        <!-- Plugin versions -->
        <docker.plugin.version>0.4.13</docker.plugin.version>
        <takari-maven-plugin.version>0.6.1</takari-maven-plugin.version>
        <exec-maven-plugin.version>1.6.0</exec-maven-plugin.version>
        <maven-antrun-plugin.version>1.8</maven-antrun-plugin.version>
        <maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version>
        <maven-assembly-plugin.version>3.1.0</maven-assembly-plugin.version>
        <maven-failsafe-plugin.version>2.22.0</maven-failsafe-plugin.version>
        <maven-surefire-plugin.version>2.22.0</maven-surefire-plugin.version>
        <maven-jar-plugin.version>3.1.0</maven-jar-plugin.version>
        <maven-shade-plugin.version>3.1.1</maven-shade-plugin.version>
        <maven-enforcer-plugin.version>3.0.0-M2</maven-enforcer-plugin.version>
        <apache-rat-plugin.version>0.12</apache-rat-plugin.version>
        <maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
        <maven-resource-plugin.version>3.1.0</maven-resource-plugin.version>
        <maven-source-plugin.version>3.0.1</maven-source-plugin.version>
        <versions-maven-plugin.version>2.5</versions-maven-plugin.version>
        <coveralls-maven-plugin.version>4.3.0</coveralls-maven-plugin.version>
        <maven-checkstyle-plugin.version>3.0.0</maven-checkstyle-plugin.version>
        <jacoco-maven-plugin.version>0.8.3</jacoco-maven-plugin.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-module-junit4</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-api-mockito</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-all</artifactId>
                <version>${mockito-all.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.powermock</groupId>
                <artifactId>powermock-module-junit4</artifactId>
                <version>${powermock.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.powermock</groupId>
                <artifactId>powermock-api-mockito</artifactId>
                <version>${powermock.version}</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>exec-maven-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>git submodule update</id>
                            <phase>initialize</phase>
                            <inherited>false</inherited>
                            <configuration>
                                <executable>git</executable>
                                <arguments>
                                    <argument>submodule</argument>
                                    <argument>update</argument>
                                    <argument>--init</argument>
                                    <argument>--recursive</argument>
                                </arguments>
                            </configuration>
                            <goals>
                                <goal>exec</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <!-- mvn -N io.takari:maven:wrapper -Dmaven=3.5.4 -->
                <plugin>
                    <groupId>io.takari</groupId>
                    <artifactId>maven</artifactId>
                    <version>${takari-maven-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>exec-maven-plugin</artifactId>
                    <version>${exec-maven-plugin.version}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <version>${maven-antrun-plugin.version}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>${maven-deploy-plugin.version}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>${maven-assembly-plugin.version}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>${maven-failsafe-plugin.version}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surefire-plugin.version}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>${maven-jar-plugin.version}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>${maven-shade-plugin.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>${maven-enforcer-plugin.version}</version>
                <executions>
                    <execution>
                        <id>enforce-java</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireJavaVersion>
                                    <!-- Build has not yet been updated for Java 9+ -->
                                    <version>[1.8,9)</version>
                                </requireJavaVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.rat</groupId>
                <artifactId>apache-rat-plugin</artifactId>
                <version>${apache-rat-plugin.version}</version>
                <configuration>
                    <excludes>
                        <exclude>**/target/**</exclude>
                        <exclude>**/DISCLAIMER</exclude>
                        <exclude>**/licenses/**</exclude>
                        <exclude>**/ui-licenses/**</exclude>
                        <exclude>**/codeStyle.xml</exclude>
                        <!-- IDE files -->
                        <exclude>**/*.iml</exclude>
                        <exclude>**/.idea/**</exclude>
                        <exclude>**/*.classpath</exclude>
                        <exclude>**/.project</exclude>
                        <exclude>**/.settings/**</exclude>
                        <exclude>**/dependency-reduced-pom.xml</exclude>
                        <!-- UI IDE configs -->
                        <exclude>**/skywalking-ui/.editorconfig</exclude>
                        <!-- UI Compiler configs -->
                        <exclude>**/skywalking-ui/.webpackrc.js</exclude>
                        <exclude>**/skywalking-ui/.roadhogrc.mock.js</exclude>
                        <!-- UI Test configs -->
                        <exclude>**/skywalking-ui/jest.config.js</exclude>
                        <!-- UI style check files -->
                        <exclude>**/skywalking-ui/.eslintrc.js</exclude>
                        <exclude>**/skywalking-ui/.stylelintrc</exclude>
                        <exclude>**/skywalking-ui/.prettierignore</exclude>
                        <exclude>**/skywalking-ui/.prettierrc</exclude>
                        <!-- UI icon files -->
                        <exclude>**/skywalking-ui/public/font/iconfont/**</exclude>
                        <!-- git files -->
                        <exclude>**/.gitignore</exclude>
                        <exclude>**/.gitmodules</exclude>
                        <exclude>**/.git/**</exclude>
                        <!-- CI files -->
                        <exclude>**/.travis.yml</exclude>
                        <!-- GitHub files -->
                        <exclude>**/.github/**</exclude>
                        <!-- document files -->
                        <exclude>**/*.md</exclude>
                        <excldue>**/*.MD</excldue>
                        <exclude>**/*.txt</exclude>
                        <exclude>**/docs/**</exclude>
                        <!-- Test cases data in JSON format -->
                        <exclude>**/src/test/resources/json/*.json</exclude>
                        <!-- front end libary and generated files -->
                        <exclude>**/skywalking-ui/node_modules/**</exclude>
                        <exclude>**/skywalking-ui/node/**</exclude>
                        <exclude>**/skywalking-ui/dist/**</exclude>
                        <!-- web UI dependencies descriptions -->
                        <exclude>skywalking-ui/package.json</exclude>
                        <exclude>skywalking-ui/package-lock.json</exclude>
                        <!-- Proto files of Istio, envoy, prometheus and gogoproto projects -->
                        <exclude>**/src/main/proto/gogoproto/gogo.proto</exclude>
                        <exclude>**/src/main/proto/envoy/**</exclude>
                        <exclude>**/src/main/proto/google/protobuf/*.proto</exclude>
                        <exclude>**/src/main/proto/prometheus/client_model/metrics.proto</exclude>
                        <exclude>**/src/main/proto/validate/validate.proto</exclude>
                        <!-- generated file from antlr -->
                        <exclude>**/src/main/antlr4/org/apache/skywalking/oal/tool/grammar/OALLexer.tokens</exclude>
                        <!-- Maven Wrapper generated files -->
                        <exclude>.mvn/wrapper/maven-wrapper.properties</exclude>
                    </excludes>
                </configuration>
                <executions>
                    <execution>
                        <phase>verify</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven-compiler-plugin.version}</version>
                <configuration>
                    <source>${compiler.version}</source>
                    <target>${compiler.version}</target>
                    <encoding>${project.build.sourceEncoding}</encoding>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <version>${maven-resource-plugin.version}</version>
                <configuration>
                    <encoding>${project.build.sourceEncoding}</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.spotify</groupId>
                <artifactId>docker-maven-plugin</artifactId>
                <version>${docker.plugin.version}</version>
                <configuration>
                    <skipDocker>true</skipDocker>
                </configuration>
            </plugin>
            <plugin>
                <!--      -->
                <artifactId>maven-source-plugin</artifactId>
                <version>${maven-source-plugin.version}</version>
                <!--                 -->
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <phase>none</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
                <version>${versions-maven-plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.eluder.coveralls</groupId>
                <artifactId>coveralls-maven-plugin</artifactId>
                <version>${coveralls-maven-plugin.version}</version>
                <configuration>
                    <repoToken>xFwR2GqmxcMxV7tGEpW2NfwIrbCD4cQCS</repoToken>
                    <sourceDirectories>
                        <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
                    </sourceDirectories>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${jacoco-maven-plugin.version}</version>
                <executions>
                    <execution>
                        <id>prepare-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>${maven-checkstyle-plugin.version}</version>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.skywalking</groupId>
                        <artifactId>apm-checkstyle</artifactId>
                        <version>5.0.0-beta</version>
                    </dependency>
                    <dependency>
                        <groupId>com.puppycrawl.tools</groupId>
                        <artifactId>checkstyle</artifactId>
                        <version>8.11</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <id>validate</id>
                        <phase>validate</phase>
                        <configuration>
                            <configLocation>skywalking/checkStyle.xml</configLocation>
                            <headerLocation>skywalking/CHECKSTYLE_HEAD</headerLocation>
                            <encoding>UTF-8</encoding>
                            <consoleOutput>true</consoleOutput>
                            <includeTestSourceDirectory>true</includeTestSourceDirectory>
                            <failsOnError>true</failsOnError>
                            <excludes>org.apache.skywalking.apm/network/**/*.java,
                                org.apache.skywalking.apm/collector/remote/grpc/**/*.java,
                                org.apache.skywalking.apm/agent/core/context/ids/base64/*.java
                            </excludes>
                        </configuration>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Nexus에서 자체 Maven 리포지토리를 구축하고 sbt에서 사용Scala 현장에서 프로젝트 종속성을 폐쇄된 Maven 리포지토리로 관리할 수 없는가 하는 이야기가 오르기 때문에, 일단 로컬상에서 간이로 검증한 내용을 비망으로 남깁니다. 프로덕션 용 리포지토리 서버는 별도로 현장...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.