You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tubemq.apache.org by ti...@apache.org on 2020/04/11 02:45:05 UTC

[incubator-tubemq] branch TUBEMQ-63 created (now 3197cd0)

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

tison pushed a change to branch TUBEMQ-63
in repository https://gitbox.apache.org/repos/asf/incubator-tubemq.git.


      at 3197cd0  [TUBEMQ-63] Replace force local dependency of protoc with auto-downloading

This branch includes the following new commits:

     new 3197cd0  [TUBEMQ-63] Replace force local dependency of protoc with auto-downloading

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[incubator-tubemq] 01/01: [TUBEMQ-63] Replace force local dependency of protoc with auto-downloading

Posted by ti...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tison pushed a commit to branch TUBEMQ-63
in repository https://gitbox.apache.org/repos/asf/incubator-tubemq.git

commit 3197cd06e1e060199924c96032b8f1bdea136820
Author: tison <wa...@gmail.com>
AuthorDate: Sat Apr 11 10:43:44 2020 +0800

    [TUBEMQ-63] Replace force local dependency of protoc with auto-downloading
---
 .travis.yml                                         |  5 -----
 docs/tubemq_user_guide.md                           | 10 +++++++++-
 pom.xml                                             |  2 --
 tubemq-core/pom.xml                                 | 21 ++++++++++++++++-----
 .../main/{protobuf => proto}/BrokerService.proto    |  0
 .../main/{protobuf => proto}/MasterService.proto    |  0
 tubemq-core/src/main/{protobuf => proto}/RPC.proto  |  0
 7 files changed, 25 insertions(+), 13 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index eb75fff..acd17a8 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -29,10 +29,5 @@ cache:
   directories:
     - $HOME/.m2
 
-install:
-  - wget https://github.com/protocolbuffers/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.gz
-  - tar -xzvf protobuf-2.5.0.tar.gz
-  - pushd protobuf-2.5.0 && ./configure --prefix=/usr && make && sudo make install && popd
-
 script:
   - mvn -B -V -e verify
diff --git a/docs/tubemq_user_guide.md b/docs/tubemq_user_guide.md
index fb15877..7825dea 100644
--- a/docs/tubemq_user_guide.md
+++ b/docs/tubemq_user_guide.md
@@ -3,7 +3,6 @@
 
 - Java 1.7 or 1.8(Java 9 and above haven't been verified yet)
 - Maven
-- [protoc 2.5.0](https://github.com/protocolbuffers/protobuf/releases/tag/v2.5.0)
 
 ## Build
 
@@ -24,6 +23,15 @@ This command will generate the Java source files from the `protoc` files, the ge
 
 When this command finished, you can use IDE import the project as maven project.
 
+If you want to use local `protoc` executable, you can change the configuration of `protobuf-maven-plugin` in `tubemq-core/pom.xml` as below
+
+```xml
+<configuration>
+    <outputDirectory>${project.build.directory}/generated-sources/java</outputDirectory>
+    <protocExecutable>/usr/local/bin/protoc</protocExecutable>
+</configuration>
+```
+
 ## Deploy
 After the build, please go to `tubemq-server/target`. You can find the
 **tubemq-server-x.x.x-bin.tar.gz** file. It is the server deployment package, which includes
diff --git a/pom.xml b/pom.xml
index e78f3b4..f1b3124 100644
--- a/pom.xml
+++ b/pom.xml
@@ -222,8 +222,6 @@
                         <!-- Front-end -->
                         <exclude>resources/assets/lib/**</exclude>
                         <exclude>resources/assets/public/**</exclude>
-                        <!-- manually installed version on travis -->
-                        <exclude>protobuf-2.5.0/**</exclude>
                     </excludes>
                 </configuration>
             </plugin>
diff --git a/tubemq-core/pom.xml b/tubemq-core/pom.xml
index cdaeb41..a44e44a 100644
--- a/tubemq-core/pom.xml
+++ b/tubemq-core/pom.xml
@@ -30,6 +30,13 @@
     <version>${tubemq-core-version}</version>
 
     <build>
+        <extensions>
+            <extension>
+                <groupId>kr.motd.maven</groupId>
+                <artifactId>os-maven-plugin</artifactId>
+                <version>1.6.0</version>
+            </extension>
+        </extensions>
         <plugins>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
@@ -52,17 +59,21 @@
                 </configuration>
             </plugin>
             <plugin>
-                <groupId>com.github.igor-petruk.protobuf</groupId>
+                <groupId>org.xolstice.maven.plugins</groupId>
                 <artifactId>protobuf-maven-plugin</artifactId>
-                <version>0.6.3</version>
+                <version>0.6.1</version>
                 <executions>
                     <execution>
-                        <phase>generate-sources</phase>
                         <goals>
-                            <goal>run</goal>
+                            <goal>compile</goal>
+                            <goal>test-compile</goal>
                         </goals>
                     </execution>
                 </executions>
+                <configuration>
+                    <outputDirectory>${project.build.directory}/generated-sources/java</outputDirectory>
+                    <protocArtifact>com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier}</protocArtifact>
+                </configuration>
             </plugin>
         </plugins>
     </build>
@@ -105,4 +116,4 @@
         </dependency>
     </dependencies>
 
-</project>
\ No newline at end of file
+</project>
diff --git a/tubemq-core/src/main/protobuf/BrokerService.proto b/tubemq-core/src/main/proto/BrokerService.proto
similarity index 100%
rename from tubemq-core/src/main/protobuf/BrokerService.proto
rename to tubemq-core/src/main/proto/BrokerService.proto
diff --git a/tubemq-core/src/main/protobuf/MasterService.proto b/tubemq-core/src/main/proto/MasterService.proto
similarity index 100%
rename from tubemq-core/src/main/protobuf/MasterService.proto
rename to tubemq-core/src/main/proto/MasterService.proto
diff --git a/tubemq-core/src/main/protobuf/RPC.proto b/tubemq-core/src/main/proto/RPC.proto
similarity index 100%
rename from tubemq-core/src/main/protobuf/RPC.proto
rename to tubemq-core/src/main/proto/RPC.proto