Replace flatten-maven-plugin with easyj-maven-plugin (#9985)

* Replace `flatten-maven-plugin` with `easyj-maven-plugin`

* revert indent

* apache-rat-plugin exclude `.flattened-pom.xml`

* fix style

* optimize github action

* optimize github action

* fix dependencies

* upgrade easyj-maven-plugin to 1.1.5

* optimize github action

* optimize spring-boot-maven-plugin configuration
This commit is contained in:
WangLiang/王良 2023-03-02 10:43:08 +08:00 committed by GitHub
parent d5bbe9ebfd
commit 6ba05fa7a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 46 additions and 46 deletions

View File

@ -1,7 +1,7 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Continuous Integration
name: "Continuous Integration"
on:
push:
@ -13,34 +13,37 @@ permissions:
contents: read # to fetch code (actions/checkout)
jobs:
unix:
ci:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
java: [8]
steps:
- name: Cache Maven Repos
- name: "Cache Maven Repos"
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- uses: actions/checkout@v3
- name: Set up JDK ${{ matrix.java }}
- name: "Checkout"
uses: actions/checkout@v3
- name: "Set up JDK ${{ matrix.java }}"
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: 'zulu'
architecture: x64
- name: Check with Maven
run: mvn -B clean package apache-rat:check findbugs:findbugs -Dmaven.test.skip=true
- name: Build with Maven
run: mvn -Prelease-nacos -Dmaven.test.skip=true clean install -U
- name: Test With Maven
run: mvn -Prelease-nacos clean test -DtrimStackTrace=false
- name: Codecov
- name: "Print maven version"
run: mvn -version
- name: "Check with Maven"
run: mvn -B clean package apache-rat:check findbugs:findbugs -DskipTests -e -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
- name: "Build with Maven"
run: mvn -Prelease-nacos -DskipTests clean install -U -e -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
- name: "Test With Maven"
run: mvn -Prelease-nacos clean test -DtrimStackTrace=false -e -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
- name: "Codecov"
uses: codecov/codecov-action@v3.1.0
with:
files: ./address/target/site/jacoco/jacoco.xml,./api/target/site/jacoco/jacoco.xml,./auth/target/site/jacoco/jacoco.xml,./client/target/site/jacoco/jacoco.xml,./common/target/site/jacoco/jacoco.xml,./consistency/target/site/jacoco/jacoco.xml,./console/target/site/jacoco/jacoco.xml,./core/target/site/jacoco/jacoco.xml,./naming/target/site/jacoco/jacoco.xml,./plugin-default-impl/target/site/jacoco/jacoco.xml,./plugin/auth/target/site/jacoco/jacoco.xml,./plugin/encryption/target/site/jacoco/jacoco.xml,./sys/target/site/jacoco/jacoco.xml

View File

@ -1,7 +1,7 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Integration Test
name: "Integration Test"
on:
push:
@ -13,33 +13,36 @@ permissions:
contents: read # to fetch code (actions/checkout)
jobs:
unix:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
java: [8, 8.0.192, 11, 11.0.3]
steps:
- name: Cache Maven Repos
- name: "Cache Maven Repos"
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- uses: actions/checkout@v3
- name: Set up JDK ${{ matrix.java }}
- name: "Checkout"
uses: actions/checkout@v3
- name: "Set up JDK ${{ matrix.java }}"
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: 'zulu'
architecture: x64
- name: Test Config
run: mvn clean package -Pcit-test
- name: Clean Env
run: mvn clean -Premove-test-data
- name: Test Naming
run: mvn clean package -Pnit-test
- name: Clean Env
run: mvn clean -Premove-test-data
- name: "Print maven version"
run: mvn -version
- name: "Test Config"
run: mvn clean package -Pcit-test -e -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
- name: "Clean Env"
run: mvn clean -Premove-test-data -e -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
- name: "Test Naming"
run: mvn clean package -Pnit-test -e -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
- name: "Clean Env"
run: mvn clean -Premove-test-data -e -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn

View File

@ -37,6 +37,7 @@
<artifactId>nacos-console</artifactId>
</dependency>
</dependencies>
<profiles>
<profile>
<id>release-config</id>
@ -198,12 +199,6 @@
</profile>
<profile>
<id>release-nacos</id>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>nacos-console</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>

29
pom.xml
View File

@ -121,7 +121,7 @@
<maven-failsafe-plugin.version>2.19.1</maven-failsafe-plugin.version>
<maven-assembly-plugin.version>3.0.0</maven-assembly-plugin.version>
<maven-checkstyle-plugin.version>3.1.2</maven-checkstyle-plugin.version>
<maven-flatten-version>1.1.0</maven-flatten-version>
<maven-easyj-version>1.1.5</maven-easyj-version>
<!-- dependency version related to plugin -->
<extra-enforcer-rules.version>1.0-beta-4</extra-enforcer-rules.version>
<p3c-pmd.version>1.3.0</p3c-pmd.version>
@ -171,6 +171,9 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot-dependencies.version}</version>
<configuration>
<attach>false</attach>
</configuration>
</plugin>
</plugins>
</pluginManagement>
@ -350,6 +353,7 @@
<exclude>**/gogo.proto</exclude>
<exclude>**/any.proto</exclude>
<exclude>src/main/java/com/alibaba/nacos/common/packagescan/classreading/**</exclude>
<exclude>.flattened-pom.xml</exclude>
</excludes>
</configuration>
<executions>
@ -419,29 +423,24 @@
<version>${maven-assembly-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<version>${maven-flatten-version}</version>
<groupId>icu.easyj.maven.plugins</groupId>
<artifactId>easyj-maven-plugin</artifactId>
<version>${maven-easyj-version}</version>
<configuration>
<updatePomFile>true</updatePomFile>
<flattenMode>resolveCiFriendliesOnly</flattenMode>
<pomElements>
<dependencies>expand</dependencies>
</pomElements>
<simplifiedPomFileName>.flattened-pom.xml</simplifiedPomFileName>
<useTabIndent>true</useTabIndent>
</configuration>
<executions>
<execution>
<id>flatten</id>
<phase>process-resources</phase>
<id>flatten-pom</id>
<goals>
<goal>flatten</goal>
<goal>simplify-pom</goal>
</goals>
</execution>
<execution>
<id>flatten.clean</id>
<phase>clean</phase>
<id>clean-flattened-pom</id>
<goals>
<goal>clean</goal>
<goal>clean-simplify-pom</goal>
</goals>
</execution>
</executions>