Make an alternative method while cloning (#4333)
* Make an alternative method while cloning skywalking project and sync submodules * Add language type for code block * Intend code blocks under list block * Make list number same * Move a tip about building from source codes. Co-authored-by: 吴晟 Wu Sheng <wu.sheng@foxmail.com>
This commit is contained in:
parent
e9eaa743a5
commit
45516a3ed8
|
|
@ -6,7 +6,7 @@ This document helps people to compile and build the project in your maven and se
|
|||
|
||||
### Maven behind Proxy
|
||||
If you need to execute build behind the proxy, edit the *.mvn/jvm.config* and put the follow properties:
|
||||
```
|
||||
```properties
|
||||
-Dhttp.proxyHost=proxy_ip
|
||||
-Dhttp.proxyPort=proxy_port
|
||||
-Dhttps.proxyHost=proxy_ip
|
||||
|
|
@ -17,11 +17,22 @@ If you need to execute build behind the proxy, edit the *.mvn/jvm.config* and pu
|
|||
|
||||
### Build from GitHub
|
||||
1. Prepare git, JDK8 and maven3
|
||||
1. `git clone https://github.com/apache/skywalking.git`
|
||||
1. `cd skywalking/`
|
||||
1. Switch to the tag by using `git checkout [tagname]` (Optional, switch if want to build a release from source codes)
|
||||
1. `git submodule init`
|
||||
1. `git submodule update`
|
||||
1. Clone project
|
||||
|
||||
If you want to build a release from source codes, provide a `tag name` by using `git clone -b [tag_name] ...` while cloning.
|
||||
|
||||
```bash
|
||||
git clone --recurse-submodules https://github.com/apache/skywalking.git
|
||||
cd skywalking/
|
||||
|
||||
OR
|
||||
|
||||
git clone https://github.com/apache/skywalking.git
|
||||
cd skywalking/
|
||||
git submodule init
|
||||
git submodule update
|
||||
```
|
||||
|
||||
1. Run `./mvnw clean package -DskipTests`
|
||||
1. All packages are in `/dist` (.tar.gz for Linux and .zip for Windows).
|
||||
|
||||
|
|
@ -81,69 +92,69 @@ Refer to [Build docker image](../../../docker) for more details.
|
|||
**NOTICE**: If you clone the codes from GitHub, please make sure that you had finished step 1 to 7 in section **[Build from GitHub](#build-from-github)**, if you download the source codes from the official website of SkyWalking, please make sure that you had followed the steps in section **[Build from Apache source code release](#build-from-apache-source-code-release)**.
|
||||
|
||||
1. Import the project as a maven project
|
||||
2. For supporting multiple source directories, you need to add the following configuration in `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 `./mvnw 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 compiling)
|
||||
7. Run `./mvnw compile` compile collector-remote-grpc-provider and apm-protocol
|
||||
8. Refresh project
|
||||
1. For supporting multiple source directories, you need to add the following configuration in `skywalking/pom.xml` file:
|
||||
```xml
|
||||
<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>
|
||||
```
|
||||
1. Add the following configuration under to let eclipse's M2e plug-in supports execution's solution configuration
|
||||
```xml
|
||||
<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>
|
||||
```
|
||||
1. Adding Google guava dependency to apm-collector-remote/collector-remote-grpc-provider/pom.xml files
|
||||
```xml
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>24.0-jre</version>
|
||||
</dependency>
|
||||
```
|
||||
1. Run `./mvnw compile -Dmaven.test.skip=true`
|
||||
1. Run `maven update`. Must remove the clean projects item before maven update(This will be clear the proto conversion Java file generated by the compiling)
|
||||
1. Run `./mvnw compile` compile collector-remote-grpc-provider and apm-protocol
|
||||
1. Refresh project
|
||||
|
|
|
|||
Loading…
Reference in New Issue