197 lines
8.9 KiB
XML
197 lines
8.9 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<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">
|
|
<groupId>com.a.eye</groupId>
|
|
<version>2.1-2017</version>
|
|
<modelVersion>4.0.0</modelVersion>
|
|
|
|
<artifactId>skywalking-network</artifactId>
|
|
|
|
<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>${shade.package}.com.google</shade.com.google.target>
|
|
<!-- GRPC -->
|
|
<shade.io.grpc.source>io.grpc</shade.io.grpc.source>
|
|
<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>${shade.package}.io.netty</shade.io.netty.target>
|
|
</properties>
|
|
|
|
<dependencies>
|
|
<dependency>
|
|
<groupId>io.grpc</groupId>
|
|
<artifactId>grpc-netty</artifactId>
|
|
<version>1.0.2</version>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>io.grpc</groupId>
|
|
<artifactId>grpc-protobuf</artifactId>
|
|
<version>1.0.2</version>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>io.grpc</groupId>
|
|
<artifactId>grpc-stub</artifactId>
|
|
<version>1.0.2</version>
|
|
</dependency>
|
|
</dependencies>
|
|
|
|
<build>
|
|
<extensions>
|
|
<extension>
|
|
<groupId>kr.motd.maven</groupId>
|
|
<artifactId>os-maven-plugin</artifactId>
|
|
<version>1.4.1.Final</version>
|
|
</extension>
|
|
</extensions>
|
|
<plugins>
|
|
<plugin>
|
|
<groupId>org.xolstice.maven.plugins</groupId>
|
|
<artifactId>protobuf-maven-plugin</artifactId>
|
|
<version>0.5.0</version>
|
|
<configuration>
|
|
<protocArtifact>com.google.protobuf:protoc:3.0.2:exe:${os.detected.classifier}</protocArtifact>
|
|
<pluginId>grpc-java</pluginId>
|
|
<pluginArtifact>io.grpc:protoc-gen-grpc-java:1.0.2:exe:${os.detected.classifier}</pluginArtifact>
|
|
</configuration>
|
|
<executions>
|
|
<execution>
|
|
<goals>
|
|
<goal>compile</goal>
|
|
<goal>compile-custom</goal>
|
|
</goals>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
<plugin>
|
|
<artifactId>maven-compiler-plugin</artifactId>
|
|
<configuration>
|
|
<source>1.6</source>
|
|
<target>1.6</target>
|
|
<encoding>UTF-8</encoding>
|
|
</configuration>
|
|
</plugin>
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-shade-plugin</artifactId>
|
|
<version>2.4.3</version>
|
|
<executions>
|
|
<execution>
|
|
<phase>package</phase>
|
|
<goals>
|
|
<goal>shade</goal>
|
|
</goals>
|
|
<configuration>
|
|
<shadedArtifactAttached>false</shadedArtifactAttached>
|
|
<createDependencyReducedPom>true</createDependencyReducedPom>
|
|
<createSourcesJar>true</createSourcesJar>
|
|
<shadeSourcesContent>true</shadeSourcesContent>
|
|
<relocations>
|
|
<relocation>
|
|
<pattern>${shade.com.google.source}</pattern>
|
|
<shadedPattern>${shade.com.google.target}</shadedPattern>
|
|
</relocation>
|
|
<relocation>
|
|
<pattern>${shade.io.grpc.source}</pattern>
|
|
<shadedPattern>${shade.io.grpc.target}</shadedPattern>
|
|
</relocation>
|
|
<relocation>
|
|
<pattern>${shade.io.netty.source}</pattern>
|
|
<shadedPattern>${shade.io.netty.target}</shadedPattern>
|
|
</relocation>
|
|
</relocations>
|
|
<artifactSet>
|
|
<includes>
|
|
<include>io.grpc:grpc-*:jar:*</include>
|
|
<inclued>io.netty:netty-*:jar:*</inclued>
|
|
<inclued>com.google.protobuf:*:jar:*</inclued>
|
|
<inclued>com.google.code.gson:gson:jar:*</inclued>
|
|
<include>com.google.guava:guava:jar:*</include>
|
|
</includes>
|
|
</artifactSet>
|
|
<transformers>
|
|
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
|
|
</transformers>
|
|
</configuration>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
<!-- add this plugin to fix shade-plugin bug: not rename provider 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>
|
|
<version>1.9.1</version>
|
|
<executions>
|
|
<execution>
|
|
<id>add-source</id>
|
|
<phase>generate-sources</phase>
|
|
<goals>
|
|
<goal>add-source</goal>
|
|
</goals>
|
|
<configuration>
|
|
<sources>
|
|
<source>${project.basedir}/src/main/gen-java</source>
|
|
</sources>
|
|
</configuration>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-resources-plugin</artifactId>
|
|
<version>2.4.3</version>
|
|
<configuration>
|
|
<encoding>${project.build.sourceEncoding}</encoding>
|
|
</configuration>
|
|
</plugin>
|
|
<plugin>
|
|
<!-- 源码插件 -->
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-source-plugin</artifactId>
|
|
<!-- 发布时自动将源码同时发布的配置 -->
|
|
<executions>
|
|
<execution>
|
|
<id>attach-sources</id>
|
|
<goals>
|
|
<goal>jar</goal>
|
|
</goals>
|
|
</execution>
|
|
</executions>
|
|
<version>2.4</version>
|
|
</plugin>
|
|
</plugins>
|
|
</build>
|
|
|
|
</project>
|