-
Notifications
You must be signed in to change notification settings - Fork 1
Maven jar冲突
Kervin edited this page Jul 5, 2021
·
1 revision
<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>
<!-- <parent>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>9</version>
</parent> -->
<groupId>com.devzy.share</groupId>
<artifactId>share-elasticsearch</artifactId>
<version>5.6.3.0</version>
<name>share-elasticsearch</name>
<description>share-elasticsearch</description>
<properties>
<java.version>1.8</java.version>
<java.encoding>UTF-8</java.encoding>
<log4j2.version>2.9.1</log4j2.version>
<logback.version>1.2.3</logback.version>
<druid.version>1.1.10</druid.version>
<fastjson.version>1.2.47</fastjson.version>
<elasticsearch.version>5.6.8</elasticsearch.version>
<spring-elasticsearch.version>3.0.5.RELEASE</spring-elasticsearch.version>
</properties>
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>
<scm>
<url>https://github.com/dev-share/share-elasticsearch</url>
<connection>scm:git:[email protected]:dev-share/share-elasticsearch.git</connection>
<developerConnection>scm:git:[email protected]:dev-share/share-elasticsearch.git</developerConnection>
</scm>
<developers>
<developer>
<name>Kervin</name>
<email>[email protected]</email>
<url>https://github.com/dev-share/share-elasticsearch</url>
</developer>
</developers>
<dependencies>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>${fastjson.version}</version>
</dependency>
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>transport</artifactId>
<version>${elasticsearch.version}</version>
</dependency>
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>x-pack-transport</artifactId>
<version>${elasticsearch.version}</version>
</dependency>
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-high-level-client</artifactId>
<version>${elasticsearch.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-elasticsearch</artifactId>
<version>${spring-elasticsearch.version}</version>
</dependency>
</dependencies>
<!-- <profiles>
<profile>
<id>sonatype-oss-release</id> -->
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<encoding>${java.encoding}</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>attach-source</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
<configuration>
<archive>
<manifestEntries>
<Change>${maven.build.timestamp}</Change>
<Built-Date>${maven.build.timestamp}</Built-Date>
<Dependency-Log4j2-Version>${log4j2.version}</Dependency-Log4j2-Version>
<Dependency-Fastjson-Version>${fastjson.version}</Dependency-Fastjson-Version>
<Dependency-Elasticsearch-Version>${elasticsearch.version}</Dependency-Elasticsearch-Version>
</manifestEntries>
</archive>
<excludes>
<exclude>log4j2.properties</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.1.0</version>
<dependencies>
<dependency>
<groupId>com.github.edwgiz</groupId>
<artifactId>maven-shade-plugin.log4j2-cachefile-transformer</artifactId>
<version>2.1</version>
</dependency>
</dependencies>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
<configuration>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
<relocations>
<relocation>
<pattern>org.apache.logging.log4j</pattern>
<shadedPattern>com.apache.logging.log4j</shadedPattern>
</relocation>
<relocation>
<pattern>com.fasterxml.jackson</pattern>
<shadedPattern>org.fasterxml.jackson</shadedPattern>
</relocation>
<relocation>
<pattern>io.netty</pattern>
<shadedPattern>com.io.netty</shadedPattern>
</relocation>
<relocation>
<pattern>org.jboss.netty</pattern>
<shadedPattern>com.jboss.netty</shadedPattern>
</relocation>
<relocation>
<pattern>com.google</pattern>
<shadedPattern>com.google.guava</shadedPattern>
</relocation>
<relocation>
<pattern>com.alibaba.fastjson</pattern>
<shadedPattern>org.alibaba.fastjson</shadedPattern>
</relocation>
</relocations>
<transformers>
<transformer implementation="com.github.edwgiz.mavenShadePlugin.log4j2CacheTransformer.PluginsCacheFileTransformer" />
</transformers>
</configuration>
</plugin>
</plugins>
</build>
<!-- </profile>
</profiles> -->
<distributionManagement>
<repository>
<id>Sonatype</id>
<url>https://oss.sonatype.org/content/repositories/releases/</url>
<!-- <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url> -->
</repository>
<snapshotRepository>
<id>Sonatype</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>
</project>