use antrun-plugin to fix bug of shade-plugin.

set jvm level to 1.6
This commit is contained in:
wusheng 2016-11-12 20:10:46 +08:00
parent 7e856deceb
commit b46472976b
1 changed files with 34 additions and 5 deletions

View File

@ -10,15 +10,16 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<shade.package>com.a.eye.skywalking.network.dependencies</shade.package>
<!-- Google dependence-->
<shade.com.google.source>com.google</shade.com.google.source>
<shade.com.google.target>com.a.eye.skywalking.network.dependencies.com.google</shade.com.google.target>
<shade.com.google.target>${shade.package}.com.google</shade.com.google.target>
<!-- GRPC -->
<shade.io.grpc.source>io.grpc</shade.io.grpc.source>
<shade.io.grpc.target>com.a.eye.skywalking.network.dependencies.io.grpc</shade.io.grpc.target>
<shade.io.grpc.target>${shade.package}.io.grpc</shade.io.grpc.target>
<!--netty -->
<shade.io.netty.source>io.netty</shade.io.netty.source>
<shade.io.netty.target>com.a.eye.skywalking.network.dependencies.io.netty</shade.io.netty.target>
<shade.io.netty.target>${shade.package}.io.netty</shade.io.netty.target>
</properties>
<dependencies>
@ -69,8 +70,8 @@
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
@ -119,6 +120,34 @@
</execution>
</executions>
</plugin>
<!-- add this plugin to fix shade-plugin bug: not rename services file name. -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<id>unpack</id>
<phase>package</phase>
<configuration>
<target>
<echo message="unjar" />
<unzip src="${project.build.directory}/${artifactId}-${version}.jar" dest="${project.build.directory}/unpacked/" />
<echo message="rename service providers in META-INF/services" />
<move todir="${project.build.directory}/unpacked/META-INF/services" includeemptydirs="false">
<fileset dir="${project.build.directory}/unpacked/META-INF/services"/>
<mapper type="glob" from="*" to="${shade.package}.*"/>
</move>
<echo message="jar back" />
<jar destfile="${project.build.directory}/${artifactId}-${version}.jar" basedir="${project.build.directory}/unpacked" />
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>