Skip to content

Commit

Permalink
Add info for publishing an ivy descriptor
Browse files Browse the repository at this point in the history
  • Loading branch information
OdysseusLives committed Nov 1, 2018
1 parent cc2965a commit 42f19ac
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 39 deletions.
40 changes: 1 addition & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,4 @@ Nebula Nothing Plugin
=====================
Just does nothing. But does serve as a decent template for projects.

---

## Generate the pom file used for plugin publishing

> **About the [`java-gradle-plugin`](https://docs.gradle.org/current/userguide/java_gradle_plugin.html)**
> The Java Gradle Plugin development plugin can be used to assist in the development of Gradle plugins.
The `java-gradle-plugin` generates a plugin publishing task, which we invoke to view the pom file used at plugin publication time:

```sh
./gradlew generatePomFileForPluginMavenPublication
```

**More information:**

The `java-gradle-plugin` configures the MavenPluginPublishPlugin and the IvyPluginPublishPlugin when [`maven-publish`](https://github.com/gradle/gradle/blob/master/subprojects/plugin-development/src/main/java/org/gradle/plugin/devel/plugins/JavaGradlePluginPlugin.java#L186) or [`ivy-publish`](https://github.com/gradle/gradle/blob/master/subprojects/plugin-development/src/main/java/org/gradle/plugin/devel/plugins/JavaGradlePluginPlugin.java#L192) plugins are applied.

The MavenPluginPublishPlugin creates the [`pluginMaven`](https://github.com/gradle/gradle/blob/master/subprojects/plugin-development/src/main/java/org/gradle/plugin/devel/plugins/MavenPluginPublishPlugin.java#L73) publication that is then used for publishing the plugin.

## See which publications are available

Add the following to your build.gradle to see which publications are available:

**build.gradle**
```groovy
task availablePublications {
project.tasks.each { task ->
task.doLast {
publishing.publications.each { println "Task ${task.path} knows about publication named '${it.name}'"}
}
}
}
```

and invoke with:

```sh
./gradlew availablePublications
```
See info about publishing at [publishing-info](./publishing-info.md)
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id "nebula.plugin-plugin" version "9.1.3"
id "nebula.maven-publish" version "9.2.0"
id "nebula.ivy-publish" version "9.2.0"
id 'java-gradle-plugin'
}

Expand Down
48 changes: 48 additions & 0 deletions publishing-info.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
## Generate the pom file used for plugin publishing

> **About the [`java-gradle-plugin`](https://docs.gradle.org/current/userguide/java_gradle_plugin.html)**
> The Java Gradle Plugin development plugin can be used to assist in the development of Gradle plugins.
The `java-gradle-plugin` generates a plugin publishing task, which we invoke to view the pom file used at plugin publication time:

```sh
./gradlew generatePomFileForPluginMavenPublication
```

**More information:**

The `java-gradle-plugin` configures the MavenPluginPublishPlugin and the IvyPluginPublishPlugin when [`maven-publish`](https://github.com/gradle/gradle/blob/master/subprojects/plugin-development/src/main/java/org/gradle/plugin/devel/plugins/JavaGradlePluginPlugin.java#L186) or [`ivy-publish`](https://github.com/gradle/gradle/blob/master/subprojects/plugin-development/src/main/java/org/gradle/plugin/devel/plugins/JavaGradlePluginPlugin.java#L192) plugins are applied.

The MavenPluginPublishPlugin creates the [`pluginMaven`](https://github.com/gradle/gradle/blob/master/subprojects/plugin-development/src/main/java/org/gradle/plugin/devel/plugins/MavenPluginPublishPlugin.java#L73) publication that is then used for publishing the plugin.

## See which publications are available

Add the following to your build.gradle to see which publications are available:

**build.gradle**
```groovy
task availablePublications {
project.tasks.each { task ->
task.doLast {
publishing.publications.each { println "Task ${task.path} knows about publication named '${it.name}'"}
}
}
}
```

and invoke with:

```sh
./gradlew availablePublications
```

---

## Useful publishing commands to preview generated pom-file/ivy-descriptor

- publication used for the Gradle plugin portal: `generatePomFileForPluginMavenPublication`
- used by Gradle's `java-gradle-plugin`
- publication used for internal or local maven repository: `generatePomFileForNebulaPublication`
- used by Gradle's [`maven-publish`](https://docs.gradle.org/current/userguide/publishing_maven.html#publishing_maven:tasks)
- publication used for internal or local ivy repositoy: `generateDescriptorFileForPluginIvyPublication`
- used by Gradle's [`ivy-publish`](https://docs.gradle.org/current/userguide/publishing_ivy.html#publishing_ivy:tasks)

0 comments on commit 42f19ac

Please sign in to comment.