Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhanced maven build, use java 8, removed profile, use default maven … #16

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ Here are some external resources for the development:

Generating the Java classes for the given `*.proto` is quite simple. The project contain a Maven `pom.xml` which references a simple plugin to generate the classes. Just call</br>

`mvn clean package -Pgenerate-protobuf-api`
`mvn clean install`

and the generated source files will be placed underneath `src/main/generated`. Additional references - like native Google APIs - are resolved by the plugin itself.
and the generated source files will be placed underneath `target/generated-sources`. Additional references - like native Google APIs - are resolved by the plugin itself.

### C++

Expand Down
73 changes: 32 additions & 41 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@

<name>AGRIROUTER - API Protobuf Definitions</name>
<groupId>com.dke.data.api.protobuf</groupId>
<artifactId>definitions</artifactId>
<artifactId>agrirouter-api-protobuf-definitions</artifactId>
<version>0.0.1-SNAPSHOT</version>

<properties>
<protobuf-java.version>3.5.1</protobuf-java.version>
<protoc-jar-maven-plugin.version>3.5.1.1</protoc-jar-maven-plugin.version>
</properties>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
Expand All @@ -21,44 +24,32 @@
</dependency>
</dependencies>

<profiles>
<profile>
<id>generate-protobuf-api</id>
<build>
<plugins>
<plugin>
<groupId>com.github.os72</groupId>
<artifactId>protoc-jar-maven-plugin</artifactId>
<version>${protoc-jar-maven-plugin.version}</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<addProtoSources>all</addProtoSources>
<includeStdTypes>true</includeStdTypes>
<inputDirectories>
<include>src/main/resources/com/dke/data/agrirouter/proto</include>
</inputDirectories>
<includeDirectories>
<include>src/main/resources/com/dke/data/agrirouter/proto</include>
</includeDirectories>
<outputTargets>
<outputTarget>
<type>java</type>
<addSources>none</addSources>
<outputDirectory>src/main/generated</outputDirectory>
</outputTarget>
</outputTargets>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<groupId>com.github.os72</groupId>
<artifactId>protoc-jar-maven-plugin</artifactId>
<version>${protoc-jar-maven-plugin.version}</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<addProtoSources>all</addProtoSources>
<includeStdTypes>true</includeStdTypes>
<inputDirectories>
<include>src/main/resources/com/dke/data/agrirouter/proto</include>
</inputDirectories>
<includeDirectories>
<include>src/main/resources/com/dke/data/agrirouter/proto</include>
</includeDirectories>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>