Skip to content

Commit

Permalink
doc: Fix references to the otp-shaded jar in doc.
Browse files Browse the repository at this point in the history
  • Loading branch information
t2gran committed Dec 10, 2024
1 parent c90aea1 commit f85cf52
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/performance-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
- name: Build graph
if: matrix.profile == 'core' || github.ref == 'refs/heads/dev-2.x'
run: |
cp shaded-jar/target/otp-*-SNAPSHOT-shaded.jar otp.jar
cp otp-shaded/target/otp-shaded-*-SNAPSHOT.jar otp.jar
java -Xmx32G -jar otp.jar --build --save test/performance/${{ matrix.location }}/
- name: Run speed test
Expand Down
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@ We run a speed test (included in the code) to measure the performance for every

## Repository layout

The main Java server code is in `application/src/main/`. OTP also includes a Javascript client based on the
MapLibre mapping library in `client/src/`. This client is now used for testing, with most major
deployments building custom clients from reusable components. The Maven build produces a unified ("shaded")
JAR file at `shaded-jar/target/otp-VERSION.jar` containing all necessary code and dependencies to run OpenTripPlanner.
The main Java server code is in `application/src/main/`. OTP also includes a Javascript client
based on the MapLibre mapping library in `client/src/`. This client is now used for testing, with
most major deployments building custom clients from reusable components. The Maven build produces a
unified ("shaded") JAR file at `otp-shaded/target/otp-shaded-VERSION.jar` containing all necessary
code and dependencies to run OpenTripPlanner.

Additional information and instructions are available in
the [main documentation](http://docs.opentripplanner.org/en/dev-2.x/), including a
Expand All @@ -59,7 +60,11 @@ the world.

## Getting in touch

The fastest way to get help is to use our [Gitter chat room](https://gitter.im/opentripplanner/OpenTripPlanner) where most of the core developers are. Bug reports may be filed via the Github [issue tracker](https://github.com/openplans/OpenTripPlanner/issues). The OpenTripPlanner [mailing list](http://groups.google.com/group/opentripplanner-users) is used almost exclusively for project announcements. The mailing list and issue tracker are not intended for support questions or discussions. Please use the chat for this purpose. Other details of [project governance](http://docs.opentripplanner.org/en/dev-2.x/Governance/) can be found in the main documentation.
The fastest way to get help is to use our [Gitter chat room](https://gitter.im/opentripplanner/OpenTripPlanner) where most of the core developers
are. Bug reports may be filed via the Github [issue tracker](https://github.com/openplans/OpenTripPlanner/issues). The OpenTripPlanner [mailing list](http://groups.google.com/group/opentripplanner-users)
is used almost exclusively for project announcements. The mailing list and issue tracker are not
intended for support questions or discussions. Please use the chat for this purpose. Other details
of [project governance](http://docs.opentripplanner.org/en/dev-2.x/Governance/) can be found in the main documentation.

## OTP Ecosystem

Expand Down
18 changes: 9 additions & 9 deletions doc/user/Basic-Tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ JAR containing all other libraries needed for OTP to work, and is available from
repository. You will be able to go
to [the OTP directory at Maven Central](https://repo1.maven.org/maven2/org/opentripplanner/otp/),
navigate to
the [directory of releases](https://repo1.maven.org/maven2/org/opentripplanner/otp/2.6.0/),
the [directory of releases](https://repo1.maven.org/maven2/org/opentripplanner/otp-shaded/2.7.0/),
and download
the [file with `shaded.jar` suffix](https://repo1.maven.org/maven2/org/opentripplanner/otp/2.6.0/otp-2.6.0-shaded.jar)
the [file with `otp-shaded` artifactId](https://repo1.maven.org/maven2/org/opentripplanner/otp-shaded/2.7.0/otp-shaded-2.7.0.jar)
.

You may also want to get your own copy of the OTP source code
Expand Down Expand Up @@ -95,7 +95,7 @@ for cropping and filtering OSM data.

## Starting OTP

A typical command to start OTP looks like `java -Xmx2G -jar otp.shaded.jar <options>`. The
A typical command to start OTP looks like `java -Xmx2G -jar otp-shaded-VERSION.jar <options>`. The
`-Xmx` parameter sets the limit on how much memory OTP is allowed to consume. GTFS and OSM data sets
are often very large, and OTP is relatively memory-hungry. You will need at least 1GB of memory when
working with the Portland TriMet data set, and several gigabytes for larger inputs.
Expand Down Expand Up @@ -129,7 +129,7 @@ below and in other tutorials.
The simplest way to use OTP is to build a graph in a single step and start a server immediately,
without saving it to disk. The command to do so is:

$ java -Xmx2G -jar otp-2.6.0-shaded.jar --build --serve /home/username/otp
$ java -Xmx2G -jar otp-shaded-2.7.0.jar --build --serve /home/username/otp

where `/home/username/otp` should be the directory where you put your configuration and input files.

Expand All @@ -154,13 +154,13 @@ build a graph from street and transit data then save it to a file using the `--b
command line parameters together. If for example your current working directory (`.`) contains the
input files and the OTP JAR file, you can use this command:

$ java -Xmx2G -jar otp-2.6.0-shaded.jar --build --save .
$ java -Xmx2G -jar otp-shaded-2.7.0.jar --build --save .

This will produce a file called `graph.obj` in the same directory as the inputs. The server can then
be started later using the `--load` parameter, and will read this file instead of building the graph
from scratch:

$ java -Xmx2G -jar otp-2.6.0-shaded.jar --load .
$ java -Xmx2G -jar otp-shaded-2.7.0.jar --load .

Another reason to perform these two phases separately is that the building process loads the entire
GTFS and OSM data sets into memory, so can require significantly more memory than just running a
Expand All @@ -177,16 +177,16 @@ graph once, and then layer transit data on top of the streets to make the final
Again assuming the input files and OTP JAR file are in the current working directory, you can build
a street graph with OSM and elevation data only (ignoring transit input files) with this command:

$ java -Xmx2G -jar otp-2.6.0-shaded.jar --buildStreet .
$ java -Xmx2G -jar otp-shaded-2.7.0.jar --buildStreet .

Then, to build a graph layering transit data on top of the saved street graph (built using the
previous command):

$ java -Xmx2G -jar otp-2.6.0-shaded.jar --loadStreet --save .
$ java -Xmx2G -jar otp-shaded-2.7.0.jar --loadStreet --save .

Finally, the server can be started using the `--load` parameter:

$ java -Xmx2G -jar otp-2.6.0-shaded.jar --load .
$ java -Xmx2G -jar otp-shaded-2.7.0.jar --load .

## Command Line Switches

Expand Down
2 changes: 1 addition & 1 deletion doc/user/Developers-Guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ Releases are performed off the master branch, and are tagged with git annotated

OpenTripPlanner is currently configured such that builds including releases upload JAR files to
GitHub Packages. This is not the most convenient place for end users to find and download the files.
Therefore we also attach a stand-alone "shaded" JAR to the GitHub tag/release page, and have
Therefore, we also attach a stand-alone "shaded" JAR to the GitHub tag/release page. We have
historically also uploaded Maven artifacts to Maven Central including compiled and source code JARs
as well as the "shaded" JAR containing all dependencies, allowing stand-alone usage. This release
process is handled by the Sonatype Nexus Staging plugin, which is no longer configured in the
Expand Down
25 changes: 11 additions & 14 deletions doc/user/Getting-OTP.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ OpenTripPlanner is distributed as a single stand-alone runnable JAR file. We cre
release page on GitHub for each release version, and also deploy them to the Maven Central
repository. You can go to
the [release pages on GitHub](https://github.com/opentripplanner/OpenTripPlanner/releases)
or [the OTP directory at Maven Central](https://repo1.maven.org/maven2/org/opentripplanner/otp/),
navigate to the highest version number, and download the file whose name ends with `shaded.jar`.
or [the OTP directory at Maven Central](https://repo1.maven.org/maven2/org/opentripplanner/otp-shaded/),
navigate to the highest version number, and download the jar file `otp-shaded-VERSION.jar`.

Note that version numbers like `v2.1.0-rc1` or `v2.6.0-SNAPSHOT` refer to development builds _
before_ the release version `v2.6.0`. The existence of a build `vX.Y.Z-SNAPSHOT` does not mean
Expand Down Expand Up @@ -64,8 +64,8 @@ OTP. If all goes well you should see a success message like the following:
[INFO] ------------------------------------------------------------------------
```

This build process should produce a JAR file called `otp-x.y.z-shaded.jar` in the
`shaded-jar/target/` directory which contains all the compiled OTP classes and their dependencies
This build process should produce a JAR file called `otp-shaded-x.y.z.jar` in the
`otp-shaded/target/` directory which contains all the compiled OTP classes and their dependencies
(the external libraries they use). The shell script called 'otp' in the root of the cloned repository
will start the main class of that JAR file under a Java virtual machine, so after the Maven build
completes you should be able to run `./otp --help` and see an OTP help message including command line
Expand All @@ -92,14 +92,11 @@ git clean -df
mvn clean package -DskipTests
```

Please note that the build process creates two distinct versions of the OTP JAR file. The one ending
in `-shaded.jar`
is much bigger because it contains copies of all the external libraries that OTP uses. It serves as
a stand-alone runnable distribution of OTP. The one with a version number but without the
word `shaded`
contains only OTP itself, without any external dependencies. This JAR is useful when OTP is included
as a component in some other project, where we want the dependency management system to gather all
the external libraries automatically.
Please note that the build process multiple jar files. The `otp-shaded-VERSION.jar` is much bigger
because it contains copies of all the external libraries that OTP uses. It serves as a stand-alone
runnable distribution of OTP. The other jar files are regular Java jar files. These JAR files are
useful when OTP is included as a component in some other project, where we want the dependency
management system to gather all the external libraries automatically.

## Maven Repository

Expand All @@ -110,8 +107,8 @@ file) to the Maven repository, from which it can be automatically included in ot

This repository is machine-readable (by Maven or other build systems) and also provides human
readable directory listings via HTTP. You can fetch an OTP JAR from this repository by constructing
the proper URL for the release you want. For example, release 2.6.0 will be found
at `https://repo1.maven.org/maven2/org/opentripplanner/otp/2.6.0/otp-2.6.0-shaded.jar`.
the proper URL for the release you want. For example, release 2.7.0 will be found
at `https://repo1.maven.org/maven2/org/opentripplanner/otp-shaded/2.7.0/otp-shaded-2.7.0-shaded.jar`.

To make use of OTP in another Maven project, you must specify it as a dependency in that
project's `pom.xml`:
Expand Down
2 changes: 1 addition & 1 deletion script/otp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
# Standalone OTP can build a graph, run an OTP API server,
# or any combination of these.

JAR_FILE="$(dirname $0)/target/${project.build.finalName}-shaded.jar"
JAR_FILE="$(dirname $0)/../otp-shaded/target/otp-shaded-2.7.0-SNAPSHOT.jar"

java -Xmx8G -jar "${JAR_FILE}" "$@"
5 changes: 3 additions & 2 deletions script/run-and-test-otp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ fi
# is not working as expected.
OTP_LOG=target/otp.log
RESPONSE_FILE=target/response.json
SHADED_TARGET=otp-shaded/target


if [ "$1" != "--skipCompile" ] && [ "$1" != "-c" ]; then
Expand All @@ -66,8 +67,8 @@ if [ "$1" != "--skipCompile" ] && [ "$1" != "-c" ]; then
fi

echo "Start OTP, output: $OTP_LOG"
mv target/otp-*-shaded.jar target/otp-shaded.jar
java -Xmx16G -jar target/otp-shaded.jar ${DATA_DIR} --build --save --serve > ${OTP_LOG} &
mv ${SHADED_TARGET}/otp-shaded-*.jar ${SHADED_TARGET}/otp-shaded.jar
java -Xmx16G -jar ${SHADED_TARGET}/otp-shaded.jar ${DATA_DIR} --build --save --serve > ${OTP_LOG} &
OTP_PID=$!

tail -F ${OTP_LOG} &
Expand Down

0 comments on commit f85cf52

Please sign in to comment.