publishing to Artifactory

439 views
Skip to first unread message

Bryan Hunt

unread,
May 2, 2017, 2:32:07 PM5/2/17
to bndtool...@googlegroups.com
I need to publish our bundles to Artifactory. I’m getting the following error:

Execution failed for task ':com.nvidia.gpuwa.web.security.jwt:artifactoryPublish'.
> File '/Users/bhunt/Documents/Nvidia/Code/NVServiceUtils/com.nvidia.gpuwa.app.config/generated/com.nvidia.gpuwa.app.config-1.0.6.jar' does not exist, and need to be published from publication mavenJava

The error occurs because the jar file does not contain the version in the name. Does anyone have an example on how to set this up. Here’s what I’ve done in the root build.gradle mostly a cut/paste from another example I found:

/*
* Master Gradle build script
*
* Depends on bndPlugin property set by settings.gradle.
* and bnd_* values from gradle.properties.
*/

import aQute.bnd.build.Workspace
import aQute.bnd.osgi.Constants

/* Add bnd gradle plugin as a script dependency */
buildscript {
repositories {
jcenter()
}

dependencies {
classpath bndPlugin, "org.jfrog.buildinfo:build-info-extractor-gradle:latest.release"
}
}

/* Initialize the bnd workspace */
Workspace.setDriver(Constants.BNDDRIVER_GRADLE)
Workspace.addGestalt(Constants.GESTALT_BATCH, null)
ext.bndWorkspace = new Workspace(rootDir, bnd_cnf)
if (bndWorkspace == null) {
throw new GradleException("Unable to load workspace ${rootDir}/${bnd_cnf}")
}

ext.cnf = rootProject.project(bnd_cnf)

apply plugin: 'com.jfrog.artifactory'

artifactory {
contextUrl = 'http://***************'
publish {
repository {
repoKey = 'gpuwa-libs-releases'
username = ‘************'
password = ‘**********'
}
defaults {
publications('mavenJava')
publishArtifacts = true
publishPom = true
}
}
}

artifactoryPublish.skip=true

/* Configure the subprojects */
subprojects {
repositories {
jcenter()
}

def bndProject = bndWorkspace.getProject(name)
if (bndProject != null) {
plugins.apply 'biz.aQute.bnd'
plugins.apply 'jacoco'
plugins.apply 'com.jfrog.artifactory'
plugins.apply 'maven-publish'
group = 'com.nvidia.gpuwa'

jacoco {
toolVersion = "0.7.7.201606060606"
}

publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact(file("$rootDir/gradle.properties"))
}
}
}
}
}

task wrapper(type: Wrapper) {
jarFile = rootProject.file('.gradle-wrapper/gradle-wrapper.jar')
}

BJ Hargrave

unread,
May 2, 2017, 2:38:20 PM5/2/17
to bndtool...@googlegroups.com
Since you using a Bnd Workspace build, why don't you just release through a MavenBndRepository configured as the release repo? I would assume artifactory will look like a nexus repo?

I am not sure how what you have tried would work. I don't have any experience doing that.

--
You received this message because you are subscribed to the Google Groups "bndtools-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
BJ

Bryan Hunt

unread,
May 2, 2017, 2:46:16 PM5/2/17
to bndtool...@googlegroups.com
Yes, I just read that the MavenBndRepository supports doing a release.  I’ll try that - looks much easier.
Reply all
Reply to author
Forward
0 new messages