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

Artifact Publishing & Subscription Topic Bug Fix #43

Merged
merged 10 commits into from
Sep 24, 2024

Conversation

dmccoystephenson
Copy link
Contributor

Artifact Publishing

This update adds a GitHub Action to publish Java artifacts to GitHub's hosted Maven Central repository.

Subscription Topic Bug Fix

This fix modifies the SDW-depositor to use the SDW_SUBSCRIPTION_TOPIC environment variable if it's set, instead of the default value. The changes were tested locally with Docker, and all existing unit tests were verified to pass successfully.

@dmccoystephenson dmccoystephenson marked this pull request as ready for review September 9, 2024 16:26
To use this library in another application, add the GitHub package URLs to the `repositories` section in `pom.xml` of the consumer application or in your local `~/.m2/settings.xml` file. Here is an example implementation of using the GitHub artifact in a consumer application:

```xml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we adding this xml in either the pom.xml or ~/.m2/settings.xml? Then add the following xml in pom.xml or build.gradle to allow the client application find this library? Could we add a bit detail why doing this below would work? What is the difference between adding xml to pom.xml and settings.xml?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The options to authenticate to Github Maven Artifacts are to include the repository along with a read token in the pom.xml source code itself or in the supplied settings.xml config supplied to the build process. In general, the default settings.xml file is found in the user's home directory ~/.m2/settings.xml but it can also be included as a build argument.

The method that the client application uses to obtain the library jar file is completely up to the client. I have done a few tests with the jpo-geojsonconverter application, and I am leaning toward using a supplemental settings.xml file to the build process. It would change the maven build from:

mvn clean install -DskipTests

to:

mvn -s settings.xml clean install -DskipTests

The only difference is where the configuration is applied. I still need to do some testing to figure out the best method to implement this with the docker build pipeline while also keeping the access token secret.

## GitHub Artifact Usage

To use this library in another application, add the GitHub package URLs to the `repositories` section in `pom.xml` of the consumer application or in your local `~/.m2/settings.xml` file. Here is an example implementation of using the GitHub artifact in a consumer application:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GitHub package URLs referring to the whole xml?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not exactly, the GitHub package URLs only refers to the URL where you want to pull the specified package from. This needs to be set properly in the url field of the xml configuration:

<settings>
  <profiles>
    <profile>
      <repositories>
        <repository>
          <url>https://maven.pkg.github.com/usdot-jpo-ode/jpo-sdw-depositor</url>
        </repository>
      </repositories>
    </profile>
  </profiles>
</settings>

@dmccoystephenson dmccoystephenson marked this pull request as draft September 19, 2024 22:06
@dmccoystephenson dmccoystephenson marked this pull request as ready for review September 23, 2024 19:40
@dan-du-car dan-du-car merged commit f4d5835 into usdot-jpo-ode:develop Sep 24, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants