OneBusAway / onebusaway-gtfs-realtime-from-siri-cli

Produce GTFS-realtime data from a SIRI data source.
https://github.com/OneBusAway/onebusaway-gtfs-realtime-from-siri-cli/wiki
Other
8 stars 6 forks source link

mvn package failed #6

Open dancesWithCycles opened 2 years ago

dancesWithCycles commented 2 years ago

Hi folks, Thank you so much for providing this repository. This is the first time I came across and spend some time on it. I would appreciate any hints on the following question.

The root folder in this repo provides a pom.xml file. The instruction mvn clean package ended up in this error.

[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /home/begerad/git/github/onebusaway-gtfs-realtime-from-siri-cli/src/main/java/org/onebusaway/gtfs_realtime/siri/SiriToGtfsRealtimeService.java:[32,23] error: package javax.annotation does not exist
[ERROR] /home/begerad/git/github/onebusaway-gtfs-realtime-from-siri-cli/src/main/java/org/onebusaway/gtfs_realtime/siri/SiriToGtfsRealtimeService.java:[33,23] error: package javax.annotation does not exist
[ERROR] /home/begerad/git/github/onebusaway-gtfs-realtime-from-siri-cli/src/main/java/org/onebusaway/gtfs_realtime/siri/SiriToGtfsRealtimeService.java:[262,3] error: cannot find symbol
[ERROR]  class SiriToGtfsRealtimeService
/home/begerad/git/github/onebusaway-gtfs-realtime-from-siri-cli/src/main/java/org/onebusaway/gtfs_realtime/siri/SiriToGtfsRealtimeService.java:[276,3] error: cannot find symbol
[INFO] 4 errors 
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  8.670 s
[INFO] Finished at: 2022-04-01T14:29:43+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project onebusaway-gtfs-realtime-from-siri-cli: Compilation failure: Compilation failure: 
[ERROR] /home/begerad/git/github/onebusaway-gtfs-realtime-from-siri-cli/src/main/java/org/onebusaway/gtfs_realtime/siri/SiriToGtfsRealtimeService.java:[32,23] error: package javax.annotation does not exist
[ERROR] /home/begerad/git/github/onebusaway-gtfs-realtime-from-siri-cli/src/main/java/org/onebusaway/gtfs_realtime/siri/SiriToGtfsRealtimeService.java:[33,23] error: package javax.annotation does not exist
[ERROR] /home/begerad/git/github/onebusaway-gtfs-realtime-from-siri-cli/src/main/java/org/onebusaway/gtfs_realtime/siri/SiriToGtfsRealtimeService.java:[262,3] error: cannot find symbol
[ERROR]  class SiriToGtfsRealtimeService
[ERROR] /home/begerad/git/github/onebusaway-gtfs-realtime-from-siri-cli/src/main/java/org/onebusaway/gtfs_realtime/siri/SiriToGtfsRealtimeService.java:[276,3] error: cannot find symbol

I appreciate any hints solving this issue.

This is my setup.

mvn -version
Apache Maven 3.6.3
Maven home: /usr/share/maven
Java version: 11.0.14.1, vendor: Eclipse Adoptium, runtime: /usr/lib/jvm/open-jdk-11
Default locale: en_GB, platform encoding: UTF-8
OS name: "linux", version: "5.10.0-12-amd64", arch: "amd64", family: "unix"
java -version
openjdk version "11.0.14.1" 2022-02-08
OpenJDK Runtime Environment Temurin-11.0.14.1+1 (build 11.0.14.1+1)
OpenJDK 64-Bit Server VM Temurin-11.0.14.1+1 (build 11.0.14.1+1, mixed mode)
uname -a
Linux ltpt490 5.10.0-12-amd64 #1 SMP Debian 5.10.103-1 (2022-03-07) x86_64 GNU/Linux

Cheers!

barbeau commented 2 years ago

@dancesWithCycles So I think there are a few things going on here, largely stemming from the fact that that last change to this project was in 2014 (prior to a few things I did today). Also, the OBA Maven repository moved, which caused some past artifacts to be lost along the way.

I've updated to the newest OBA Maven repo now, but the biggest issue seems to be the dependency on: https://github.com/OneBusAway/onebusaway-siri

...and specifically:

    <dependency>
      <groupId>org.onebusaway</groupId>
      <artifactId>onebusaway-siri-jetty</artifactId>
      <version>${onebusaway_siri_version}</version>
    </dependency>

...in that project. In theory we should be able to build this project and add the artifact to the new OBA Maven repo.

But, I tried building onebusaway-siri, but that project is also missing a few dependencies. The ones I can't seem to track down are:

      <dependency>
        <groupId>org.onebusaway</groupId>
        <artifactId>onebusaway-status-service</artifactId>
        <version>1.0.0-SNAPSHOT</version>
      </dependency>
    <dependency>
      <groupId>org.onebusaway</groupId>
      <artifactId>onebusaway-status-jetty-exporter</artifactId>
    </dependency>

I don't see the main project that has those artifactIds anywhere in the OBA GitHub organization.

If anyone can find this, please let me know and we can try to get this project building again.

I've added GitHub Actions to these projects to make it clearer that the build is currently failing and so that the error messages are easier to find (there is also a dependency on https://github.com/OneBusAway/onebusaway-siri-api-v13, but I've gotten that to build correctly).

dancesWithCycles commented 2 years ago

Hi Sean @barbeau , Thanks for the effort and the insights. I rather want to act as support than burden. So, please don't hesitate and let me know how I can support this activity. It is Eastern break in Lower Saxony right now. I'll be back on track afterwards.

Cheers!

dancesWithCycles commented 2 years ago

Hi Sean @barbeau , Is it possible, that the missing artifacts are modules in the status-exporter?

barbeau commented 2 years ago

@dancesWithCycles Oh, nice find, yes! I'm not sure why my GitHub search didn't pick that repo up earlier.

dancesWithCycles commented 2 years ago

Hi Sean @barbeau , Kudos! Thank you so much for your help. With your adjustments in place, this repo is building as expected.

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  17.649 s
[INFO] Finished at: 2022-04-17T16:05:00+02:00
[INFO] ------------------------------------------------------------------------

Cheers!

barbeau commented 2 years ago

Thanks @dancesWithCycles! I'm actually going to re-open this, as the CI is still failing: https://github.com/OneBusAway/onebusaway-gtfs-realtime-from-siri-cli/runs/6054673676?check_suite_focus=true

I believe it's because artifacts from this project aren't uploaded to the Cambridge Systematics Maven repo: https://github.com/OneBusAway/onebusaway-siri

The workaround for now (which I think you already did) is to run mvn install on the above project locally, and then this project should build.

abdullahahsun90 commented 7 months ago

Hi, I am able to successfully build. I imported project in eclipse and made it build adding all dependencies and i am able to export into running jar. Now in command line, i want to input siri xml file and want to see output. What command should i use. I inspected the "option" code but couldn't understand. Command line or when i run from eclipse, there is error that "You did not specify a trip updates, vehicle positions, or alerts output file or url."