Skip to content

deploy SNAPSHOTs to OSSRH in travis CI #198

Closed

Description

@hohwille

As a devon4j user/developer, I want to make SNAPSHOT versions publically available so that they can be easily accessed in other builds or for externals who want to test an upcoming release that is WIP.

Therefore we should do the following:

  • extend maven-parent with snapshot repo pointing to OSSRH and release update
  • update devon4j to that maven-parent
  • extend .travis.yml of devon4j to deploy SNAPSHOTS to OSSRH

Then even MTS can use intermediate SNAPSHOT versions of devon4j in CI.

Activity

  1. added
    enhancementNew feature or request
    SCMSoftware-configuration-management (maven, travis, etc.)
    on Jan 28, 2020
  2. added this to the release:3.3.0 milestone on Jan 28, 2020
  3. added 8 commits that reference this issue on Mar 3, 2020
  4. hohwille commented on Mar 5, 2020

    @hohwille
    MemberAuthor

    Travis now procudes such build:

    [INFO] --- maven-deploy-plugin:2.8.2:deploy (default-deploy) @ devon4j ---
    Downloading from repository: https://oss.sonatype.org/content/repositories/snapshots/com/devonfw/java/dev/devon4j/dev-SNAPSHOT/maven-metadata.xml
    Downloaded from repository: https://oss.sonatype.org/content/repositories/snapshots/com/devonfw/java/dev/devon4j/dev-SNAPSHOT/maven-metadata.xml (602 B at 155 B/s)
    Uploading to repository: https://oss.sonatype.org/content/repositories/snapshots/com/devonfw/java/dev/devon4j/dev-SNAPSHOT/devon4j-dev-20200305.140849-19.pom
    Uploaded to repository: https://oss.sonatype.org/content/repositories/snapshots/com/devonfw/java/dev/devon4j/dev-SNAPSHOT/devon4j-dev-20200305.140849-19.pom (2.3 kB at 9.4 kB/s)
    Downloading from repository: https://oss.sonatype.org/content/repositories/snapshots/com/devonfw/java/dev/devon4j/maven-metadata.xml
    Downloaded from repository: https://oss.sonatype.org/content/repositories/snapshots/com/devonfw/java/dev/devon4j/maven-metadata.xml (285 B at 4.1 kB/s)
    Uploading to repository: https://oss.sonatype.org/content/repositories/snapshots/com/devonfw/java/dev/devon4j/dev-SNAPSHOT/maven-metadata.xml
    Uploaded to repository: https://oss.sonatype.org/content/repositories/snapshots/com/devonfw/java/dev/devon4j/dev-SNAPSHOT/maven-metadata.xml (602 B at 1.7 kB/s)
    Uploading to repository: https://oss.sonatype.org/content/repositories/snapshots/com/devonfw/java/dev/devon4j/maven-metadata.xml
    Uploaded to repository: https://oss.sonatype.org/content/repositories/snapshots/com/devonfw/java/dev/devon4j/maven-metadata.xml (285 B at 1.3 kB/s)
    
    ...
    
    [INFO] ------------------------------------------------------------------------
    [INFO] Reactor Summary:
    [INFO] 
    [INFO] devon4j ............................................ SUCCESS [  7.743 s]
    [INFO] devon4j-boms ....................................... SUCCESS [  2.086 s]
    [INFO] devon4j-minimal-bom ................................ SUCCESS [  5.410 s]
    [INFO] devon4j-bom ........................................ SUCCESS [  7.137 s]
    [INFO] devon4j-modules .................................... SUCCESS [  1.063 s]
    [INFO] devon4j-test ....................................... SUCCESS [  2.921 s]
    [INFO] devon4j-logging .................................... SUCCESS [  2.174 s]
    [INFO] devon4j-basic ...................................... SUCCESS [  9.232 s]
    [INFO] devon4j-beanmapping ................................ SUCCESS [  8.136 s]
    [INFO] devon4j-beanmapping-orika .......................... SUCCESS [  8.836 s]
    [INFO] devon4j-beanmapping-dozer .......................... SUCCESS [  2.476 s]
    [INFO] devon4j-service .................................... SUCCESS [  1.877 s]
    [INFO] devon4j-json ....................................... SUCCESS [  2.544 s]
    [INFO] devon4j-rest ....................................... SUCCESS [  2.115 s]
    [INFO] devon4j-cxf-client ................................. SUCCESS [  8.725 s]
    [INFO] devon4j-cxf-client-rest ............................ SUCCESS [  8.649 s]
    [INFO] devon4j-cxf-client-ws .............................. SUCCESS [  7.659 s]
    [INFO] devon4j-cxf-server ................................. SUCCESS [  2.281 s]
    [INFO] devon4j-cxf-server-rest ............................ SUCCESS [  2.972 s]
    [INFO] devon4j-cxf-server-ws .............................. SUCCESS [  7.643 s]
    [INFO] devon4j-security ................................... SUCCESS [  3.382 s]
    [INFO] devon4j-jpa-basic .................................. SUCCESS [  2.340 s]
    [INFO] devon4j-jpa-dao .................................... SUCCESS [  6.178 s]
    [INFO] devon4j-jpa-envers ................................. SUCCESS [  8.145 s]
    [INFO] devon4j-jpa-spring-data ............................ SUCCESS [  2.198 s]
    [INFO] devon4j-test-jpa ................................... SUCCESS [ 10.203 s]
    [INFO] devon4j-batch ...................................... SUCCESS [  2.129 s]
    [INFO] devon4j-batch-tool ................................. SUCCESS [ 14.019 s]
    [INFO] devon4j-web ........................................ SUCCESS [  1.762 s]
    [INFO] devon4j-starters ................................... SUCCESS [  1.176 s]
    [INFO] devon4j-starter-cxf-client ......................... SUCCESS [  6.448 s]
    [INFO] devon4j-starter-cxf-client-rest .................... SUCCESS [  3.681 s]
    [INFO] devon4j-starter-cxf-client-ws ...................... SUCCESS [  6.501 s]
    [INFO] devon4j-starter-cxf-server ......................... SUCCESS [  8.844 s]
    [INFO] devon4j-starter-cxf-server-rest .................... SUCCESS [  1.990 s]
    [INFO] devon4j-starter-cxf-server-ws ...................... SUCCESS [  2.040 s]
    [INFO] devon4j-starter-spring-data-jpa .................... SUCCESS [  2.635 s]
    [INFO] devon4j-templates .................................. SUCCESS [  7.606 s]
    [INFO] devon4j-template-server ............................ SUCCESS [ 14.747 s]
    [INFO] devon4j-doc ........................................ FAILURE [ 51.995 s]
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 04:21 min
    [INFO] Finished at: 2020-03-05T14:13:01Z
    [INFO] Final Memory: 170M/897M
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-deploy) on project devon4j-doc: Failed to deploy artifacts: Could not transfer artifact com.devonfw.java.doc:devon4j-doc:pom:3.3.0-20200305.141301-1 from/to snapshot-repository (https://oss.sonatype.org/content/repositories/snapshots/): Failed to transfer file: https://oss.sonatype.org/content/repositories/snapshots/com/devonfw/java/doc/devon4j-doc/3.3.0-SNAPSHOT/devon4j-doc-3.3.0-20200305.141301-1.pom. Return code is: 401, ReasonPhrase: Unauthorized. -> [Help 1]
    
  5. hohwille commented on Mar 5, 2020

    @hohwille
    MemberAuthor

    So the deployment succeeded for all artifacts except the last one which is devon4j-doc that failed with 401.
    So if the other deployments succeeded the secrets and credentials have to be correct. So why on earth should the last artifact get a 401. This does not make any sense to me. Any ideas?

    BTW: I also considered using a new travis stage for the deployment but unfortunately every stage runs in a seprate container and therefore previous results would be lost. That would lead to duplicated build efforts and longer build times. Hence, I sticked to the approach that worked best for me from the mmm project (with somewhat ugly && and || chained commands in the script).

  6. added a commit that references this issue on Mar 6, 2020
  7. hohwille commented on Mar 6, 2020

    @hohwille
    MemberAuthor

    So why on earth should the last artifact get a 401. This does not make any sense to me. Any ideas?

    I figured it out myself:
    The parent of devon4j-doc is not pointing to devon4j but to devonfw-docgen-pdf
    https://github.com/devonfw/devon4j/blob/develop/documentation/pom.xml#L7
    That POM has devonfw-docgen as parent in version 5.0.0 :
    view-source:https://repo1.maven.org/maven2/com/devonfw/tools/devonfw-docgen/5.0.0/devonfw-docgen-5.0.0.pom
    And that POM points to devonfw-maven-parent in version 2:
    https://repo1.maven.org/maven2/com/devonfw/maven-parent/2/maven-parent-2.pom

    As you can see in version 2 the repository IDs have still been different:

    <id>snapshot-repository</id>
    

    Hence I first have to update docgen and push out a new release.

  8. added a commit that references this issue on Mar 6, 2020
  9. hohwille commented on Mar 6, 2020

    @hohwille
    MemberAuthor

    Yep. Analysis was correct. Fix confirmed. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    SCMSoftware-configuration-management (maven, travis, etc.)enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions