girishaiocdawacs / awacs-cloud-commons

Standalone java libraries to work with awacs cloud
0 stars 1 forks source link

Maven deploy mismatch urls while upload and download #1

Closed girishaiocdawacs closed 3 years ago

girishaiocdawacs commented 3 years ago

Module - smart-pharmacy-evevnt-management (java artifact uploaded to github package https://maven.pkg.github.com/girishaiocdawacs/smart-pharmacy-event-management/)

[INFO] --- maven-deploy-plugin:2.8.2:deploy (default-deploy) @ cloud-event-publisher-gcp-pubsub ---
[INFO] Using alternate deployment repository gh::default::https://maven.pkg.github.com/girishaiocdawacs/smart-pharmacy-event-management
[INFO] Uploading to gh: https://maven.pkg.github.com/girishaiocdawacs/smart-pharmacy-event-management/com/aiocdawacs/cloud-event-publisher-gcp-pubsub/1.0.5/cloud-event-publisher-gcp-pubsub-1.0.5.jar
[INFO] Uploaded to gh: https://maven.pkg.github.com/girishaiocdawacs/smart-pharmacy-event-management/com/aiocdawacs/cloud-event-publisher-gcp-pubsub/1.0.5/cloud-event-publisher-gcp-pubsub-1.0.5.jar (9.4 kB at 7.5 kB/s)
[INFO] Uploading to gh: https://maven.pkg.github.com/girishaiocdawacs/smart-pharmacy-event-management/com/aiocdawacs/cloud-event-publisher-gcp-pubsub/1.0.5/cloud-event-publisher-gcp-pubsub-1.0.5.pom
[INFO] Uploaded to gh: https://maven.pkg.github.com/girishaiocdawacs/smart-pharmacy-event-management/com/aiocdawacs/cloud-event-publisher-gcp-pubsub/1.0.5/cloud-event-publisher-gcp-pubsub-1.0.5.pom (2.8 kB at 2.5 kB/s)
[INFO] Downloading from gh: https://maven.pkg.github.com/girishaiocdawacs/smart-pharmacy-event-management/com/aiocdawacs/cloud-event-publisher-gcp-pubsub/maven-metadata.xml
[INFO] Downloaded from gh: https://maven.pkg.github.com/girishaiocdawacs/smart-pharmacy-event-management/com/aiocdawacs/cloud-event-publisher-gcp-pubsub/maven-metadata.xml (334 B at 707 B/s)
[INFO] Uploading to gh: https://maven.pkg.github.com/girishaiocdawacs/smart-pharmacy-event-management/com/aiocdawacs/cloud-event-publisher-gcp-pubsub/maven-metadata.xml
[INFO] Uploaded to gh: https://maven.pkg.github.com/girishaiocdawacs/smart-pharmacy-event-management/com/aiocdawacs/cloud-event-publisher-gcp-pubsub/maven-metadata.xml (464 B at 1.8 kB/s)

Module - smart pharmacy product service expected to look here -

[INFO] Building smart-pharmacy-product-service 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from github: https://maven.pkg.github.com/girishaiocwacs/com/aiocdawacs/cloud-event-publisher-gcp-pubsub/1.0.5/cloud-event-publisher-gcp-pubsub-1.0.5.pom
Downloading from github: https://maven.pkg.github.com/girishaiocwacs/com/aiocdawacs/cloud-event-publisher-gcp-pubsub/1.0.5/cloud-event-publisher-gcp-pubsub-1.0.5.jar

Failing product service so embedding code for pubsub into the product service directly now.

Issue with maven oss is the url mismatch. Uploading artifact package is working fine however, Downloading from github is messing up with url. This is the maven deploy command.

REPO="gh::default::https://maven.pkg.github.com/girishaiocdawacs/" mvn -B clean deploy -DaltReleaseDeploymentRepository="${REPO}" -DaltSnapshotDeploymentRepository="${REPO}"

girishaiocdawacs commented 3 years ago

cat ~/.m2/settings.xml

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                      http://maven.apache.org/xsd/settings-1.0.0.xsd">

  <activeProfiles>
    <activeProfile>github</activeProfile>
  </activeProfiles>

  <profiles>
    <profile>
      <id>github</id>
      <repositories>
        <repository>
          <id>central</id>
          <url>https://repo1.maven.org/maven2</url>
          <releases><enabled>true</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </repository>
        <repository>
          <id>github</id>
          <name>GitHub Maven Packages</name>
          <url>https://maven.pkg.github.com/girishaiocdawacs</url>
        </repository>

      <!-- workaround fix is -->
       <!-- https://github.com/girishaiocdawacs/smart-pharmacy-event-management/issues/1 -->    
         <repository>
          <id>github</id>
          <name>GitHub Maven Packages</name>
          <url>https://maven.pkg.github.com/girishaiocdawacs/smart-pharmacy-event-management</url>
        </repository>
      </repositories>
    </profile>
  </profiles>

  <servers>
    <server>
      <id>github</id>
      <username>${env.GITHUB_USERNAME}</username>
      <password>${env.GITHUB_TOKEN}</password>
    </server>
  </servers>
</settings>
girishaiocdawacs commented 3 years ago

Mind. URL changed From

https://maven.pkg.github.com/girishaiocdawacs/smart-pharmacy-event-management

To

https://maven.pkg.github.com/girishaiocdawacs/awacs-cloud-commons