This is a sample multi module gradle project to demo issues with artifactory gradle plugin:
-
The genrated pom.xml misses entries for runtimeOnly dependencies. In the present example, demo-impl has compile dependency on demo-client & demo-client has runtimeOnly dependency on demo-api. Notice that the final pom.xml of demo-client generated by artifactory plugin is missing dependency entry for demo-api completely. As a result of this, runtime exception occurs while running demo-impl.
-
This repo was setup to run with our internal Jenkins/Artifactory, followings has to be changed for this project to work with a different one:
- Jenkisfile:
- ARTIFACTORY = credentials('jenkins-artifactory-creds') --> applicable Jenkins credentials to be used.
- Docker image to build has to be changed.
- The publish stage has to be updated to use: correct ArtifactoryURL, repositories (resolve/deploy) and Artifactory Creds.
- gradle.properties: values to be set as applicable
- Jenkisfile:
-
Steps to reproduce the issue:
- Deploy all the project through Jenkins to artifactory plugin.
- Try to run the demo-impl project with following command: gradle :demo-impl:run
- Verify the pom.xml of "demo-client" in artifactory server.
-
Notes on jenkins-artifactory-plugin
- version: 2.16.1
- IVY descriptor deployment is enabled by default.
- artifactoryPublish doesn't seem to resolve inter module dependencies and that's why we need to execute the same twice (so that dependencies are already available while dependent artifact is being deployed).