Skip to content

Commit

Permalink
✨ 使用 flatten-maven-plugin 简化 pom 版本。
Browse files Browse the repository at this point in the history
  • Loading branch information
ChunMengLu committed Apr 22, 2021
1 parent 0232e86 commit 25bdd9a
Show file tree
Hide file tree
Showing 11 changed files with 126 additions and 38 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ target/
!**/src/main/**/target/
!**/src/test/**/target/

# Flattened pom
.flattened-pom.xml
/**/.flattened-pom.xml

# Compiled class file
*.class

Expand Down
3 changes: 1 addition & 2 deletions jap-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.fujieid</groupId>
<artifactId>jap</artifactId>
<version>1.0.1</version>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -19,7 +19,6 @@
<dependency>
<groupId>com.fujieid</groupId>
<artifactId>jap-sso</artifactId>
<version>${project.parent.version}</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,9 @@ public void checkToken() {
japCache.set(cacheKey, token);
Map<String, Object> map = JapAuthentication.checkToken(token);
System.out.println(map);
Assert.assertEquals("{jti=1111, ip=192.168.1.103, iss=jap, ua=b3ef9, iat=1614676067}", map.toString());
// token 已经过期,会返回 null
Assert.assertNull(map);
// Assert.assertEquals("{jti=1111, ip=192.168.1.103, iss=jap, ua=b3ef9, iat=1614676067}", map.toString());
}

@Test
Expand Down
4 changes: 1 addition & 3 deletions jap-ids/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.fujieid</groupId>
<artifactId>jap</artifactId>
<version>1.0.1</version>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -20,13 +20,11 @@
<dependency>
<groupId>com.fujieid</groupId>
<artifactId>jap-oidc</artifactId>
<version>${project.parent.version}</version>
</dependency>

<dependency>
<groupId>org.bitbucket.b_c</groupId>
<artifactId>jose4j</artifactId>
<version>${jose4j.version}</version>
</dependency>
</dependencies>
</project>
4 changes: 1 addition & 3 deletions jap-mfa/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.fujieid</groupId>
<artifactId>jap</artifactId>
<version>1.0.1</version>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -20,12 +20,10 @@
<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>core</artifactId>
<version>3.3.3</version>
</dependency>
<dependency>
<groupId>com.warrenstrange</groupId>
<artifactId>googleauth</artifactId>
<version>1.4.0</version>
</dependency>
</dependencies>

Expand Down
5 changes: 1 addition & 4 deletions jap-oauth2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.fujieid</groupId>
<artifactId>jap</artifactId>
<version>1.0.1</version>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -20,7 +20,6 @@
<dependency>
<groupId>com.fujieid</groupId>
<artifactId>jap-core</artifactId>
<version>${project.parent.version}</version>
</dependency>

<!--
Expand All @@ -34,13 +33,11 @@
<dependency>
<groupId>com.xkcoding.http</groupId>
<artifactId>simple-http</artifactId>
<version>${simple-http.version}</version>
</dependency>

<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>1.4</version>
</dependency>
</dependencies>
</project>
3 changes: 1 addition & 2 deletions jap-oidc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.fujieid</groupId>
<artifactId>jap</artifactId>
<version>1.0.1</version>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -19,7 +19,6 @@
<dependency>
<groupId>com.fujieid</groupId>
<artifactId>jap-oauth2</artifactId>
<version>${project.parent.version}</version>
</dependency>
</dependencies>

Expand Down
3 changes: 1 addition & 2 deletions jap-simple/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.fujieid</groupId>
<artifactId>jap</artifactId>
<version>1.0.1</version>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -19,7 +19,6 @@
<dependency>
<groupId>com.fujieid</groupId>
<artifactId>jap-core</artifactId>
<version>${project.parent.version}</version>
</dependency>
</dependencies>
</project>
4 changes: 1 addition & 3 deletions jap-social/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.fujieid</groupId>
<artifactId>jap</artifactId>
<version>1.0.1</version>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -20,12 +20,10 @@
<dependency>
<groupId>com.fujieid</groupId>
<artifactId>jap-core</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>me.zhyd.oauth</groupId>
<artifactId>JustAuth</artifactId>
<version>${justauth.version}</version>
</dependency>
</dependencies>
</project>
4 changes: 1 addition & 3 deletions jap-sso/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.fujieid</groupId>
<artifactId>jap</artifactId>
<version>1.0.1</version>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -19,9 +19,7 @@
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>kisso</artifactId>
<version>${kisso.version}</version>
</dependency>

</dependencies>

</project>
126 changes: 111 additions & 15 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.fujieid</groupId>
<artifactId>jap</artifactId>
<version>1.0.1</version>
<version>${revision}</version>
<packaging>pom</packaging>

<name>jap</name>
Expand Down Expand Up @@ -50,13 +50,15 @@
</modules>

<properties>
<java.version>1.8</java.version>
<!-- jap version -->
<revision>1.0.1</revision>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven-source.version>2.2.1</maven-source.version>
<maven-compiler.version>3.8.1</maven-compiler.version>
<maven-flatten.version>1.2.2</maven-flatten.version>
<maven-javadoc.version>3.1.1</maven-javadoc.version>
<maven-surefire-version>2.20</maven-surefire-version>
<maven-gpg-version>1.6</maven-gpg-version>
Expand All @@ -75,6 +77,9 @@
<kisso.version>3.7.6</kisso.version>
<simple-json.version>0.0.2</simple-json.version>
<simple-http.version>1.0.3</simple-http.version>
<zxing.version>3.3.3</zxing.version>
<googleauth.version>1.4.0</googleauth.version>
<commons-cli.version>1.4</commons-cli.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -146,6 +151,86 @@
</dependency>
</dependencies>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.fujieid</groupId>
<artifactId>jap-core</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>com.fujieid</groupId>
<artifactId>jap-simple</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>com.fujieid</groupId>
<artifactId>jap-social</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>com.fujieid</groupId>
<artifactId>jap-oauth2</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>com.fujieid</groupId>
<artifactId>jap-sso</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>com.fujieid</groupId>
<artifactId>jap-oidc</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>com.fujieid</groupId>
<artifactId>jap-mfa</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>com.fujieid</groupId>
<artifactId>jap-ids</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>kisso</artifactId>
<version>${kisso.version}</version>
</dependency>
<dependency>
<groupId>com.xkcoding.http</groupId>
<artifactId>simple-http</artifactId>
<version>${simple-http.version}</version>
</dependency>
<dependency>
<groupId>me.zhyd.oauth</groupId>
<artifactId>JustAuth</artifactId>
<version>${justauth.version}</version>
</dependency>
<dependency>
<groupId>org.bitbucket.b_c</groupId>
<artifactId>jose4j</artifactId>
<version>${jose4j.version}</version>
</dependency>
<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>core</artifactId>
<version>${zxing.version}</version>
</dependency>
<dependency>
<groupId>com.warrenstrange</groupId>
<artifactId>googleauth</artifactId>
<version>${googleauth.version}</version>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>${commons-cli.version}</version>
</dependency>
</dependencies>
</dependencyManagement>

<build>
<finalName>${project.artifactId}-${project.version}</finalName>
<plugins>
Expand All @@ -160,28 +245,40 @@
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>${maven-source.version}</version>
<inherited>true</inherited>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<version>${maven-flatten.version}</version>
<configuration>
<updatePomFile>true</updatePomFile>
<flattenMode>oss</flattenMode>
</configuration>
<executions>
<execution>
<phase>package</phase>
<id>flatten</id>
<phase>process-resources</phase>
<goals>
<goal>jar-no-fork</goal>
<goal>flatten</goal>
</goals>
</execution>
<execution>
<id>flatten.clean</id>
<phase>clean</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc.version}</version>
<artifactId>maven-source-plugin</artifactId>
<version>${maven-source.version}</version>
<inherited>true</inherited>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar</goal>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
Expand Down Expand Up @@ -242,14 +339,13 @@
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>${maven-source.version}</version>
<inherited>true</inherited>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc.version}</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar-no-fork</goal>
<goal>jar</goal>
</goals>
</execution>
</executions>
Expand Down

0 comments on commit 25bdd9a

Please sign in to comment.