How to set GROUP and VERSION using the base plugin
See original GitHub issueHello,
I’m trying to use the base plugin, because I want to publish and Android library to MavenCentral without source code and without Javadoc.
Version is com.vanniktech:gradle-maven-publish-plugin:0.18.0
Here is my configuration:
Main build.gradle file
allprojects {
plugins.withId("com.vanniktech.maven.publish.base") {
GROUP = "my.group"
VERSION = "1.0.0"
mavenPublishing {
publishToMavenCentral("S01")
pomFromGradleProperties()
signAllPublications()
}
}
}
Project build.gradle file
import com.vanniktech.maven.publish.AndroidLibrary
import com.vanniktech.maven.publish.JavadocJar
apply plugin: "com.vanniktech.maven.publish.base"
mavenPublishing {
configure(new AndroidLibrary(new JavadocJar.Empty(), false))
}
Result
I get this error:
groovy.lang.MissingPropertyException: Could not set unknown property ‘VERSION’
If GROUP and VERSION are not set (if I comment out the 2 lines), when publishing using this command:
./gradlew publish --no-daemon --no-parallel
I get this error:
Could not PUT 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/android/project/unspecified/project-unspecified.aar'. Received status code 400 from server: Bad Request
it seems that group and version (= “unspecified”) are not correct in this path.
Using the main plugin, it works fine, but Javadoc and source code are also published, and I cannot find a way to disable this using the main plugin.
Thanks!
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
The Base Plugin
The Base Plugin adds the base extension to the project. This allows to configure the following properties inside a dedicated DSL block. Example...
Read more >How to set the project name/group/version, plus {source ...
settings.gradle: rootProject.name = theName. build.gradle: apply plugin: "java" group = theGroup version = theVersion sourceCompatibility = ...
Read more >Gradle - Plugins
The plugins can do the things such as −. Extend the basic Gradle model (e.g. add new DSL elements that can be configured)....
Read more >Gradle tips and recipes
Gradle and the Android plugin allow you to create different versions of your app from a single module by configuring build variants. Configure...
Read more >Introduction to writing Gradle plugins
id 'org.springframework.boot' version '2.5.4' ... For example, with the Java plugin you can configure tests to be included or excluded by ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks, sorry, I was not able to test this earlier, but it’s working great! Thanks @Ahmad-Hamwi for the PR 😃
@Ahmad-Hamwi mind creating a PR to fix the documentation?