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/25 01:50:31 UTC

[GitHub] wu-sheng closed pull request #1409: Update How-to-build-CN.md

wu-sheng closed pull request #1409: Update How-to-build-CN.md
URL: https://github.com/apache/incubator-skywalking/pull/1409
 
 
   

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..0838cd483 100644
--- a/docs/cn/How-to-build-CN.md
+++ b/docs/cn/How-to-build-CN.md
@@ -21,13 +21,90 @@
 1. 执行`mvn clean package -DskipTests`
 1. 生成包在`/dist`目录下(.tar.gz是linux环境,.zip是windows环境)
 
-
 ## 在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配置
+  --1):多源码目录支持
+```
+		<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>
+```
+   --2):支持多source目录,但eclipse的m2e插件还没支持到execution的解决配置
+```
+   <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>
+									<action>
+										<ignore></ignore>
+									</action>
+								</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>
+	</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工程
+7. Refresh整个工程
 
 ## 编译Resin-3, Resin-4 和 Oracle JDBC 驱动插件
 为了遵守Apache关于协议(License)的相关要求,不符合Apache相关要求的类库所对应的Plugin不会自动编译。如需编译对应的插件,


 

----------------------------------------------------------------
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