You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2020/09/16 00:13:02 UTC

[skywalking] branch master updated: support build individual module (#5489)

This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking.git


The following commit(s) were added to refs/heads/master by this push:
     new f397c1b  support build individual module (#5489)
f397c1b is described below

commit f397c1bb49e5eff7aef3c936f316a4c5f62484b0
Author: xbkaishui <xb...@126.com>
AuthorDate: Wed Sep 16 08:12:42 2020 +0800

    support build individual module (#5489)
    
    * support build single module
    
    * enforce maven version must greater than 3.6
    
    * update build doc to support maven3.6+
---
 docs/en/guides/How-to-build.md | 78 +++---------------------------------------
 pom.xml                        | 10 ++++--
 2 files changed, 12 insertions(+), 76 deletions(-)

diff --git a/docs/en/guides/How-to-build.md b/docs/en/guides/How-to-build.md
index 5a7e6ee..2bd97f7 100644
--- a/docs/en/guides/How-to-build.md
+++ b/docs/en/guides/How-to-build.md
@@ -16,7 +16,7 @@ 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. Prepare git, JDK8 and Maven 3.6+
 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.
@@ -41,7 +41,7 @@ If you need to execute build behind the proxy, edit the *.mvn/jvm.config* and pu
 
 For each official Apache release, there is a complete and independent source code tar, which is including all source codes. You could download it from [SkyWalking Apache download page](http://skywalking.apache.org/downloads/). No git related stuff required when compiling this. Just follow these steps.
 
-1. Prepare JDK8 and maven3
+1. Prepare JDK8 and Maven 3.6+
 1. Run `./mvnw clean package -DskipTests`
 1. All packages are in `/dist`.(.tar.gz for Linux and .zip for Windows).
 
@@ -55,6 +55,9 @@ or
 
 > make build.agent
 
+If you intend to compile a single one plugin, such as in the dev stage, you could
+>  cd plugin_module_dir & mvn clean package
+
 - Compile backend and package
 >  ./mvnw package -Pbackend,dist
 
@@ -87,74 +90,3 @@ Refer to [Build docker image](../../../docker) for more details.
     * `grpc-java` and `java` folders in **oap-server/exporter/target/generated-sources/protobuf**
     * `grpc-java` and `java` folders in **oap-server/server-configuration/grpc-configuration-sync/target/generated-sources/protobuf**
     * `antlr4` folder in **oap-server/oal-grammar/target/generated-sources**
-    
-## Setup your Eclipse IDE
-**NOTICE**: If you clone the codes from GitHub, please make sure that you had finished step 1 to 3 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
-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
diff --git a/pom.xml b/pom.xml
index 667fdcd..90b1856 100755
--- a/pom.xml
+++ b/pom.xml
@@ -383,12 +383,16 @@
                         <goals>
                             <goal>enforce</goal>
                         </goals>
+                        <phase>validate</phase>
                         <configuration>
                             <rules>
                                 <requireJavaVersion>
                                     <!-- Build has not yet been updated for Java 9+ -->
                                     <version>1.8</version>
                                 </requireJavaVersion>
+                                <requireMavenVersion>
+                                    <version>3.6</version>
+                                </requireMavenVersion>
                             </rules>
                         </configuration>
                     </execution>
@@ -564,8 +568,8 @@
                 <artifactId>maven-checkstyle-plugin</artifactId>
                 <version>${maven-checkstyle-plugin.version}</version>
                 <configuration>
-                    <configLocation>apm-checkstyle/checkStyle.xml</configLocation>
-                    <headerLocation>apm-checkstyle/CHECKSTYLE_HEAD</headerLocation>
+                    <configLocation>${maven.multiModuleProjectDirectory}/apm-checkstyle/checkStyle.xml</configLocation>
+                    <headerLocation>${maven.multiModuleProjectDirectory}/apm-checkstyle/CHECKSTYLE_HEAD</headerLocation>
                     <encoding>UTF-8</encoding>
                     <consoleOutput>true</consoleOutput>
                     <includeTestSourceDirectory>true</includeTestSourceDirectory>
@@ -600,7 +604,7 @@
                         **/generated/*_jmhTest.java
                     </excludes>
                     <propertyExpansion>
-                        import.control=apm-checkstyle/importControl.xml
+                        import.control=${maven.multiModuleProjectDirectory}/apm-checkstyle/importControl.xml
                     </propertyExpansion>
                 </configuration>
                 <executions>