This is an automated email from the ASF dual-hosted git repository. slachiewicz pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/maven-dependency-plugin.git
commit 2c2ed42daaffcc2d5d88c02c1d07da39c998290a Author: Pericart Vincent[ PERICARTVINCENT ] <[email protected]> AuthorDate: Wed Oct 21 10:30:04 2026 +0900 Test go-offline across external and reactor dependencies Add an invoker project where module A depends on an external mock-repository artifact whose dependency is reactor module B. Verify that go-offline resolves the external artifact without requesting or downloading B's JAR. The test fails against upstream's implementation when it tries to resolve the unbuilt reactor artifact. --- .../go-offline-transitive-reactor-external-1.0.pom | 37 +++++++++++++++++++ .../invoker.properties | 18 ++++++++++ .../go-offline-transitive-reactor/module-a/pom.xml | 41 ++++++++++++++++++++++ .../go-offline-transitive-reactor/module-b/pom.xml | 33 +++++++++++++++++ .../projects/go-offline-transitive-reactor/pom.xml | 37 +++++++++++++++++++ .../go-offline-transitive-reactor/verify.groovy | 26 ++++++++++++++ 6 files changed, 192 insertions(+) diff --git a/src/it/mrm/repository/go-offline-transitive-reactor-external-1.0.pom b/src/it/mrm/repository/go-offline-transitive-reactor-external-1.0.pom new file mode 100644 index 00000000..405aa448 --- /dev/null +++ b/src/it/mrm/repository/go-offline-transitive-reactor-external-1.0.pom @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + ~ 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. + --> + +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.dependency</groupId> + <artifactId>go-offline-transitive-reactor-external</artifactId> + <version>1.0</version> + + <dependencies> + <dependency> + <groupId>org.apache.maven.its.dependency</groupId> + <artifactId>go-offline-transitive-reactor-b</artifactId> + <version>1.0</version> + </dependency> + </dependencies> +</project> diff --git a/src/it/projects/go-offline-transitive-reactor/invoker.properties b/src/it/projects/go-offline-transitive-reactor/invoker.properties new file mode 100644 index 00000000..be012175 --- /dev/null +++ b/src/it/projects/go-offline-transitive-reactor/invoker.properties @@ -0,0 +1,18 @@ +# 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. + +invoker.goals = ${project.groupId}:${project.artifactId}:${project.version}:go-offline diff --git a/src/it/projects/go-offline-transitive-reactor/module-a/pom.xml b/src/it/projects/go-offline-transitive-reactor/module-a/pom.xml new file mode 100644 index 00000000..98c9a2bf --- /dev/null +++ b/src/it/projects/go-offline-transitive-reactor/module-a/pom.xml @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + ~ 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. + --> + +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.maven.its.dependency</groupId> + <artifactId>go-offline-transitive-reactor</artifactId> + <version>1.0</version> + </parent> + + <artifactId>go-offline-transitive-reactor-a</artifactId> + + <dependencies> + <dependency> + <groupId>org.apache.maven.its.dependency</groupId> + <artifactId>go-offline-transitive-reactor-external</artifactId> + <version>1.0</version> + </dependency> + </dependencies> +</project> diff --git a/src/it/projects/go-offline-transitive-reactor/module-b/pom.xml b/src/it/projects/go-offline-transitive-reactor/module-b/pom.xml new file mode 100644 index 00000000..7f6b715b --- /dev/null +++ b/src/it/projects/go-offline-transitive-reactor/module-b/pom.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + ~ 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. + --> + +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.maven.its.dependency</groupId> + <artifactId>go-offline-transitive-reactor</artifactId> + <version>1.0</version> + </parent> + + <artifactId>go-offline-transitive-reactor-b</artifactId> +</project> diff --git a/src/it/projects/go-offline-transitive-reactor/pom.xml b/src/it/projects/go-offline-transitive-reactor/pom.xml new file mode 100644 index 00000000..54b1dfa4 --- /dev/null +++ b/src/it/projects/go-offline-transitive-reactor/pom.xml @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + ~ 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. + --> + +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.its.dependency</groupId> + <artifactId>go-offline-transitive-reactor</artifactId> + <version>1.0</version> + <packaging>pom</packaging> + + <description>Go offline with an external dependency that depends on a reactor module</description> + + <modules> + <module>module-b</module> + <module>module-a</module> + </modules> +</project> diff --git a/src/it/projects/go-offline-transitive-reactor/verify.groovy b/src/it/projects/go-offline-transitive-reactor/verify.groovy new file mode 100644 index 00000000..2fdc9ea4 --- /dev/null +++ b/src/it/projects/go-offline-transitive-reactor/verify.groovy @@ -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. + */ + +String buildLog = new File(basedir, 'build.log').getText('UTF-8') + +assert buildLog.contains('Resolved dependency: go-offline-transitive-reactor-external-1.0.jar') +assert !buildLog.contains('Resolved dependency: go-offline-transitive-reactor-b-1.0.jar') +assert !buildLog.contains('/go-offline-transitive-reactor-b-1.0.jar') +assert !new File(localRepositoryPath, + 'org/apache/maven/its/dependency/go-offline-transitive-reactor-b/1.0/go-offline-transitive-reactor-b-1.0.jar').exists()
