在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):bmuschko/gradle-nexus-plugin开源软件地址(OpenSource Url):https://github.com/bmuschko/gradle-nexus-plugin开源编程语言(OpenSource Language):Groovy 100.0%开源软件介绍(OpenSource Introduction):Gradle Sonatype Nexus plugin
The plugin provides support for configuring and uploading artifacts to Sonatype Nexus. It can be configured to deploy to a self-hosted instance of Nexus or Sonatype OSS. The default setup is to publish to Sonatype OSS. Currently, Java and Groovy project artifact generation is supported. In addition to the JAR and POM file artifacts containing the JavaDocs and source files are created. Signing the artifacts is optional. UsageTo use the Sonatype Nexus plugin, include in your build script: apply plugin: 'com.bmuschko.nexus' The plugin JAR needs to be defined in the classpath of your build script. It is directly available on Bintray. Alternatively, you can download it from GitHub and deploy it to your local repository. The following code snippet shows an example on how to retrieve it from Maven Central: buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.bmuschko:gradle-nexus-plugin:2.3.1'
}
} TasksThe Nexus plugin can add three tasks to your project:
The output of all tasks is added to the Additionally, it applies the Maven plugin as well
as Extension propertiesThe plugin defines the following extension properties in the
The plugin defines the following extension properties in the
Additional configurationPOM customizationIn addition to the convention properties the automatically generated POM file can be modified. To provide the data for
the POM generation specify the information within the configuration element modifyPom {
project {
...
}
} CredentialsIn your nexusUsername = yourUsername
nexusPassword = yourPassword If you don't specify one of these properties, the plugin will prompt your for their values in the console. Example modifyPom {
project {
name 'Gradle Sonatype Nexus plugin'
description 'Gradle plugin that provides tasks for configuring and uploading artifacts to Sonatype Nexus.'
url 'https://github.com/bmuschko/gradle-nexus-plugin'
inceptionYear '2012'
scm {
url 'https://github.com/bmuschko/gradle-nexus-plugin'
connection 'scm:https://[email protected]/bmuschko/gradle-nexus-plugin.git'
developerConnection 'scm:git://github.com/bmuschko/gradle-nexus-plugin.git'
}
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
developers {
developer {
id 'bmuschko'
name 'Benjamin Muschko'
email '[email protected]'
}
}
}
}
extraArchive {
sources = false
tests = true
javadoc = false
}
nexus {
sign = true
repositoryUrl = 'http://localhost:8081/nexus/content/repositories/internal/'
snapshotRepositoryUrl = 'http://localhost:8081/nexus/content/repositories/internal-snapshots/'
} FAQHow do I publish my artifacts to the Central Repository aka Maven Central aka Sonatype OSS? By default the plugin is configured to upload your artifacts to the release and snapshot repository URLs of Sonatype OSS.
There's no additional configuration required. If you want to tweak the automatically generated POM file please you the
Is it possible to automatically publish artifacts to Maven Central without any manual steps in the Nexus GUI (e.g. from CI server)? It is beyond the scope of this plugin, but there is a dedicated 3rd-party plugin gradle-nexus-staging-plugin which allows for releasing and promoting artifacts to Maven Central directly from Gradle. It also seamlessly integrates with gradle-nexus-plugin (e.g. allows to reuse provided credentials). |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论