diff --git a/CHANGELOG.md b/CHANGELOG.md index 675802d..d5cde8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,10 @@ # Extra Java Module Info Gradle Plugin - Changelog -## Version 1.13.2 +## Version 1.14 * [Fixed] [#179](https://github.com/gradlex-org/extra-java-module-info/issues/179) - Combine 'preserveExisting' and 'exports' * [Fixed] [#219](https://github.com/gradlex-org/extra-java-module-info/issues/219) - Combine 'preserveExisting' and 'removePackage' * [Fixed] [#223](https://github.com/gradlex-org/extra-java-module-info/issues/223) - Combine 'preserveExisting' and 'ignoreServiceProvider' +* [Fixed] [#227](https://github.com/gradlex-org/extra-java-module-info/issues/227) - Stable order for the mergeJar path input ## Version 1.13.1 * [Fixed] [#197](https://github.com/gradlex-org/extra-java-module-info/issues/197) - Slightly adjust Gradle API usage for better 9.0.0 compatibility diff --git a/README.md b/README.md index bca2ecc..7f57770 100644 --- a/README.md +++ b/README.md @@ -253,6 +253,11 @@ val mainRuntimeClasspath = configurations.create("mainRuntimeClasspath") { // depend on all subprojects to create a dependency graph with "everything" dependencies { mainRuntimeClasspath(project(":app")) } +// If the mergeJar feature is used, also use the "global classpath" to discover jars-to-merge (optional) +configurations.getByName("javaModulesMergeJars") { + extendsFrom(configurations.getByName("mainRuntimeClasspath")) +} + // Use the global classpath for consisten resolution (optional) configurations.runtimeClasspath { shouldResolveConsistentlyWith(mainRuntimeClasspath) diff --git a/src/main/java/org/gradlex/javamodule/moduleinfo/ExtraJavaModuleInfoPlugin.java b/src/main/java/org/gradlex/javamodule/moduleinfo/ExtraJavaModuleInfoPlugin.java index 982ad76..21b05d9 100644 --- a/src/main/java/org/gradlex/javamodule/moduleinfo/ExtraJavaModuleInfoPlugin.java +++ b/src/main/java/org/gradlex/javamodule/moduleinfo/ExtraJavaModuleInfoPlugin.java @@ -307,6 +307,7 @@ private static class IdExtractor implements Transformer, Collection @Override public List transform(Collection artifacts) { return artifacts.stream() + .sorted(Comparator.comparing(ResolvedArtifactResult::getFile)) .map(a -> { ComponentIdentifier componentIdentifier = a.getId().getComponentIdentifier(); if (componentIdentifier instanceof ModuleComponentIdentifier) { @@ -332,6 +333,7 @@ public FileExtractor(ProjectLayout projectLayout) { public List transform(Collection artifacts) { Directory projectDirectory = projectLayout.getProjectDirectory(); return artifacts.stream() + .sorted(Comparator.comparing(ResolvedArtifactResult::getFile)) .map(a -> projectDirectory.file(a.getFile().getAbsolutePath())) .collect(Collectors.toList()); }