Skip to content

Commit

Permalink
Migrate code to gradlex namespace
Browse files Browse the repository at this point in the history
Resolves #203
  • Loading branch information
britter committed Jan 7, 2025
1 parent 4a4dfdd commit 6d4a47c
Show file tree
Hide file tree
Showing 38 changed files with 79 additions and 140 deletions.
17 changes: 9 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,24 @@ Consequently, this is a breaking release with features being dropped, plugin ID
The minimal required Gradle version has been increased to 7.0.
Lower versions of Gradle might be supported but are not tested.

* [Fixed] [#57](https://github.com/britter/maven-plugin-development/issues/57) Remove javaClassesDir from GenerateMavenPluginDescriptorTask.
* [Fixed] [#210](https://github.com/britter/maven-plugin-development/issues/210) Drop feature: Mojo source set.
* [Fixed] [#57](https://github.com/gradlex-org/maven-plugin-development/issues/57) Remove javaClassesDir from GenerateMavenPluginDescriptorTask.
* [Fixed] [#210](https://github.com/gradlex-org/maven-plugin-development/issues/210) Drop feature: Mojo source set.
It's no longer possible to define a dedicated source set for defining the mojo.
Use a dedicated project instead.
* [Fixed] [#212](https://github.com/britter/maven-plugin-development/issues/212) Drop feature: Finding mojos in project dependencies.
* [Fixed] [#212](https://github.com/gradlex-org/maven-plugin-development/issues/212) Drop feature: Finding mojos in project dependencies.
The plugin no longer searches for mojo implementations in dependent projects since this is not the way of modelling aggregation of build results in Gradle.
Users who rely on this use case should instead apply this plugin to all projects with mojo implementations, set up a variant that exposes the descriptor, and then merge all exposed descriptor variants in an aggregator project.
* [Fixed] [209](https://github.com/britter/maven-plugin-development/issues/209) Drop feature: Mojo DSL.
* [Fixed] [209](https://github.com/gradlex-org/maven-plugin-development/issues/209) Drop feature: Mojo DSL.
This feature was dropped without replacement.
Annotate mojos using annotations defined in `org.apache.maven.plugin-tools:maven-plugin-annotations` instead of declaring them in your build script.
* [Fixed] [278](https://github.com/britter/maven-plugin-development/issues/278) Remove deprecated code.
* [Fixed] [278](https://github.com/gradlex-org/maven-plugin-development/issues/278) Remove deprecated code.
In particular this the `generateHelpMojo` property was removed.
Users should configure `helpMojoPackage` with the desired target package for the generated help mojo.
* [Fixed] [8](https://github.com/britter/maven-plugin-development/issues/278) Support configuration cache.
* [Fixed] [38](https://github.com/britter/maven-plugin-development/issues/278) Don't use Property for lazy types.
* [Fixed] [8](https://github.com/gradlex-org/maven-plugin-development/issues/278) Support configuration cache.
* [Fixed] [38](https://github.com/gradlex-org/maven-plugin-development/issues/278) Don't use Property for lazy types.
Instead of declaring fields of type `Property<FileCollection>` the `GenerateMavenPluginDescriptorTask` not declares fields of type `ConfigurableFileCollection`, which is more idiomatic.
* [Fixed] [78](https://github.com/britter/maven-plugin-development/issues/78) Migration to Java.
* [Fixed] [78](https://github.com/gradlex-org/maven-plugin-development/issues/78) Migration to Java.
* [Fixed] [203](https://github.com/gradlex-org/maven-plugin-development/issues/203) Migration to GradleX namespace.

## Version 0.4.3

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ Compatible with Gradle 7.3 or later.

## Usage

Please see the [plugin documentation](https://britter.github.io/maven-plugin-development).
For a self-contained example please the [example folder](https://github.com/britter/maven-plugin-development/tree/main/sample).
Please see the [plugin documentation](https://gradlex.org/maven-plugin-development).
For a self-contained example please the [example folder](https://github.com/gradlex-org/maven-plugin-development/tree/main/sample).

## How to release

Expand Down
22 changes: 10 additions & 12 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
alias(libs.plugins.gitPublish)
}

group = "de.benediktritter"
group = " org.gradlex"
description = "Gradle plugin for developing Apache Maven plugins"

java {
Expand Down Expand Up @@ -97,8 +97,6 @@ tasks {
"sectanchors" to true,
"idprefix" to "",
"idseparator" to "-",
"gh-issue" to "https://github.com/britter/maven-plugin-development/issues/",
"gh-pr" to "https://github.com/britter/maven-plugin-development/pull/",
"snippets-path" to "$projectDir/src/docs/snippets"
))
}
Expand All @@ -108,13 +106,13 @@ tasks {
}

gradlePlugin {
website.set("https://britter.github.io/maven-plugin-development")
vcsUrl.set("https://github.com/britter/maven-plugin-development")
website.set("https://gradlex.org/maven-plugin-development")
vcsUrl.set("https://github.com/gradlex-org/maven-plugin-development")
plugins.create("mavenPluginDevelopment") {
id = "de.benediktritter.maven-plugin-development"
id = "org.gradlex.maven-plugin-development"
displayName = "Maven plugin development plugin"
description = project.description
implementationClass = "de.benediktritter.maven.plugin.development.MavenPluginDevelopmentPlugin"
implementationClass = "org.gradlex.maven.plugin.development.MavenPluginDevelopmentPlugin"
tags.set(listOf("maven", "mojo", "maven plugin"))
}
}
Expand All @@ -123,17 +121,17 @@ publishing {
publications.withType<MavenPublication>() {
pom {
description.set(project.description)
url.set("https://github.com/britter/maven-development-plugin")
url.set("https://github.com/gradlex-org/maven-development-plugin")
licenses {
license {
name.set("Apache-2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
scm {
connection.set("scm:git:git://github.com/britter/maven-development-plugin.git")
developerConnection.set("scm:git:ssh://github.com/britter/maven-development-plugin.git")
url.set("https://github.com/britter/maven-development-plugin")
connection.set("scm:git:git://github.com/gradlex-org/maven-development-plugin.git")
developerConnection.set("scm:git:ssh://github.com/gradlex-org/maven-development-plugin.git")
url.set("https://github.com/gradlex-org/maven-development-plugin")
}
}
}
Expand All @@ -142,7 +140,7 @@ publishing {
val asciidoctor by tasks.existing

gitPublish {
repoUri.set("https://github.com/britter/maven-plugin-development")
repoUri.set("https://github.com/gradlex-org/maven-plugin-development")
branch.set("gh-pages")
sign.set(false)

Expand Down
2 changes: 1 addition & 1 deletion sample/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Then you can run the Maven build in `maven-consumer-build` folder:
## Publishing the plugin to a remote repository

The `gradle-producer-build` also contains some configuration to publish to another repository.
In this case the repository URI of the `buildFolder` repository points into the build folder of the project (see [`gradle-producer-build/build.gradle.kts`](https://github.com/britter/maven-plugin-development/blob/master/example/gradle-producer-build/build.gradle.kts)).
In this case the repository URI of the `buildFolder` repository points into the build folder of the project (see [`gradle-producer-build/build.gradle.kts`](https://github.com/gradlex-org/maven-plugin-development/blob/master/example/gradle-producer-build/build.gradle.kts)).
By running `gradle publishMavenPluginPublicationToBuildFolderRepository` you can publish the plugin to the `buildFolder` repository.
This should result in the following file tree (timestamps in filenames will be different):

Expand Down
8 changes: 4 additions & 4 deletions src/docs/asciidoc/parts/plugin-usage.adoc
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
Once applied, the plugin adds a https://github.com/britter/maven-plugin-development/blob/0.1.0/src/main/kotlin/de/benediktritter/maven/plugin/development/MavenPluginDevelopmentExtension.kt[`MavenPluginDevelopmentExtension`] with name `mavenPlugin` to the project.
All meta data for the plugin, e.g. `groupId`, `artifactId`, `description` is extracted from the corresponding project properties.
Once applied, the plugin adds a https://github.com/gradlex-org/maven-plugin-development/blob/main/src/main/java/org/gradlex/maven/plugin/development/MavenPluginDevelopmentExtension.java[`MavenPluginDevelopmentExtension`] with name `mavenPlugin` to the project.
All metadata for the plugin, e.g. `groupId`, `artifactId`, `description` is extracted from the corresponding project properties.

[source.multi-language-sample,groovy,subs="attributes+,verbatim"]
----
plugins {
id 'de.benediktritter.maven-plugin-development' version '{gradle-project-version}'
id 'org.gradlex.maven-plugin-development' version '{gradle-project-version}'
}
----
[source.multi-language-sample,kotlin,subs="attributes+"]
----
plugins {
id("de.benediktritter.maven-plugin-development") version "{gradle-project-version}"
id("org.gradlex.maven-plugin-development") version "{gradle-project-version}"
}
----

Expand Down
17 changes: 1 addition & 16 deletions src/docs/snippets/dependencies/groovy/build.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,5 @@
/*
* Copyright 2020 Benedikt Ritter
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
plugins {
id 'de.benediktritter.maven-plugin-development' version '0.4.3'
id 'org.gradlex.maven-plugin-development' version '1.0'
}

// tag::dependencies[]
Expand Down
17 changes: 1 addition & 16 deletions src/docs/snippets/dependencies/kotlin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,20 +1,5 @@
/*
* Copyright 2020 Benedikt Ritter
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
plugins {
id("de.benediktritter.maven-plugin-development") version "0.4.3"
id("org.gradlex.maven-plugin-development") version "1.0"
}

// tag::dependencies[]
Expand Down
17 changes: 1 addition & 16 deletions src/docs/snippets/help-mojo/groovy/build.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,5 @@
/*
* Copyright 2020 Benedikt Ritter
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
plugins {
id 'de.benediktritter.maven-plugin-development' version '0.4.3'
id 'org.gradlex.maven-plugin-development' version '1.0'
}

// tag::help-mojo[]
Expand Down
17 changes: 1 addition & 16 deletions src/docs/snippets/help-mojo/kotlin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,20 +1,5 @@
/*
* Copyright 2020 Benedikt Ritter
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
plugins {
id("de.benediktritter.maven-plugin-development") version "0.4.3"
id("org.gradlex.maven-plugin-development") version "1.0"
}

// tag::help-mojo[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package de.benediktritter.maven.plugin.development;
package org.gradlex.maven.plugin.development;

import org.gradle.api.artifacts.Configuration;
import org.gradle.api.provider.Property;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
* limitations under the License.
*/

package de.benediktritter.maven.plugin.development;
package org.gradlex.maven.plugin.development;

import de.benediktritter.maven.plugin.development.internal.MavenPluginDescriptor;
import de.benediktritter.maven.plugin.development.task.DependencyDescriptor;
import de.benediktritter.maven.plugin.development.task.GenerateHelpMojoSourcesTask;
import de.benediktritter.maven.plugin.development.task.GenerateMavenPluginDescriptorTask;
import de.benediktritter.maven.plugin.development.task.UpstreamProjectDescriptor;
import org.gradlex.maven.plugin.development.internal.MavenPluginDescriptor;
import org.gradlex.maven.plugin.development.task.DependencyDescriptor;
import org.gradlex.maven.plugin.development.task.GenerateHelpMojoSourcesTask;
import org.gradlex.maven.plugin.development.task.GenerateMavenPluginDescriptorTask;
import org.gradlex.maven.plugin.development.task.UpstreamProjectDescriptor;
import org.gradle.api.Plugin;
import org.gradle.api.Project;
import org.gradle.api.artifacts.Configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package de.benediktritter.maven.plugin.development.internal;
package org.gradlex.maven.plugin.development.internal;

import org.gradle.api.logging.Logger;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package de.benediktritter.maven.plugin.development.internal;
package org.gradlex.maven.plugin.development.internal;

import org.gradle.api.tasks.Input;
import org.gradle.api.tasks.Optional;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package de.benediktritter.maven.plugin.development.internal;
package org.gradlex.maven.plugin.development.internal;

import org.apache.maven.tools.plugin.extractor.MojoDescriptorExtractor;
import org.apache.maven.tools.plugin.extractor.annotations.JavaAnnotationsMojoDescriptorExtractor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
* limitations under the License.
*/

package de.benediktritter.maven.plugin.development.task;
package org.gradlex.maven.plugin.development.task;

import de.benediktritter.maven.plugin.development.internal.MavenPluginDescriptor;
import org.gradlex.maven.plugin.development.internal.MavenPluginDescriptor;
import org.apache.maven.plugin.descriptor.PluginDescriptor;
import org.apache.maven.project.MavenProject;
import org.apache.maven.tools.plugin.DefaultPluginToolsRequest;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package de.benediktritter.maven.plugin.development.task;
package org.gradlex.maven.plugin.development.task;

import org.codehaus.plexus.component.repository.ComponentDependency;
import org.gradle.api.tasks.Input;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
* limitations under the License.
*/

package de.benediktritter.maven.plugin.development.task;
package org.gradlex.maven.plugin.development.task;

import de.benediktritter.maven.plugin.development.internal.MavenLoggerAdapter;
import org.gradlex.maven.plugin.development.internal.MavenLoggerAdapter;
import org.apache.maven.model.Build;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.artifact.ProjectArtifact;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
* limitations under the License.
*/

package de.benediktritter.maven.plugin.development.task;
package org.gradlex.maven.plugin.development.task;

import de.benediktritter.maven.plugin.development.internal.MavenLoggerAdapter;
import de.benediktritter.maven.plugin.development.internal.MavenServiceFactory;
import org.gradlex.maven.plugin.development.internal.MavenLoggerAdapter;
import org.gradlex.maven.plugin.development.internal.MavenServiceFactory;
import org.apache.maven.artifact.DefaultArtifact;
import org.apache.maven.artifact.handler.DefaultArtifactHandler;
import org.apache.maven.model.Build;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package de.benediktritter.maven.plugin.development.task;
package org.gradlex.maven.plugin.development.task;

import org.gradle.api.file.FileCollection;
import org.gradle.api.tasks.CompileClasspath;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
* limitations under the License.
*/

package de.benediktritter.maven.plugin.development
package org.gradlex.maven.plugin.development

import de.benediktritter.maven.plugin.development.fixtures.TestRootProject
import org.gradlex.maven.plugin.development.fixtures.TestRootProject
import org.gradle.testkit.runner.GradleRunner
import org.junit.Rule
import spock.lang.Specification
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package de.benediktritter.maven.plugin.development
package org.gradlex.maven.plugin.development

import org.gradle.testkit.runner.TaskOutcome

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package de.benediktritter.maven.plugin.development
package org.gradlex.maven.plugin.development

import org.gradle.testkit.runner.TaskOutcome
import spock.lang.Unroll
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package de.benediktritter.maven.plugin.development
package org.gradlex.maven.plugin.development

class ConfigurationCacheFuncTest extends AbstractPluginFuncTest {
def "supports configuration cache"() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package de.benediktritter.maven.plugin.development
package org.gradlex.maven.plugin.development

class DeprecationsFuncTest extends AbstractPluginFuncTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package de.benediktritter.maven.plugin.development
package org.gradlex.maven.plugin.development

class GradleCrossVersionTest extends AbstractPluginFuncTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package de.benediktritter.maven.plugin.development
package org.gradlex.maven.plugin.development

import org.gradle.testkit.runner.TaskOutcome

Expand Down
Loading

0 comments on commit 6d4a47c

Please sign in to comment.