Skip to content

Commit ab9135d

Browse files
committed
Version 1.0 - move to 'org.gradlex'
1 parent c15e375 commit ab9135d

File tree

45 files changed

+448
-204
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+448
-204
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
# Java Module Dependencies Gradle Plugin - Changelog
22

3+
## Version 1.0
4+
* Moved project to [GradleX](https://gradlex.org) - new plugin ID: `org.gradlex.java-module-dependencies`
5+
36
## Versions 0.11
4-
* [#18](https://github.com/jjohannes/java-module-dependencies/issues/18) Fix bug with single line comments in module-info.java
7+
* [#18](https://github.com/gradlex-org/java-module-dependencies/issues/18) Fix bug with single line comments in module-info.java
58
* More mappings for Modules on Maven Central
69

710
## Versions 0.10

README.MD

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
# Gradle Plugin: Java Module Dependencies
1+
# Java Module Dependencies Gradle plugin
2+
3+
[![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fgradlex-org%2Fjava-module-dependencies%2Fbadge%3Fref%3Dmain&style=flat)](https://actions-badge.atrox.dev/gradlex-org/java-module-dependencies/goto?ref=main)
4+
[![Gradle Plugin Portal](https://img.shields.io/maven-metadata/v?label=Plugin%20Portal&metadataUrl=https%3A%2F%2Fplugins.gradle.org%2Fm2%2Forg%2Fgradlex%2Fjava-module-dependencies%2Forg.gradlex.java-module-dependencies.gradle.plugin%2Fmaven-metadata.xml)](https://plugins.gradle.org/plugin/org.gradlex.java-module-dependencies)
25

36
A Gradle 7.4+ plugin to make Gradle use dependencies from _module-info.java_ files automatically.
47
If you have a project that fully uses Java Modules, you do **not** need to declare dependencies in the `dependencies { }` block anymore
@@ -13,26 +16,26 @@ as well as [Version Catalogs](https://docs.gradle.org/current/userguide/platform
1316
Here is an overview of what the plugin does in a Twitter thread:
1417
[<img src="https://onepiecesoftware.github.io/img/tweets/1524322184923164672.png">](https://twitter.com/jeoj/status/1524322184923164672)
1518

16-
This plugin is maintained by me, [Jendrik Johannes](https://github.com/jjohannes).
19+
This [GradleX](https://gradlex.org) plugin is maintained by me, [Jendrik Johannes](https://github.com/jjohannes).
1720
I offer consulting and training for Gradle and/or the Java Module System - please [reach out](mailto:jendrik.johannes@gmail.com) if you are interested.
1821
There is also my [YouTube channel](https://www.youtube.com/playlist?list=PLWQK2ZdV4Yl2k2OmC_gsjDpdIBTN0qqkE) on Gradle topics.
1922

20-
If you have a suggestion or a question, please [open an issue](https://github.com/jjohannes/java-module-dependencies/issues/new).
23+
If you have a suggestion or a question, please [open an issue](https://github.com/gradlex-org/java-module-dependencies/issues/new).
2124

2225
There is a [CHANGELOG.md](CHANGELOG.md).
2326

2427
# Java Modules with Gradle
2528

2629
If you plan to build Java Modules with Gradle, you should consider using these plugins on top of Gradle core:
2730

28-
- [`id("de.jjohannes.java-module-dependencies")`](https://github.com/jjohannes/java-module-dependencies)
31+
- [`id("org.gradlex.java-module-dependencies")`](https://github.com/gradlex-org/java-module-dependencies)
2932
Avoid duplicated dependency definitions and get your Module Path under control
30-
- [`id("de.jjohannes.java-module-testing")`](https://github.com/jjohannes/java-module-testing)
33+
- [`id("org.gradlex.java-module-testing")`](https://github.com/gradlex-org/java-module-testing)
3134
Proper test setup for Java Modules
32-
- [`id("de.jjohannes.extra-java-module-info")`](https://github.com/jjohannes/extra-java-module-info)
35+
- [`id("org.gradlex.extra-java-module-info")`](https://github.com/gradlex-org/extra-java-module-info)
3336
Only if your (existing) project cannot avoid using non-module legacy Jars
3437

35-
[Here is a sample](https://github.com/jjohannes/java-module-testing/tree/main/samples/use-all-java-module-plugins)
38+
[Here is a sample](https://github.com/gradlex-org/java-module-testing/tree/main/samples/use-all-java-module-plugins)
3639
that shows all plugins in combination.
3740

3841
[Full Java Module System Project Setup](https://github.com/jjohannes/gradle-project-setup-howto/tree/java_module_system) is a full-fledged Java Module System project setup using these plugins.
@@ -51,11 +54,11 @@ you can check out my [Understanding Gradle video series](https://www.youtube.com
5154
## Plugin dependency
5255

5356
Add this to the build file of your convention plugin's build
54-
(e.g. `build-logic/build.gradle(.kts)` or `buildSrc/build.gradle(.kts)`).
57+
(e.g. `gradle/plugins/build.gradle(.kts)` or `buildSrc/build.gradle(.kts)`).
5558

5659
```
5760
dependencies {
58-
implementation("de.jjohannes.gradle:java-module-dependencies:0.11")
61+
implementation("org.gradlex:java-module-dependencies:1.0")
5962
}
6063
```
6164

@@ -66,7 +69,7 @@ In your convention plugin, apply the plugin.
6669
```
6770
plugins {
6871
...
69-
id("de.jjohannes.java-module-dependencies")
72+
id("org.gradlex.java-module-dependencies")
7073
}
7174
```
7275

@@ -76,8 +79,8 @@ You may define additional mappings from _Module Name_ to _group:name (GA) coordi
7679

7780
The plugin already knows about Modules available on Maven Central. The information is stored in:
7881

79-
- [modules.properties](src/main/resources/de/jjohannes/gradle/moduledependencies/modules.properties) - [please open a PR](https://github.com/jjohannes/extra-java-module-info/pulls) if you miss an entry
80-
- [unique_modules.properties](src/main/resources/de/jjohannes/gradle/moduledependencies/unique_modules.properties) - this information is extracted from [modules.properties](https://github.com/sormuras/modules/blob/main/com.github.sormuras.modules/com/github/sormuras/modules/modules.properties) by [@sormuras](https://github.com/sormuras)
82+
- [modules.properties](src/main/resources/org/gradlex/javamodule/dependencies/modules.properties) - [please open a PR](https://github.com/gradlex-org/extra-java-module-info/pulls) if you miss an entry
83+
- [unique_modules.properties](src/main/resources/org/gradlex/javamodule/dependencies/unique_modules.properties) - this information is extracted from [modules.properties](https://github.com/sormuras/modules/blob/main/com.github.sormuras.modules/com/github/sormuras/modules/modules.properties) by [@sormuras](https://github.com/sormuras)
8184

8285
You can define additional entries (or overwrite entries from the plugin) as follows:
8386

@@ -116,7 +119,7 @@ For libraries that consist of multiple components and have a BOM for version man
116119
```
117120
plugins {
118121
id("java-platform")
119-
id("de.jjohannes.java-module-dependencies")
122+
id("org.gradlex.java-module-dependencies")
120123
}
121124
122125
// Define versions for Modules via the Module Name
@@ -254,7 +257,7 @@ commons-cli:commons-cli (1.5.0)
254257
Notes / Options:
255258
- This may be ok if you use the Classpath (aka ALL-UNNAMED) in addition to the Module Path (automatic modules can see ALL-UNNAMED)
256259
- Remove the dependencies or upgrade to higher versions
257-
- Patch legacy Jars to Modules: https://github.com/jjohannes/extra-java-module-info
260+
- Patch legacy Jars to Modules: https://github.com/gradlex-org/extra-java-module-info
258261
```
259262

260263
## Migrate existing Java projects to Java Modules
@@ -266,13 +269,13 @@ This is not a sophisticated migration tool, but useful, in combination with `ana
266269

267270
## Integration with the Extra Java Module Info plugin
268271

269-
This plugin integrates with the [Extra Java Module Info](https://github.com/jjohannes/extra-java-module-info) plugin if both are applied.
272+
This plugin integrates with the [Extra Java Module Info](https://github.com/gradlex-org/extra-java-module-info) plugin if both are applied.
270273
Module Name mappings for Jars that were patched with extra module info will be automatically registered.
271274

272275
```
273276
plugins {
274-
id("de.jjohannes.extra-java-module-info")
275-
id("de.jjohannes.java-module-dependencies")
277+
id("org.gradlex.extra-java-module-info")
278+
id("org.gradlex.java-module-dependencies")
276279
}
277280
278281
extraJavaModuleInfo {
@@ -296,3 +299,7 @@ feature of Gradle, the result of the configuration phase is cached, avoiding par
296299
org.gradle.unsafe.configuration-cache=true
297300
```
298301

302+
# Disclaimer
303+
304+
Gradle and the Gradle logo are trademarks of Gradle, Inc.
305+
The GradleX project is not endorsed by, affiliated with, or associated with Gradle or Gradle, Inc. in any way.

build.gradle.kts

Lines changed: 25 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,43 @@
11
plugins {
2-
id("de.jjohannes.gradle-plugin")
2+
id("gradlexbuild.module-mappings")
33
id("groovy")
4+
id("org.gradlex.internal.plugin-publish-conventions") version "0.4"
45
}
56

6-
group = "de.jjohannes.gradle"
7-
version = "0.11"
7+
group = "org.gradlex"
8+
version = "1.0"
9+
10+
java {
11+
sourceCompatibility = JavaVersion.VERSION_1_8
12+
targetCompatibility = JavaVersion.VERSION_1_8
13+
}
814

915
dependencies {
1016
implementation("org.ow2.asm:asm:8.0.1")
1117

12-
compileOnly("de.jjohannes.gradle:extra-java-module-info:0.13")
18+
compileOnly("org.gradlex:extra-java-module-info:1.0")
1319

1420
testImplementation("org.spockframework:spock-core:2.1-groovy-3.0")
1521
testImplementation("org.gradle.exemplar:samples-check:1.0.0")
1622
testRuntimeOnly("org.junit.vintage:junit-vintage-engine")
1723
}
1824

19-
val pluginId = "de.jjohannes.java-module-dependencies"
20-
val pluginClass = "de.jjohannes.gradle.moduledependencies.JavaModuleDependenciesPlugin"
21-
val pluginName = "Java Module Dependencies Gradle Plugin"
22-
val pluginDescription = "A plugin that makes Gradle respect the dependencies defined in 'module-info.java' files."
23-
val pluginBundleTags = listOf("java", "modularity", "jigsaw", "jpms", "dependencies", "versions")
24-
val pluginGitHub = "https://github.com/jjohannes/java-module-dependencies"
25-
26-
gradlePlugin {
27-
plugins {
28-
create(project.name) {
29-
id = pluginId
30-
implementationClass = pluginClass
31-
displayName = pluginName
32-
description = pluginDescription
33-
}
25+
pluginPublishConventions {
26+
id("${project.group}.${project.name}")
27+
implementationClass("org.gradlex.javamodule.dependencies.JavaModuleDependenciesPlugin")
28+
displayName("Java Module Dependencies Gradle Plugin")
29+
description("A plugin that makes Gradle respect the dependencies defined in 'module-info.java' files.")
30+
tags("gradlex", "java", "modularity", "jigsaw", "jpms", "dependencies", "versions")
31+
gitHub("https://github.com/gradlex-org/java-module-dependencies")
32+
developer {
33+
id.set("jjohannes")
34+
name.set("Jendrik Johannes")
35+
email.set("jendrik@gradlex.org")
3436
}
3537
}
3638

37-
pluginBundle {
38-
website = pluginGitHub
39-
vcsUrl = pluginGitHub
40-
tags = pluginBundleTags
41-
}
42-
43-
publishing {
44-
publications.withType<MavenPublication>().all {
45-
pom.name.set(pluginName)
46-
pom.description.set(pluginDescription)
47-
pom.url.set(pluginGitHub)
48-
pom.licenses {
49-
license {
50-
name.set("Apache License, Version 2.0")
51-
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
52-
}
53-
}
54-
pom.developers {
55-
developer {
56-
id.set("jjohannes")
57-
name.set("Jendrik Johannes")
58-
email.set("jendrik@onepiece.software")
59-
}
60-
}
61-
pom.scm {
62-
url.set(pluginGitHub)
63-
}
64-
}
39+
tasks.test {
40+
useJUnitPlatform()
41+
maxParallelForks = 4
42+
inputs.dir(layout.projectDirectory.dir("samples"))
6543
}

gradle-build-logic/src/main/kotlin/de.jjohannes.gradle-plugin.gradle.kts

Lines changed: 0 additions & 22 deletions
This file was deleted.

gradle/checkstyle/checkstyle.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<!DOCTYPE module PUBLIC
2+
"-//Puppy Crawl//DTD Check Configuration 1.2//EN"
3+
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
4+
<module name="Checker">
5+
<module name="Header">
6+
<property name="headerFile" value="${config_loc}/header.txt"/>
7+
</module>
8+
</module>

gradle/checkstyle/header.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
* Copyright 2022 the GradleX team.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
File renamed without changes.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import gradlexbuild.UniqueModulesPropertiesUpdate
2+
3+
plugins {
4+
id("base")
5+
}
6+
7+
val updateUniqueModulesProperties = tasks.register<UniqueModulesPropertiesUpdate>("updateUniqueModulesProperties")
8+
9+
tasks.assemble {
10+
dependsOn(updateUniqueModulesProperties)
11+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package de.jjohannes.gradle.moduledependencies.gradlebuild.tasks
1+
package gradlexbuild
22

33
import org.gradle.api.DefaultTask
44
import org.gradle.api.artifacts.ExternalModuleDependency
@@ -19,7 +19,7 @@ abstract class UniqueModulesPropertiesUpdate : DefaultTask() {
1919
val name = split[split.size - 3]
2020
"${entry.key}=$group:$name\n"
2121
}.joinToString("")
22-
project.layout.projectDirectory.file("src/main/resources/de/jjohannes/gradle/moduledependencies/unique_modules.properties").asFile.writeText(modulesToCoordinates.trim())
22+
project.layout.projectDirectory.file("src/main/resources/org/gradlex/javamodule/dependencies/unique_modules.properties").asFile.writeText(modulesToCoordinates.trim())
2323
}
2424

2525
private fun getModulesPropertiesFromRepository(): File {

0 commit comments

Comments
 (0)