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

Generate Java source files from protocol buffer definition files in separate Maven module #6184

Merged
merged 2 commits into from
Oct 24, 2024
Merged
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
8 changes: 8 additions & 0 deletions application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@
<name>OpenTripPlanner - Application</name>

<dependencies>
<!-- project dependencies -->
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>gtfs-realtime-protobuf</artifactId>
<version>${project.version}</version>
</dependency>

<!-- 3rd party dependencies -->
<dependency>
<groupId>net.sf.trove4j</groupId>
<artifactId>trove4j</artifactId>
Expand Down
54 changes: 54 additions & 0 deletions gtfs-realtime-protobuf/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.opentripplanner</groupId>
<artifactId>otp-root</artifactId>
<version>2.7.0-SNAPSHOT</version>
</parent>
<artifactId>gtfs-realtime-protobuf</artifactId>
<name>OpenTripPlanner - GTFS Realtime (protobuf)</name>

<dependencies>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
</dependency>
</dependencies>
<build>
<extensions>
<!-- makes build variables like os.detected.classifier available.
use to select the correct protoc instance for the OS.
see protobuf-maven-plugin below -->
<extension>
<groupId>kr.motd.maven</groupId>
<artifactId>os-maven-plugin</artifactId>
<version>1.7.1</version>
</extension>
</extensions>
<plugins>
<!-- compile the gtfs-realtime.proto file to Java code
To update the proto file run the following command:
curl https://raw.githubusercontent.com/google/transit/master/gtfs-realtime/proto/gtfs-realtime.proto -o src/main/proto/gtfs-realtime.proto
-->
<plugin>
<groupId>org.xolstice.maven.plugins</groupId>
<artifactId>protobuf-maven-plugin</artifactId>
<version>0.6.1</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
<configuration>
<protocArtifact>com.google.protobuf:protoc:3.22.0:exe:${os.detected.classifier}</protocArtifact>
</configuration>
</plugin>
</plugins>
</build>
</project>
32 changes: 1 addition & 31 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,19 +95,10 @@

<modules>
<module>application</module>
<module>gtfs-realtime-protobuf</module>
</modules>

<build>
<extensions>
<!-- makes build variables like os.detected.classifier available.
use to select the correct protoc instance for the OS.
see protobuf-maven-plugin below -->
<extension>
<groupId>kr.motd.maven</groupId>
<artifactId>os-maven-plugin</artifactId>
<version>1.7.1</version>
</extension>
</extensions>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -357,27 +348,6 @@
</extraDirectories>
</configuration>
</plugin>

<!-- compile the gtfs-realtime.proto file to Java code
To update the proto file run the following command:
curl https://raw.githubusercontent.com/google/transit/master/gtfs-realtime/proto/gtfs-realtime.proto -o src/main/proto/gtfs-realtime.proto
-->
<plugin>
<groupId>org.xolstice.maven.plugins</groupId>
<artifactId>protobuf-maven-plugin</artifactId>
<version>0.6.1</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
<configuration>
<protocArtifact>com.google.protobuf:protoc:3.22.0:exe:${os.detected.classifier}</protocArtifact>
</configuration>
</plugin>
</plugins>
</build>

Expand Down
Loading