You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2018/07/18 03:10:59 UTC
[GitHub] wu-sheng closed pull request #1464: Add how to build in eclipse
wu-sheng closed pull request #1464: Add how to build in eclipse
URL: https://github.com/apache/incubator-skywalking/pull/1464
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/docs/cn/How-to-build-CN.md b/docs/cn/How-to-build-CN.md
index 461ca2d0f..f90e77505 100644
--- a/docs/cn/How-to-build-CN.md
+++ b/docs/cn/How-to-build-CN.md
@@ -28,6 +28,81 @@
1. 设置gRPC的自动生成代码目录,为源码目录
- **apm-protocol/apm-network/target/generated-sources/protobuf**目录下的`grpc-java`和`java`目录
- **apm-collector/apm-collector-remote/apm-remote-grpc-provider/target/generated-sources/protobuf**目录下的`grpc-java`和`java`目录
+
+## 在IntelliJ IDEA中编译工程
+上述步骤在命令行中,能够很好的编译工程,但导入到编译器中的工程依然会有一些报错,我们需要进行几步简单的操作。
+1. 在IntelliJ Terminal中,执行`mvn compile -Dmaven.test.skip=true`进行编译
+1. 设置gRPC的自动生成代码目录,为源码目录
+ - **apm-protocol/apm-network/target/generated-sources/protobuf**目录下的`grpc-java`和`java`目录
+ - **apm-collector/apm-collector-remote/apm-remote-grpc-provider/target/generated-sources/protobuf**目录下的`grpc-java`和`java`目录
+
+## 在Eclipse IDE中编译工程
+1. 导入incubator-skywalking maven工程
+2. 在主目录incubator-skywalking/pom.xml文件中添加如下两个plugin配置,首先配置多源码目录支持,在build/plugins节点下添加如下配置:
+```
+<plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>1.8</version>
+ <executions>
+ <execution>
+ <id>add-source</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>src/java/main</source>
+ <source>apm-protocol/apm-network/target/generated-sources/protobuf</source>
+ <source>apm-collector/apm-collector-remote/collector-remote-grpc-provider/target/generated-sources/protobuf</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+</plugin>
+```
+其次需要支持多source目录,但eclipse的m2e插件还没支持到execution,需要在在build节点下添加如下配置:
+```
+<pluginManagement>
+ <plugins>
+ <!--This plugin's configuration is used to store Eclipse m2e settings
+ only. It has no influence on the Maven build itself. -->
+ <plugin>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>lifecycle-mapping</artifactId>
+ <version>1.0.0</version>
+ <configuration>
+ <lifecycleMappingMetadata>
+ <pluginExecutions>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <versionRange>[1.8,)</versionRange>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ </pluginExecutionFilter>
+ </pluginExecution>
+ </pluginExecutions>
+ </lifecycleMappingMetadata>
+ </configuration>
+ </plugin>
+ </plugins>
+</pluginManagement>
+ ```
+3. 修改apm-collector-remote/collector-remote-grpc-provider/pom.xml文件,添加google guava的依赖
+ ```
+<dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ <version>24.0-jre</version>
+</dependency>
+```
+4. 执行`mvn compile -Dmaven.test.skip=true`进行编译
+5. 执行maven update,切记去掉勾选 Clean projects选项(会清掉complie生成的proto转化Java文件)
+6. mvn compile 编译collector-remote-grpc-provider和apm-protocol工程并Refresh
## 编译Resin-3, Resin-4 和 Oracle JDBC 驱动插件
为了遵守Apache关于协议(License)的相关要求,不符合Apache相关要求的类库所对应的Plugin不会自动编译。如需编译对应的插件,
diff --git a/docs/en/How-to-build.md b/docs/en/How-to-build.md
index dbcef3979..06f187ac1 100644
--- a/docs/en/How-to-build.md
+++ b/docs/en/How-to-build.md
@@ -25,6 +25,75 @@ This document helps people to compile and build the project in your maven and se
1. Set **Generated Source Codes** folders.
* `grpc-java` and `java` folders in **apm-protocol/apm-network/target/generated-sources/protobuf**
* `grpc-java` and `java` folders in **apm-collector/apm-collector-remote/apm-remote-grpc-provider/target/generated-sources/protobuf**
+
+## Setup your Eclipse IDE
+1. Import the project as a maven project
+2. For supporting multiple source directories, you need to add the following configuration in `incubator-skywalking/pom.xml` file:
+```
+<plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>1.8</version>
+ <executions>
+ <execution>
+ <id>add-source</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>src/java/main</source>
+ <source>apm-protocol/apm-network/target/generated-sources/protobuf</source>
+ <source>apm-collector/apm-collector-remote/collector-remote-grpc-provider/target/generated-sources/protobuf</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+</plugin>
+```
+3. Add the following configuration under to let eclipse's M2e plug-in supports execution's solution configuration
+```
+<pluginManagement>
+ <plugins>
+ <!--This plugin's configuration is used to store Eclipse m2e settings
+ only. It has no influence on the Maven build itself. -->
+ <plugin>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>lifecycle-mapping</artifactId>
+ <version>1.0.0</version>
+ <configuration>
+ <lifecycleMappingMetadata>
+ <pluginExecutions>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <versionRange>[1.8,)</versionRange>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ </pluginExecutionFilter>
+ </pluginExecution>
+ </pluginExecutions>
+ </lifecycleMappingMetadata>
+ </configuration>
+ </plugin>
+ </plugins>
+</pluginManagement>
+```
+4. Adding Google guava dependency to apm-collector-remote/collector-remote-grpc-provider/pom.xml files
+```
+<dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ <version>24.0-jre</version>
+</dependency>
+```
+5. Run `mvn compile -Dmaven.test.skip=true`
+6. Run `maven update`. Must remove the clean projects item before maven update(This will be clear the proto conversion Java file generated by the complie)
+7. Run `mvn compile` complie collector-remote-grpc-provider and apm-protocol
+8. Refresh project
## Building Resin-3, Resin-4, and OJDBC sdk plugins
Due to license incompatibilities/restrictions these plugins under `apm-sniffer/apm-sdk-plugin/` are not built by default.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services