From 5f813bfb26cf2896be4632a6d46df6002c53379f Mon Sep 17 00:00:00 2001 From: Guillaume Nodet Date: Fri, 22 May 2026 20:42:22 +0200 Subject: [PATCH] [MNG-11642] Add JPMS module support to Maven 4 Add explicit module-info.java to 17 modules (11 API + 6 impl) and Automatic-Module-Name manifest entries to all 17 remaining modules. Only org.apache.maven.api.* packages are public API. All implementation packages use qualified exports restricted to internal consumers. Co-Authored-By: Claude Opus 4.6 --- api/maven-api-annotations/pom.xml | 4 + .../src/main/java/module-info.java | 22 +++ api/maven-api-cli/pom.xml | 4 + .../src/main/java/module-info.java | 33 +++++ api/maven-api-core/pom.xml | 4 + .../src/main/java/module-info.java | 37 +++++ api/maven-api-di/pom.xml | 1 + .../src/main/java/module-info.java | 28 ++++ api/maven-api-metadata/pom.xml | 4 + .../src/main/java/module-info.java | 24 +++ api/maven-api-model/pom.xml | 4 + .../src/main/java/module-info.java | 27 ++++ api/maven-api-plugin/pom.xml | 4 + .../src/main/java/module-info.java | 26 ++++ api/maven-api-settings/pom.xml | 4 + .../src/main/java/module-info.java | 25 ++++ api/maven-api-spi/pom.xml | 4 + .../src/main/java/module-info.java | 26 ++++ api/maven-api-toolchain/pom.xml | 4 + .../src/main/java/module-info.java | 25 ++++ api/maven-api-xml/pom.xml | 4 + .../src/main/java/module-info.java | 27 ++++ compat/maven-artifact/pom.xml | 4 + compat/maven-builder-support/pom.xml | 4 + compat/maven-compat/pom.xml | 13 ++ compat/maven-embedder/pom.xml | 4 + compat/maven-model-builder/pom.xml | 10 ++ compat/maven-model/pom.xml | 1 + compat/maven-plugin-api/pom.xml | 4 + compat/maven-repository-metadata/pom.xml | 4 + compat/maven-resolver-provider/pom.xml | 4 + compat/maven-settings-builder/pom.xml | 4 + compat/maven-settings/pom.xml | 4 + compat/maven-toolchain-builder/pom.xml | 4 + compat/maven-toolchain-model/pom.xml | 4 + impl/maven-cli/pom.xml | 4 + impl/maven-core/pom.xml | 4 + impl/maven-di/pom.xml | 22 +++ impl/maven-di/src/main/java/module-info.java | 31 ++++ impl/maven-executor/pom.xml | 1 + impl/maven-impl/pom.xml | 15 ++ .../maven-impl/src/main/java/module-info.java | 137 ++++++++++++++++++ .../maven/impl/model/DefaultModelBuilder.java | 2 +- .../impl/model/DefaultModelProcessor.java | 2 +- impl/maven-jline/pom.xml | 22 +++ .../src/main/java/module-info.java | 37 +++++ impl/maven-logging/pom.xml | 4 + .../src/main/java/module-info.java | 33 +++++ impl/maven-support/pom.xml | 12 ++ .../src/main/java/module-info.java | 37 +++++ impl/maven-testing/pom.xml | 4 + impl/maven-xml/pom.xml | 4 + impl/maven-xml/src/main/java/module-info.java | 32 ++++ pom.xml | 24 +++ 54 files changed, 830 insertions(+), 2 deletions(-) create mode 100644 api/maven-api-annotations/src/main/java/module-info.java create mode 100644 api/maven-api-cli/src/main/java/module-info.java create mode 100644 api/maven-api-core/src/main/java/module-info.java create mode 100644 api/maven-api-di/src/main/java/module-info.java create mode 100644 api/maven-api-metadata/src/main/java/module-info.java create mode 100644 api/maven-api-model/src/main/java/module-info.java create mode 100644 api/maven-api-plugin/src/main/java/module-info.java create mode 100644 api/maven-api-settings/src/main/java/module-info.java create mode 100644 api/maven-api-spi/src/main/java/module-info.java create mode 100644 api/maven-api-toolchain/src/main/java/module-info.java create mode 100644 api/maven-api-xml/src/main/java/module-info.java create mode 100644 impl/maven-di/src/main/java/module-info.java create mode 100644 impl/maven-impl/src/main/java/module-info.java create mode 100644 impl/maven-jline/src/main/java/module-info.java create mode 100644 impl/maven-logging/src/main/java/module-info.java create mode 100644 impl/maven-support/src/main/java/module-info.java create mode 100644 impl/maven-xml/src/main/java/module-info.java diff --git a/api/maven-api-annotations/pom.xml b/api/maven-api-annotations/pom.xml index 350873e35a30..c159bcfce7f5 100644 --- a/api/maven-api-annotations/pom.xml +++ b/api/maven-api-annotations/pom.xml @@ -30,4 +30,8 @@ Maven 4 API :: Meta annotations Maven 4 API - Java meta annotations. + + org.apache.maven.api.annotations + + diff --git a/api/maven-api-annotations/src/main/java/module-info.java b/api/maven-api-annotations/src/main/java/module-info.java new file mode 100644 index 000000000000..1dff7e2f5351 --- /dev/null +++ b/api/maven-api-annotations/src/main/java/module-info.java @@ -0,0 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + +module org.apache.maven.api.annotations { + exports org.apache.maven.api.annotations; +} diff --git a/api/maven-api-cli/pom.xml b/api/maven-api-cli/pom.xml index 6ed5c71eff71..52ead51c6ba9 100644 --- a/api/maven-api-cli/pom.xml +++ b/api/maven-api-cli/pom.xml @@ -30,6 +30,10 @@ Maven 4 API :: CLI Maven 4 API - CLI. + + org.apache.maven.api.cli + + org.apache.maven diff --git a/api/maven-api-cli/src/main/java/module-info.java b/api/maven-api-cli/src/main/java/module-info.java new file mode 100644 index 000000000000..2beed2fa197b --- /dev/null +++ b/api/maven-api-cli/src/main/java/module-info.java @@ -0,0 +1,33 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + +module org.apache.maven.api.cli { + requires transitive org.apache.maven.api; + requires transitive org.apache.maven.api.annotations; + requires transitive org.apache.maven.api.xml; + + exports org.apache.maven.api.cli; + exports org.apache.maven.api.cli.cisupport; + exports org.apache.maven.api.cli.extensions; + exports org.apache.maven.api.cli.logging; + exports org.apache.maven.api.cli.mvn; + exports org.apache.maven.api.cli.mvnenc; + exports org.apache.maven.api.cli.mvnsh; + exports org.apache.maven.api.cli.mvnup; +} diff --git a/api/maven-api-core/pom.xml b/api/maven-api-core/pom.xml index 339ea8319217..281711d96dc0 100644 --- a/api/maven-api-core/pom.xml +++ b/api/maven-api-core/pom.xml @@ -30,6 +30,10 @@ Maven 4 API :: Core Maven 4 API - Maven Core API + + org.apache.maven.api + + org.apache.maven diff --git a/api/maven-api-core/src/main/java/module-info.java b/api/maven-api-core/src/main/java/module-info.java new file mode 100644 index 000000000000..7cbfb5792dfe --- /dev/null +++ b/api/maven-api-core/src/main/java/module-info.java @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + +module org.apache.maven.api { + requires transitive org.apache.maven.api.annotations; + requires transitive org.apache.maven.api.di; + requires transitive org.apache.maven.api.model; + requires transitive org.apache.maven.api.settings; + requires transitive org.apache.maven.api.toolchain; + requires transitive org.apache.maven.api.plugin.descriptor; + requires transitive org.apache.maven.api.xml; + requires java.compiler; + + exports org.apache.maven.api; + exports org.apache.maven.api.cache; + exports org.apache.maven.api.feature; + exports org.apache.maven.api.plugin; + exports org.apache.maven.api.plugin.annotations; + exports org.apache.maven.api.services; + exports org.apache.maven.api.services.xml; +} diff --git a/api/maven-api-di/pom.xml b/api/maven-api-di/pom.xml index d2341a7a42b5..0563481fc722 100644 --- a/api/maven-api-di/pom.xml +++ b/api/maven-api-di/pom.xml @@ -31,6 +31,7 @@ Maven 4 API - Dependency Injection + org.apache.maven.api.di none diff --git a/api/maven-api-di/src/main/java/module-info.java b/api/maven-api-di/src/main/java/module-info.java new file mode 100644 index 000000000000..8e64185ddd72 --- /dev/null +++ b/api/maven-api-di/src/main/java/module-info.java @@ -0,0 +1,28 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + +module org.apache.maven.api.di { + exports org.apache.maven.api.di; + exports org.apache.maven.di.tool; + + requires java.compiler; + + provides javax.annotation.processing.Processor with + org.apache.maven.di.tool.DiIndexProcessor; +} diff --git a/api/maven-api-metadata/pom.xml b/api/maven-api-metadata/pom.xml index 311aad02c46d..5765faca73b8 100644 --- a/api/maven-api-metadata/pom.xml +++ b/api/maven-api-metadata/pom.xml @@ -31,6 +31,10 @@ under the License. Maven 4 API :: Repository Metadata Maven 4 API - Immutable Repository Metadata model. + + org.apache.maven.api.metadata + + org.apache.maven diff --git a/api/maven-api-metadata/src/main/java/module-info.java b/api/maven-api-metadata/src/main/java/module-info.java new file mode 100644 index 000000000000..03b2b2750502 --- /dev/null +++ b/api/maven-api-metadata/src/main/java/module-info.java @@ -0,0 +1,24 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + +module org.apache.maven.api.metadata { + requires transitive org.apache.maven.api.annotations; + + exports org.apache.maven.api.metadata; +} diff --git a/api/maven-api-model/pom.xml b/api/maven-api-model/pom.xml index 8294a3e8876b..df3f468a59ac 100644 --- a/api/maven-api-model/pom.xml +++ b/api/maven-api-model/pom.xml @@ -31,6 +31,10 @@ under the License. Maven 4 API :: Model Maven 4 API - Immutable Model for Maven POM (Project Object Model). + + org.apache.maven.api.model + + org.apache.maven diff --git a/api/maven-api-model/src/main/java/module-info.java b/api/maven-api-model/src/main/java/module-info.java new file mode 100644 index 000000000000..9ba77847d0c8 --- /dev/null +++ b/api/maven-api-model/src/main/java/module-info.java @@ -0,0 +1,27 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + +module org.apache.maven.api.model { + requires transitive org.apache.maven.api.annotations; + requires transitive org.apache.maven.api.xml; + + exports org.apache.maven.api.model; + + uses org.apache.maven.api.model.ModelObjectProcessor; +} diff --git a/api/maven-api-plugin/pom.xml b/api/maven-api-plugin/pom.xml index 2e9c1706edaa..41708238962b 100644 --- a/api/maven-api-plugin/pom.xml +++ b/api/maven-api-plugin/pom.xml @@ -31,6 +31,10 @@ under the License. Maven 4 API :: Plugin Maven 4 API - Immutable Plugin model. + + org.apache.maven.api.plugin.descriptor + + org.apache.maven diff --git a/api/maven-api-plugin/src/main/java/module-info.java b/api/maven-api-plugin/src/main/java/module-info.java new file mode 100644 index 000000000000..48005b3f0d69 --- /dev/null +++ b/api/maven-api-plugin/src/main/java/module-info.java @@ -0,0 +1,26 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + +module org.apache.maven.api.plugin.descriptor { + requires transitive org.apache.maven.api.annotations; + requires transitive org.apache.maven.api.xml; + + exports org.apache.maven.api.plugin.descriptor; + exports org.apache.maven.api.plugin.descriptor.lifecycle; +} diff --git a/api/maven-api-settings/pom.xml b/api/maven-api-settings/pom.xml index a73c2ce1de0d..bd3ea6ac3ada 100644 --- a/api/maven-api-settings/pom.xml +++ b/api/maven-api-settings/pom.xml @@ -31,6 +31,10 @@ under the License. Maven 4 API :: Settings Maven 4 API - Immutable Settings model. + + org.apache.maven.api.settings + + org.apache.maven diff --git a/api/maven-api-settings/src/main/java/module-info.java b/api/maven-api-settings/src/main/java/module-info.java new file mode 100644 index 000000000000..9dd502ffbe94 --- /dev/null +++ b/api/maven-api-settings/src/main/java/module-info.java @@ -0,0 +1,25 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + +module org.apache.maven.api.settings { + requires transitive org.apache.maven.api.annotations; + requires transitive org.apache.maven.api.xml; + + exports org.apache.maven.api.settings; +} diff --git a/api/maven-api-spi/pom.xml b/api/maven-api-spi/pom.xml index 19c06b04a2f5..f0ffef199943 100644 --- a/api/maven-api-spi/pom.xml +++ b/api/maven-api-spi/pom.xml @@ -30,6 +30,10 @@ Maven 4 API :: SPI Maven 4 API - Maven SPI. + + org.apache.maven.api.spi + + org.apache.maven diff --git a/api/maven-api-spi/src/main/java/module-info.java b/api/maven-api-spi/src/main/java/module-info.java new file mode 100644 index 000000000000..f8c6107344c5 --- /dev/null +++ b/api/maven-api-spi/src/main/java/module-info.java @@ -0,0 +1,26 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + +module org.apache.maven.api.spi { + requires transitive org.apache.maven.api; + requires transitive org.apache.maven.api.di; + requires transitive org.apache.maven.api.model; + + exports org.apache.maven.api.spi; +} diff --git a/api/maven-api-toolchain/pom.xml b/api/maven-api-toolchain/pom.xml index 64d53566d3ec..6bbedbbe20e6 100644 --- a/api/maven-api-toolchain/pom.xml +++ b/api/maven-api-toolchain/pom.xml @@ -31,6 +31,10 @@ under the License. Maven 4 API :: Toolchain Maven 4 API - Immutable Toolchain model. + + org.apache.maven.api.toolchain + + org.apache.maven diff --git a/api/maven-api-toolchain/src/main/java/module-info.java b/api/maven-api-toolchain/src/main/java/module-info.java new file mode 100644 index 000000000000..911607a7630e --- /dev/null +++ b/api/maven-api-toolchain/src/main/java/module-info.java @@ -0,0 +1,25 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + +module org.apache.maven.api.toolchain { + requires transitive org.apache.maven.api.annotations; + requires transitive org.apache.maven.api.xml; + + exports org.apache.maven.api.toolchain; +} diff --git a/api/maven-api-xml/pom.xml b/api/maven-api-xml/pom.xml index 4842b6541f07..3b2d741e0bbf 100644 --- a/api/maven-api-xml/pom.xml +++ b/api/maven-api-xml/pom.xml @@ -30,6 +30,10 @@ Maven 4 API :: XML Maven 4 API - Immutable XML. + + org.apache.maven.api.xml + + org.apache.maven diff --git a/api/maven-api-xml/src/main/java/module-info.java b/api/maven-api-xml/src/main/java/module-info.java new file mode 100644 index 000000000000..d75dfdae10fe --- /dev/null +++ b/api/maven-api-xml/src/main/java/module-info.java @@ -0,0 +1,27 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + +module org.apache.maven.api.xml { + requires transitive org.apache.maven.api.annotations; + requires transitive java.xml; + + exports org.apache.maven.api.xml; + + uses org.apache.maven.api.xml.XmlService; +} diff --git a/compat/maven-artifact/pom.xml b/compat/maven-artifact/pom.xml index 42d5bf80f56d..3ca31d04aa15 100644 --- a/compat/maven-artifact/pom.xml +++ b/compat/maven-artifact/pom.xml @@ -30,6 +30,10 @@ under the License. Maven Artifact + + org.apache.maven.artifact + + org.junit.jupiter diff --git a/compat/maven-builder-support/pom.xml b/compat/maven-builder-support/pom.xml index 2f4b6bd61a23..211248dad263 100644 --- a/compat/maven-builder-support/pom.xml +++ b/compat/maven-builder-support/pom.xml @@ -31,6 +31,10 @@ under the License. Maven Builder Support (deprecated) Support for descriptor builders (model, setting, toolchains) + + org.apache.maven.builder.support + + org.apache.maven diff --git a/compat/maven-compat/pom.xml b/compat/maven-compat/pom.xml index 3d3fcdee232b..31aba3249e6a 100644 --- a/compat/maven-compat/pom.xml +++ b/compat/maven-compat/pom.xml @@ -31,6 +31,10 @@ under the License. Maven Compat (deprecated) Deprecated Maven2 classes maintained as compatibility layer. + + org.apache.maven.compat + + org.apache.maven @@ -255,6 +259,15 @@ under the License. + + org.apache.maven.plugins + maven-javadoc-plugin + + + --add-exports=org.codehaus.plexus.interpolation/org.codehaus.plexus.interpolation.util=org.apache.maven.compat + + + diff --git a/compat/maven-embedder/pom.xml b/compat/maven-embedder/pom.xml index 2df8588ec116..ad29e3d66c33 100644 --- a/compat/maven-embedder/pom.xml +++ b/compat/maven-embedder/pom.xml @@ -31,6 +31,10 @@ under the License. Maven Embedder (deprecated) Maven embeddable component, with CLI and logging support. + + org.apache.maven.embedder + + diff --git a/compat/maven-model-builder/pom.xml b/compat/maven-model-builder/pom.xml index 79ebf1b14342..060dd52557e8 100644 --- a/compat/maven-model-builder/pom.xml +++ b/compat/maven-model-builder/pom.xml @@ -32,6 +32,7 @@ under the License. The effective model builder, with inheritance, profile activation, interpolation, ... + org.apache.maven.model.builder FileLength @@ -161,6 +162,15 @@ under the License. + + org.apache.maven.plugins + maven-javadoc-plugin + + + --add-exports=org.codehaus.plexus.interpolation/org.codehaus.plexus.interpolation.util=org.apache.maven.model.builder + + + diff --git a/compat/maven-model/pom.xml b/compat/maven-model/pom.xml index fc1eecff4bea..1c30e94f51a3 100644 --- a/compat/maven-model/pom.xml +++ b/compat/maven-model/pom.xml @@ -32,6 +32,7 @@ under the License. Model for Maven POM (Project Object Model) + org.apache.maven.model FileLength diff --git a/compat/maven-plugin-api/pom.xml b/compat/maven-plugin-api/pom.xml index 6bd39596deb8..2ff8e0740738 100644 --- a/compat/maven-plugin-api/pom.xml +++ b/compat/maven-plugin-api/pom.xml @@ -31,6 +31,10 @@ under the License. Maven 3 Plugin API The API for Maven 3 plugins - Mojos - development. + + org.apache.maven.plugin + + org.apache.maven diff --git a/compat/maven-repository-metadata/pom.xml b/compat/maven-repository-metadata/pom.xml index 3a6151f4b908..141ecc23e405 100644 --- a/compat/maven-repository-metadata/pom.xml +++ b/compat/maven-repository-metadata/pom.xml @@ -31,6 +31,10 @@ under the License. Maven Repository Metadata Model Per-directory local and remote repository metadata. + + org.apache.maven.repository.metadata + + org.apache.maven diff --git a/compat/maven-resolver-provider/pom.xml b/compat/maven-resolver-provider/pom.xml index 79c7507becd2..bcf4064bb39a 100644 --- a/compat/maven-resolver-provider/pom.xml +++ b/compat/maven-resolver-provider/pom.xml @@ -31,6 +31,10 @@ under the License. Maven Artifact Resolver Provider (deprecated) Components completing Maven Resolver for utilizing Maven POM and repository metadata. + + org.apache.maven.resolver.provider + + org.apache.maven diff --git a/compat/maven-settings-builder/pom.xml b/compat/maven-settings-builder/pom.xml index 24e62ee65639..4726ccdd844c 100644 --- a/compat/maven-settings-builder/pom.xml +++ b/compat/maven-settings-builder/pom.xml @@ -37,6 +37,10 @@ under the License. + + org.apache.maven.settings.builder + + org.codehaus.plexus diff --git a/compat/maven-settings/pom.xml b/compat/maven-settings/pom.xml index 6aaa0e4e4246..b426391104aa 100644 --- a/compat/maven-settings/pom.xml +++ b/compat/maven-settings/pom.xml @@ -31,6 +31,10 @@ under the License. Maven Settings Maven Settings model. + + org.apache.maven.settings + + org.apache.maven diff --git a/compat/maven-toolchain-builder/pom.xml b/compat/maven-toolchain-builder/pom.xml index e5e8916c909a..91b4d1d05ed0 100644 --- a/compat/maven-toolchain-builder/pom.xml +++ b/compat/maven-toolchain-builder/pom.xml @@ -31,6 +31,10 @@ under the License. Maven Toolchain Builder (deprecated) The effective toolchain builder. + + org.apache.maven.toolchain.builder + + org.apache.maven diff --git a/compat/maven-toolchain-model/pom.xml b/compat/maven-toolchain-model/pom.xml index 218bdbed0778..567fb5591244 100644 --- a/compat/maven-toolchain-model/pom.xml +++ b/compat/maven-toolchain-model/pom.xml @@ -31,6 +31,10 @@ under the License. Maven Toolchain Model Maven Toolchain model. + + org.apache.maven.toolchain.model + + org.apache.maven diff --git a/impl/maven-cli/pom.xml b/impl/maven-cli/pom.xml index a369ffd66322..0d144e890b22 100644 --- a/impl/maven-cli/pom.xml +++ b/impl/maven-cli/pom.xml @@ -31,6 +31,10 @@ under the License. Maven 4 CLI Maven 4 CLI component, with CLI and logging support. + + org.apache.maven.cling + + diff --git a/impl/maven-core/pom.xml b/impl/maven-core/pom.xml index 07ffa6662b12..bc26d63395c2 100644 --- a/impl/maven-core/pom.xml +++ b/impl/maven-core/pom.xml @@ -31,6 +31,10 @@ under the License. Maven 4 Core Maven Core classes. + + org.apache.maven.core + + diff --git a/impl/maven-di/pom.xml b/impl/maven-di/pom.xml index 4068da194b2e..2689bd2ab731 100644 --- a/impl/maven-di/pom.xml +++ b/impl/maven-di/pom.xml @@ -30,6 +30,10 @@ under the License. Maven 4 Dependency Injection Provides the implementation for the Dependency Injection mechanism in Maven + + org.apache.maven.di + + org.apache.maven @@ -47,4 +51,22 @@ under the License. + + + + org.apache.maven.plugins + maven-compiler-plugin + + + + org.apache.maven + maven-api-di + ${project.version} + + + + + + + diff --git a/impl/maven-di/src/main/java/module-info.java b/impl/maven-di/src/main/java/module-info.java new file mode 100644 index 000000000000..ae8f60fbaecc --- /dev/null +++ b/impl/maven-di/src/main/java/module-info.java @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + +module org.apache.maven.di { + requires transitive org.apache.maven.api.di; + requires org.apache.maven.api.annotations; + + exports org.apache.maven.di; + exports org.apache.maven.di.impl to + org.apache.maven.impl, + org.apache.maven.core, + org.apache.maven.testing, + org.apache.maven.cling, + org.apache.maven.embedder; +} diff --git a/impl/maven-executor/pom.xml b/impl/maven-executor/pom.xml index c4712962ce52..421c7c86f6f1 100644 --- a/impl/maven-executor/pom.xml +++ b/impl/maven-executor/pom.xml @@ -32,6 +32,7 @@ under the License. Maven 4 Executor, for executing Maven 3/4. + org.apache.maven.executor 3.9.14 ${project.version} ${project.build.directory}/tmp diff --git a/impl/maven-impl/pom.xml b/impl/maven-impl/pom.xml index e2005c800e61..ec3ab2d79f51 100644 --- a/impl/maven-impl/pom.xml +++ b/impl/maven-impl/pom.xml @@ -31,6 +31,7 @@ under the License. Provides the implementation classes for the Maven API + org.apache.maven.impl FileLength @@ -174,10 +175,24 @@ under the License. + + org.apache.maven.plugins + maven-compiler-plugin + + + + org.apache.maven + maven-api-di + ${project.version} + + + + org.apache.maven.plugins maven-surefire-plugin + false ${settings.localRepository} diff --git a/impl/maven-impl/src/main/java/module-info.java b/impl/maven-impl/src/main/java/module-info.java new file mode 100644 index 000000000000..66907e78cf79 --- /dev/null +++ b/impl/maven-impl/src/main/java/module-info.java @@ -0,0 +1,137 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + +open module org.apache.maven.impl { + requires transitive org.apache.maven.api; + requires transitive org.apache.maven.api.spi; + requires org.apache.maven.api.metadata; + requires org.apache.maven.api.xml; + requires org.apache.maven.api.di; + requires org.apache.maven.api.annotations; + requires org.apache.maven.di; + requires org.apache.maven.support; + requires org.apache.maven.internal.xml; + requires org.apache.maven.resolver; + requires org.apache.maven.resolver.spi; + requires org.apache.maven.resolver.util; + requires org.apache.maven.resolver.impl; + requires org.apache.maven.resolver.named.locks; + requires org.apache.maven.resolver.connector.basic; + requires com.ctc.wstx; + requires org.codehaus.stax2; + requires org.slf4j; + requires plexus.sec.dispatcher; + requires java.xml; + + exports org.apache.maven.api.services.model; + exports org.apache.maven.impl to + org.apache.maven.core, + org.apache.maven.cling, + org.apache.maven.testing, + org.apache.maven.compat, + org.apache.maven.embedder; + exports org.apache.maven.impl.cache to + org.apache.maven.core, + org.apache.maven.cling, + org.apache.maven.testing, + org.apache.maven.compat, + org.apache.maven.embedder; + exports org.apache.maven.impl.di to + org.apache.maven.core, + org.apache.maven.cling, + org.apache.maven.testing, + org.apache.maven.compat, + org.apache.maven.embedder; + exports org.apache.maven.impl.model to + org.apache.maven.core, + org.apache.maven.cling, + org.apache.maven.testing, + org.apache.maven.compat, + org.apache.maven.embedder; + exports org.apache.maven.impl.model.reflection to + org.apache.maven.core, + org.apache.maven.cling, + org.apache.maven.testing, + org.apache.maven.compat, + org.apache.maven.embedder; + exports org.apache.maven.impl.model.rootlocator to + org.apache.maven.core, + org.apache.maven.cling, + org.apache.maven.testing, + org.apache.maven.compat, + org.apache.maven.embedder; + exports org.apache.maven.impl.resolver to + org.apache.maven.core, + org.apache.maven.cling, + org.apache.maven.testing, + org.apache.maven.compat, + org.apache.maven.embedder; + exports org.apache.maven.impl.resolver.artifact to + org.apache.maven.core, + org.apache.maven.cling, + org.apache.maven.testing, + org.apache.maven.compat, + org.apache.maven.embedder; + exports org.apache.maven.impl.resolver.relocation to + org.apache.maven.core, + org.apache.maven.cling, + org.apache.maven.testing, + org.apache.maven.compat, + org.apache.maven.embedder; + exports org.apache.maven.impl.resolver.scopes to + org.apache.maven.core, + org.apache.maven.cling, + org.apache.maven.testing, + org.apache.maven.compat, + org.apache.maven.embedder; + exports org.apache.maven.impl.resolver.type to + org.apache.maven.core, + org.apache.maven.cling, + org.apache.maven.testing, + org.apache.maven.compat, + org.apache.maven.embedder; + exports org.apache.maven.impl.resolver.validator to + org.apache.maven.core, + org.apache.maven.cling, + org.apache.maven.testing, + org.apache.maven.compat, + org.apache.maven.embedder; + exports org.apache.maven.impl.standalone to + org.apache.maven.core, + org.apache.maven.cling, + org.apache.maven.testing, + org.apache.maven.compat, + org.apache.maven.embedder; + exports org.apache.maven.impl.util to + org.apache.maven.core, + org.apache.maven.cling, + org.apache.maven.testing, + org.apache.maven.compat, + org.apache.maven.embedder; + + uses org.apache.maven.api.services.model.RootDetector; + + provides org.apache.maven.api.model.ModelObjectProcessor with + org.apache.maven.impl.model.DefaultModelObjectPool; + provides org.apache.maven.api.services.model.RootDetector with + org.apache.maven.impl.model.rootlocator.DotMvnRootDetector, + org.apache.maven.impl.model.rootlocator.PomXmlRootDetector; + provides org.apache.maven.api.services.model.RootLocator with + org.apache.maven.impl.model.rootlocator.DefaultRootLocator; +} diff --git a/impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultModelBuilder.java b/impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultModelBuilder.java index aa282d272353..55959e4c91f6 100644 --- a/impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultModelBuilder.java +++ b/impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultModelBuilder.java @@ -201,7 +201,7 @@ public DefaultModelBuilder( this.dependencyManagementImporter = dependencyManagementImporter; this.pluginConfigurationExpander = pluginConfigurationExpander; this.versionParser = versionParser; - this.transformers = transformers; + this.transformers = transformers != null ? transformers : List.of(); this.modelResolver = modelResolver; this.interpolator = interpolator; this.pathTranslator = pathTranslator; diff --git a/impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultModelProcessor.java b/impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultModelProcessor.java index 49ce1c96e6c9..c2f37654ad35 100644 --- a/impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultModelProcessor.java +++ b/impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultModelProcessor.java @@ -74,7 +74,7 @@ public class DefaultModelProcessor implements ModelProcessor { @Inject public DefaultModelProcessor(ModelXmlFactory modelXmlFactory, @Nullable Map modelParsers) { this.modelXmlFactory = modelXmlFactory; - this.modelParsers = modelParsers; + this.modelParsers = modelParsers != null ? modelParsers : Map.of(); } @Override diff --git a/impl/maven-jline/pom.xml b/impl/maven-jline/pom.xml index 9ec3e9ae0c9c..9d40ba473a88 100644 --- a/impl/maven-jline/pom.xml +++ b/impl/maven-jline/pom.xml @@ -30,6 +30,10 @@ under the License. Maven 4 JLine integration Provides the JLine integration in Maven + + org.apache.maven.jline + + org.apache.maven @@ -81,4 +85,22 @@ under the License. jansi-core + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + + org.apache.maven + maven-api-di + ${project.version} + + + + + + diff --git a/impl/maven-jline/src/main/java/module-info.java b/impl/maven-jline/src/main/java/module-info.java new file mode 100644 index 000000000000..ec627d38e73e --- /dev/null +++ b/impl/maven-jline/src/main/java/module-info.java @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + +module org.apache.maven.jline { + requires org.apache.maven.api; + requires org.apache.maven.api.di; + requires org.apache.maven.api.annotations; + requires org.jline.reader; + requires org.jline.style; + requires org.jline.builtins; + requires org.jline.console; + requires org.jline.console.ui; + requires org.jline.terminal; + requires org.jline.terminal.jni; + requires org.jline.jansi.core; + + exports org.apache.maven.jline to + org.apache.maven.logging, + org.apache.maven.cling, + org.apache.maven.embedder; +} diff --git a/impl/maven-logging/pom.xml b/impl/maven-logging/pom.xml index 6f89f2bdbd15..1b689acbc817 100644 --- a/impl/maven-logging/pom.xml +++ b/impl/maven-logging/pom.xml @@ -30,6 +30,10 @@ under the License. Maven 4 Logging Provides the Maven Logging infrastructure + + org.apache.maven.logging + + org.apache.maven diff --git a/impl/maven-logging/src/main/java/module-info.java b/impl/maven-logging/src/main/java/module-info.java new file mode 100644 index 000000000000..57e1df701468 --- /dev/null +++ b/impl/maven-logging/src/main/java/module-info.java @@ -0,0 +1,33 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + +module org.apache.maven.logging { + requires org.apache.maven.api; + requires org.apache.maven.jline; + requires org.slf4j; + + exports org.apache.maven.logging.api; + exports org.apache.maven.slf4j to + org.apache.maven.cling, + org.apache.maven.embedder, + org.apache.maven.core; + + provides org.slf4j.spi.SLF4JServiceProvider with + org.apache.maven.slf4j.MavenServiceProvider; +} diff --git a/impl/maven-support/pom.xml b/impl/maven-support/pom.xml index 65f1eb0a7c5a..1d732e844959 100644 --- a/impl/maven-support/pom.xml +++ b/impl/maven-support/pom.xml @@ -30,6 +30,10 @@ under the License. Maven 4 Model Support Provides the Maven 4 Model Support + + org.apache.maven.support + + org.apache.maven @@ -55,6 +59,14 @@ under the License. org.apache.maven maven-xml + + com.fasterxml.woodstox + woodstox-core + + + org.codehaus.woodstox + stax2-api + org.junit.jupiter diff --git a/impl/maven-support/src/main/java/module-info.java b/impl/maven-support/src/main/java/module-info.java new file mode 100644 index 000000000000..60eb75c4ae23 --- /dev/null +++ b/impl/maven-support/src/main/java/module-info.java @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + +module org.apache.maven.support { + requires transitive org.apache.maven.api.model; + requires transitive org.apache.maven.api.settings; + requires transitive org.apache.maven.api.toolchain; + requires transitive org.apache.maven.api.metadata; + requires transitive org.apache.maven.api.plugin.descriptor; + requires transitive org.apache.maven.internal.xml; + requires java.xml; + requires com.ctc.wstx; + requires org.codehaus.stax2; + + exports org.apache.maven.model.v4; + exports org.apache.maven.settings.v4; + exports org.apache.maven.toolchain.v4; + exports org.apache.maven.metadata.v4; + exports org.apache.maven.plugin.descriptor.io; + exports org.apache.maven.plugin.lifecycle.io; +} diff --git a/impl/maven-testing/pom.xml b/impl/maven-testing/pom.xml index 4683a05adf5a..76438a593e68 100644 --- a/impl/maven-testing/pom.xml +++ b/impl/maven-testing/pom.xml @@ -30,6 +30,10 @@ under the License. Maven Plugin Testing Mechanism The Maven Plugin Testing Harness provides mechanisms to manage tests on Mojo. + + org.apache.maven.testing + + diff --git a/impl/maven-xml/pom.xml b/impl/maven-xml/pom.xml index fce318be3d4e..30021874c3cf 100644 --- a/impl/maven-xml/pom.xml +++ b/impl/maven-xml/pom.xml @@ -30,6 +30,10 @@ under the License. Maven 4 XML Implementation Provides the implementation classes for the Maven XML + + org.apache.maven.internal.xml + + org.apache.maven diff --git a/impl/maven-xml/src/main/java/module-info.java b/impl/maven-xml/src/main/java/module-info.java new file mode 100644 index 000000000000..aae140dfbc26 --- /dev/null +++ b/impl/maven-xml/src/main/java/module-info.java @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + +module org.apache.maven.internal.xml { + requires transitive org.apache.maven.api.xml; + requires java.xml; + requires com.ctc.wstx; + requires org.codehaus.stax2; + requires static org.eclipse.sisu.plexus; + requires static plexus.xml; + + exports org.apache.maven.internal.xml; + + provides org.apache.maven.api.xml.XmlService with + org.apache.maven.internal.xml.DefaultXmlService; +} diff --git a/pom.xml b/pom.xml index 72f3ee7ac0c8..3a81f35bbabd 100644 --- a/pom.xml +++ b/pom.xml @@ -802,6 +802,26 @@ under the License. + + org.apache.maven.plugins + maven-jar-plugin + + + + ${javaModuleName} + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + module-info.java + + + org.apache.rat apache-rat-plugin @@ -1107,6 +1127,10 @@ under the License. org.apache.maven.plugins maven-javadoc-plugin + true + + module-info.java + provisional