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 295b838a289ce765cae8e63f6ca630ac59ccc8e3 Author: Sylwester Lachiewicz <[email protected]> AuthorDate: Thu Nov 5 00:34:29 2026 +0000 Keep the purge-local-repository-without-pom IT It is the only IT that runs the goal without a project POM (requiresProject = false), a path the mocked-project unit test does not reach. --- pom.xml | 1 + .../invoker.properties | 18 ++++++++++++++ .../setup.groovy | 27 ++++++++++++++++++++ .../test.properties | 18 ++++++++++++++ .../verify.groovy | 29 ++++++++++++++++++++++ 5 files changed, 93 insertions(+) diff --git a/pom.xml b/pom.xml index ea92a08b..1aa98d24 100644 --- a/pom.xml +++ b/pom.xml @@ -449,6 +449,7 @@ under the License. <pomInclude>*/pom.xml</pomInclude> <pomInclude>add-dependency/*/pom.xml</pomInclude> <pomInclude>remove-dependency/*/pom.xml</pomInclude> + <pomInclude>purge-local-repository-without-pom</pomInclude> </pomIncludes> <!-- for mrm --> <settingsFile>src/it/mrm/settings.xml</settingsFile> diff --git a/src/it/projects/purge-local-repository-without-pom/invoker.properties b/src/it/projects/purge-local-repository-without-pom/invoker.properties new file mode 100644 index 00000000..3c1911e6 --- /dev/null +++ b/src/it/projects/purge-local-repository-without-pom/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}:purge-local-repository diff --git a/src/it/projects/purge-local-repository-without-pom/setup.groovy b/src/it/projects/purge-local-repository-without-pom/setup.groovy new file mode 100644 index 00000000..dba9cfb3 --- /dev/null +++ b/src/it/projects/purge-local-repository-without-pom/setup.groovy @@ -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. + */ + +import java.io.*; + +File purgedJar = new File( localRepositoryPath, "org/apache/maven/its/dependency/purged-without-pom/1.0/purged-without-pom-1.0.jar" ); + +purgedJar.getParentFile().mkdirs(); +purgedJar.createNewFile(); + +return true; diff --git a/src/it/projects/purge-local-repository-without-pom/test.properties b/src/it/projects/purge-local-repository-without-pom/test.properties new file mode 100644 index 00000000..e7bd2491 --- /dev/null +++ b/src/it/projects/purge-local-repository-without-pom/test.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. + +manualInclude = org.apache.maven.its.dependency:purged-without-pom diff --git a/src/it/projects/purge-local-repository-without-pom/verify.groovy b/src/it/projects/purge-local-repository-without-pom/verify.groovy new file mode 100644 index 00000000..1d7c24ed --- /dev/null +++ b/src/it/projects/purge-local-repository-without-pom/verify.groovy @@ -0,0 +1,29 @@ +/* + * 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. + */ + +void checkFileAbsence( String path ) +{ + File depJar = new File( localRepositoryPath, path ) + assert !depJar.exists() : "Dependency jar was not purged: " + depJar +} + +checkFileAbsence( "org/apache/maven/its/dependency/purged-without-pom/1.0/purged-without-pom-1.0.jar" ) + +String buildLog = new File( basedir, "build.log" ).getText( "UTF-8" ) +assert buildLog.contains( 'Deleting 1 manual dependency from ' )
