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-install-plugin.git
commit dc812e384c357de6f6619afd85088c3c9bb78011 Author: Sylwester Lachiewicz <[email protected]> AuthorDate: Sat Nov 21 15:34:39 2026 +0100 Replace minstall-121 ITs with parameterized unit tests Part of #501 --- pom.xml | 5 + .../invoker.properties | 18 -- src/it/install-file-minstall-121-bundle/pom.xml | 46 ----- .../install-file-minstall-121-bundle/setup.groovy | 29 ---- .../install-file-minstall-121-bundle/test-0.1.jar | Bin 345 -> 0 bytes .../install-file-minstall-121-bundle/test-0.1.pom | 35 ---- .../test.properties | 21 --- .../install-file-minstall-121-bundle/verify.groovy | 52 ------ .../invoker.properties | 18 -- .../install-file-minstall-121-java-source/pom.xml | 46 ----- .../setup.groovy | 29 ---- .../test-0.1.jar | Bin 345 -> 0 bytes .../test-0.1.pom | 35 ---- .../test.properties | 20 --- .../verify.groovy | 52 ------ .../invoker.properties | 18 -- .../pom.xml | 46 ----- .../setup.groovy | 29 ---- .../test-0.1.jar | Bin 345 -> 0 bytes .../test-0.1.pom | 35 ---- .../test.properties | 21 --- .../verify.groovy | 52 ------ .../invoker.properties | 18 -- src/it/install-file-minstall-121-targz/pom.xml | 46 ----- .../install-file-minstall-121-targz/setup.groovy | 29 ---- .../install-file-minstall-121-targz/test-0.1.pom | 35 ---- .../test-0.1.tar.gz | Bin 345 -> 0 bytes .../test.properties | 21 --- .../install-file-minstall-121-targz/verify.groovy | 52 ------ .../invoker.properties | 18 -- src/it/install-file-minstall-121-war/pom.xml | 46 ----- src/it/install-file-minstall-121-war/setup.groovy | 29 ---- src/it/install-file-minstall-121-war/test-0.1.pom | 35 ---- src/it/install-file-minstall-121-war/test-0.1.war | Bin 345 -> 0 bytes .../install-file-minstall-121-war/test.properties | 20 --- src/it/install-file-minstall-121-war/verify.groovy | 52 ------ .../install-file-minstall-121/invoker.properties | 18 -- src/it/install-file-minstall-121/pom.xml | 46 ----- src/it/install-file-minstall-121/setup.groovy | 29 ---- src/it/install-file-minstall-121/test-0.1.jar | Bin 345 -> 0 bytes src/it/install-file-minstall-121/test-0.1.pom | 35 ---- src/it/install-file-minstall-121/test.properties | 20 --- src/it/install-file-minstall-121/verify.groovy | 52 ------ .../install-file-missing-file/invoker.properties | 19 --- src/it/local-repo-override/invoker.properties | 18 -- src/it/local-repo-override/pom.xml | 46 ----- src/it/local-repo-override/setup.groovy | 29 ---- src/it/local-repo-override/test.jar | Bin 345 -> 0 bytes src/it/local-repo-override/test.properties | 23 --- src/it/local-repo-override/verify.groovy | 38 ----- .../maven/plugins/install/InstallFileMojoTest.java | 188 +++++++++++++++++++++ 51 files changed, 193 insertions(+), 1376 deletions(-) diff --git a/pom.xml b/pom.xml index f635312..29ef833 100644 --- a/pom.xml +++ b/pom.xml @@ -163,6 +163,11 @@ <artifactId>junit-jupiter-api</artifactId> <scope>test</scope> </dependency> + <dependency> + <groupId>org.junit.jupiter</groupId> + <artifactId>junit-jupiter-params</artifactId> + <scope>test</scope> + </dependency> <dependency> <groupId>org.apache.maven.plugin-testing</groupId> <artifactId>maven-plugin-testing-harness</artifactId> diff --git a/src/it/install-file-minstall-121-bundle/invoker.properties b/src/it/install-file-minstall-121-bundle/invoker.properties deleted file mode 100644 index 0413238..0000000 --- a/src/it/install-file-minstall-121-bundle/invoker.properties +++ /dev/null @@ -1,18 +0,0 @@ -# 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 = org.apache.maven.plugins:maven-install-plugin:${project.version}:install-file diff --git a/src/it/install-file-minstall-121-bundle/pom.xml b/src/it/install-file-minstall-121-bundle/pom.xml deleted file mode 100644 index c4e69fd..0000000 --- a/src/it/install-file-minstall-121-bundle/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ -<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <groupId>org.apache.maven.its.install.121</groupId> - <artifactId>test-maven-bundle</artifactId> - <version>1.0</version> - <packaging>jar</packaging> - - <description> - Test to install a file via install:install-file using - packaging and expected having a different file extension. - </description> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-install-plugin</artifactId> - <version>@project.version@</version> - </plugin> - </plugins> - </build> - -</project> diff --git a/src/it/install-file-minstall-121-bundle/setup.groovy b/src/it/install-file-minstall-121-bundle/setup.groovy deleted file mode 100644 index d6aed1d..0000000 --- a/src/it/install-file-minstall-121-bundle/setup.groovy +++ /dev/null @@ -1,29 +0,0 @@ -/* - * 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.*; -import java.util.*; - -import org.codehaus.plexus.util.*; - -File file = new File( localRepositoryPath, "org/apache/maven/its/install/121/maven-bundle" ); -System.out.println( "Deleting " + file ); -FileUtils.deleteDirectory( file ); - -return true; diff --git a/src/it/install-file-minstall-121-bundle/test-0.1.jar b/src/it/install-file-minstall-121-bundle/test-0.1.jar deleted file mode 100644 index 226277c..0000000 Binary files a/src/it/install-file-minstall-121-bundle/test-0.1.jar and /dev/null differ diff --git a/src/it/install-file-minstall-121-bundle/test-0.1.pom b/src/it/install-file-minstall-121-bundle/test-0.1.pom deleted file mode 100644 index 0ecd8ab..0000000 --- a/src/it/install-file-minstall-121-bundle/test-0.1.pom +++ /dev/null @@ -1,35 +0,0 @@ -<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <parent> - <groupId>org.apache.maven.its.install.121</groupId> - <artifactId>parent</artifactId> - <version>1.0</version> - </parent> - - <!-- NOTE: Inherit everything from the parent --> - <artifactId>maven-bundle</artifactId> - -</project> diff --git a/src/it/install-file-minstall-121-bundle/test.properties b/src/it/install-file-minstall-121-bundle/test.properties deleted file mode 100644 index 8c87fbf..0000000 --- a/src/it/install-file-minstall-121-bundle/test.properties +++ /dev/null @@ -1,21 +0,0 @@ -# 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. - -file = test-0.1.jar -pomFile = test-0.1.pom -packaging = bundle -extension = jar diff --git a/src/it/install-file-minstall-121-bundle/verify.groovy b/src/it/install-file-minstall-121-bundle/verify.groovy deleted file mode 100644 index c22a9f6..0000000 --- a/src/it/install-file-minstall-121-bundle/verify.groovy +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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.*; -import java.util.*; - -String[] paths = -[ - "org/apache/maven/its/install/121/maven-bundle/maven-metadata-local.xml", - "org/apache/maven/its/install/121/maven-bundle/1.0/maven-bundle-1.0.pom", - "org/apache/maven/its/install/121/maven-bundle/1.0/maven-bundle-1.0.jar", // packaging bundle is NOT in core! (explicitly set with -Dextension=jar) -]; - -for ( String path : paths ) -{ - File file = new File( localRepositoryPath, path ); - System.out.println( "Checking for existence of " + file ); - if ( !file.isFile() ) - { - throw new FileNotFoundException( "Missing: " + file.getAbsolutePath() ); - } -} - -File file = new File( basedir, "test-0.1.pom" ); -if ( !file.isFile() ) -{ - throw new FileNotFoundException( "Missing: " + file.getAbsolutePath() ); -} - -file = new File( basedir, "test-0.1.jar" ); -if ( !file.isFile() ) -{ - throw new FileNotFoundException( "Missing: " + file.getAbsolutePath() ); -} - -return true; diff --git a/src/it/install-file-minstall-121-java-source/invoker.properties b/src/it/install-file-minstall-121-java-source/invoker.properties deleted file mode 100644 index 0413238..0000000 --- a/src/it/install-file-minstall-121-java-source/invoker.properties +++ /dev/null @@ -1,18 +0,0 @@ -# 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 = org.apache.maven.plugins:maven-install-plugin:${project.version}:install-file diff --git a/src/it/install-file-minstall-121-java-source/pom.xml b/src/it/install-file-minstall-121-java-source/pom.xml deleted file mode 100644 index 6791ccc..0000000 --- a/src/it/install-file-minstall-121-java-source/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ -<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <groupId>org.apache.maven.its.install.121</groupId> - <artifactId>test-java-source</artifactId> - <version>1.0</version> - <packaging>jar</packaging> - - <description> - Test to install a file via install:install-file using - packaging and expected having a different file extension. - </description> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-install-plugin</artifactId> - <version>@project.version@</version> - </plugin> - </plugins> - </build> - -</project> diff --git a/src/it/install-file-minstall-121-java-source/setup.groovy b/src/it/install-file-minstall-121-java-source/setup.groovy deleted file mode 100644 index 13320f2..0000000 --- a/src/it/install-file-minstall-121-java-source/setup.groovy +++ /dev/null @@ -1,29 +0,0 @@ -/* - * 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.*; -import java.util.*; - -import org.codehaus.plexus.util.*; - -File file = new File( localRepositoryPath, "org/apache/maven/its/install/121/test-java-source" ); -System.out.println( "Deleting " + file ); -FileUtils.deleteDirectory( file ); - -return true; diff --git a/src/it/install-file-minstall-121-java-source/test-0.1.jar b/src/it/install-file-minstall-121-java-source/test-0.1.jar deleted file mode 100644 index 226277c..0000000 Binary files a/src/it/install-file-minstall-121-java-source/test-0.1.jar and /dev/null differ diff --git a/src/it/install-file-minstall-121-java-source/test-0.1.pom b/src/it/install-file-minstall-121-java-source/test-0.1.pom deleted file mode 100644 index 1450a04..0000000 --- a/src/it/install-file-minstall-121-java-source/test-0.1.pom +++ /dev/null @@ -1,35 +0,0 @@ -<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <parent> - <groupId>org.apache.maven.its.install.121</groupId> - <artifactId>parent</artifactId> - <version>1.0</version> - </parent> - - <!-- NOTE: Inherit everything from the parent --> - <artifactId>test-java-source</artifactId> - -</project> diff --git a/src/it/install-file-minstall-121-java-source/test.properties b/src/it/install-file-minstall-121-java-source/test.properties deleted file mode 100644 index 0ece313..0000000 --- a/src/it/install-file-minstall-121-java-source/test.properties +++ /dev/null @@ -1,20 +0,0 @@ -# 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. - -file = test-0.1.jar -pomFile = test-0.1.pom -packaging = java-source diff --git a/src/it/install-file-minstall-121-java-source/verify.groovy b/src/it/install-file-minstall-121-java-source/verify.groovy deleted file mode 100644 index f80a242..0000000 --- a/src/it/install-file-minstall-121-java-source/verify.groovy +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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.*; -import java.util.*; - -String[] paths = -[ - "org/apache/maven/its/install/121/test-java-source/maven-metadata-local.xml", - "org/apache/maven/its/install/121/test-java-source/1.0/test-java-source-1.0.pom", - "org/apache/maven/its/install/121/test-java-source/1.0/test-java-source-1.0-sources.jar", // packaging java-source IS in core -]; - -for ( String path : paths ) -{ - File file = new File( localRepositoryPath, path ); - System.out.println( "Checking for existence of " + file ); - if ( !file.isFile() ) - { - throw new FileNotFoundException( "Missing: " + file.getAbsolutePath() ); - } -} - -File file = new File( basedir, "test-0.1.pom" ); -if ( !file.isFile() ) -{ - throw new FileNotFoundException( "Missing: " + file.getAbsolutePath() ); -} - -file = new File( basedir, "test-0.1.jar" ); -if ( !file.isFile() ) -{ - throw new FileNotFoundException( "Missing: " + file.getAbsolutePath() ); -} - -return true; diff --git a/src/it/install-file-minstall-121-maven-archetype/invoker.properties b/src/it/install-file-minstall-121-maven-archetype/invoker.properties deleted file mode 100644 index 0413238..0000000 --- a/src/it/install-file-minstall-121-maven-archetype/invoker.properties +++ /dev/null @@ -1,18 +0,0 @@ -# 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 = org.apache.maven.plugins:maven-install-plugin:${project.version}:install-file diff --git a/src/it/install-file-minstall-121-maven-archetype/pom.xml b/src/it/install-file-minstall-121-maven-archetype/pom.xml deleted file mode 100644 index 02d7634..0000000 --- a/src/it/install-file-minstall-121-maven-archetype/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ -<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <groupId>org.apache.maven.its.install.121</groupId> - <artifactId>test-maven-archetype</artifactId> - <version>1.0</version> - <packaging>jar</packaging> - - <description> - Test to install a file via install:install-file using - packaging and expected having a different file extension. - </description> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-install-plugin</artifactId> - <version>@project.version@</version> - </plugin> - </plugins> - </build> - -</project> diff --git a/src/it/install-file-minstall-121-maven-archetype/setup.groovy b/src/it/install-file-minstall-121-maven-archetype/setup.groovy deleted file mode 100644 index 9e901ad..0000000 --- a/src/it/install-file-minstall-121-maven-archetype/setup.groovy +++ /dev/null @@ -1,29 +0,0 @@ -/* - * 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.*; -import java.util.*; - -import org.codehaus.plexus.util.*; - -File file = new File( localRepositoryPath, "org/apache/maven/its/install/121/maven-archetype" ); -System.out.println( "Deleting " + file ); -FileUtils.deleteDirectory( file ); - -return true; diff --git a/src/it/install-file-minstall-121-maven-archetype/test-0.1.jar b/src/it/install-file-minstall-121-maven-archetype/test-0.1.jar deleted file mode 100644 index 226277c..0000000 Binary files a/src/it/install-file-minstall-121-maven-archetype/test-0.1.jar and /dev/null differ diff --git a/src/it/install-file-minstall-121-maven-archetype/test-0.1.pom b/src/it/install-file-minstall-121-maven-archetype/test-0.1.pom deleted file mode 100644 index cebbd95..0000000 --- a/src/it/install-file-minstall-121-maven-archetype/test-0.1.pom +++ /dev/null @@ -1,35 +0,0 @@ -<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <parent> - <groupId>org.apache.maven.its.install.121</groupId> - <artifactId>parent</artifactId> - <version>1.0</version> - </parent> - - <!-- NOTE: Inherit everything from the parent --> - <artifactId>maven-archetype</artifactId> - -</project> diff --git a/src/it/install-file-minstall-121-maven-archetype/test.properties b/src/it/install-file-minstall-121-maven-archetype/test.properties deleted file mode 100644 index 393cdfd..0000000 --- a/src/it/install-file-minstall-121-maven-archetype/test.properties +++ /dev/null @@ -1,21 +0,0 @@ -# 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. - -file = test-0.1.jar -pomFile = test-0.1.pom -packaging = maven-archetype -extension = jar diff --git a/src/it/install-file-minstall-121-maven-archetype/verify.groovy b/src/it/install-file-minstall-121-maven-archetype/verify.groovy deleted file mode 100644 index 23eae24..0000000 --- a/src/it/install-file-minstall-121-maven-archetype/verify.groovy +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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.*; -import java.util.*; - -String[] paths = -[ - "org/apache/maven/its/install/121/maven-archetype/maven-metadata-local.xml", - "org/apache/maven/its/install/121/maven-archetype/1.0/maven-archetype-1.0.pom", - "org/apache/maven/its/install/121/maven-archetype/1.0/maven-archetype-1.0.jar", // packaging maven-archetype is NOT in core! (explicitly set with -Dextension=jar) -]; - -for ( String path : paths ) -{ - File file = new File( localRepositoryPath, path ); - System.out.println( "Checking for existence of " + file ); - if ( !file.isFile() ) - { - throw new FileNotFoundException( "Missing: " + file.getAbsolutePath() ); - } -} - -File file = new File( basedir, "test-0.1.pom" ); -if ( !file.isFile() ) -{ - throw new FileNotFoundException( "Missing: " + file.getAbsolutePath() ); -} - -file = new File( basedir, "test-0.1.jar" ); -if ( !file.isFile() ) -{ - throw new FileNotFoundException( "Missing: " + file.getAbsolutePath() ); -} - -return true; diff --git a/src/it/install-file-minstall-121-targz/invoker.properties b/src/it/install-file-minstall-121-targz/invoker.properties deleted file mode 100644 index 0413238..0000000 --- a/src/it/install-file-minstall-121-targz/invoker.properties +++ /dev/null @@ -1,18 +0,0 @@ -# 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 = org.apache.maven.plugins:maven-install-plugin:${project.version}:install-file diff --git a/src/it/install-file-minstall-121-targz/pom.xml b/src/it/install-file-minstall-121-targz/pom.xml deleted file mode 100644 index 72009e3..0000000 --- a/src/it/install-file-minstall-121-targz/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ -<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <groupId>org.apache.maven.its.install.121</groupId> - <artifactId>test-targz</artifactId> - <version>1.0</version> - <packaging>jar</packaging> - - <description> - Test to install a file via install:install-file using - packaging and expected having a different file extension. - </description> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-install-plugin</artifactId> - <version>@project.version@</version> - </plugin> - </plugins> - </build> - -</project> diff --git a/src/it/install-file-minstall-121-targz/setup.groovy b/src/it/install-file-minstall-121-targz/setup.groovy deleted file mode 100644 index 44849e7..0000000 --- a/src/it/install-file-minstall-121-targz/setup.groovy +++ /dev/null @@ -1,29 +0,0 @@ -/* - * 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.*; -import java.util.*; - -import org.codehaus.plexus.util.*; - -File file = new File( localRepositoryPath, "org/apache/maven/its/install/121/test-targz" ); -System.out.println( "Deleting " + file ); -FileUtils.deleteDirectory( file ); - -return true; diff --git a/src/it/install-file-minstall-121-targz/test-0.1.pom b/src/it/install-file-minstall-121-targz/test-0.1.pom deleted file mode 100644 index fe478fe..0000000 --- a/src/it/install-file-minstall-121-targz/test-0.1.pom +++ /dev/null @@ -1,35 +0,0 @@ -<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <parent> - <groupId>org.apache.maven.its.install.121</groupId> - <artifactId>parent</artifactId> - <version>1.0</version> - </parent> - - <!-- NOTE: Inherit everything from the parent --> - <artifactId>test-targz</artifactId> - -</project> diff --git a/src/it/install-file-minstall-121-targz/test-0.1.tar.gz b/src/it/install-file-minstall-121-targz/test-0.1.tar.gz deleted file mode 100644 index 226277c..0000000 Binary files a/src/it/install-file-minstall-121-targz/test-0.1.tar.gz and /dev/null differ diff --git a/src/it/install-file-minstall-121-targz/test.properties b/src/it/install-file-minstall-121-targz/test.properties deleted file mode 100644 index 50af2b8..0000000 --- a/src/it/install-file-minstall-121-targz/test.properties +++ /dev/null @@ -1,21 +0,0 @@ -# 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. - -file = test-0.1.tar.gz -pomFile = test-0.1.pom -packaging = war -extension = tar.gz diff --git a/src/it/install-file-minstall-121-targz/verify.groovy b/src/it/install-file-minstall-121-targz/verify.groovy deleted file mode 100644 index 18d4c13..0000000 --- a/src/it/install-file-minstall-121-targz/verify.groovy +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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.*; -import java.util.*; - -String[] paths = -[ - "org/apache/maven/its/install/121/test-targz/maven-metadata-local.xml", - "org/apache/maven/its/install/121/test-targz/1.0/test-targz-1.0.pom", - "org/apache/maven/its/install/121/test-targz/1.0/test-targz-1.0.tar.gz", // this test is totally fluke: deploy POM.packaging=war and main artifact tar.gz -]; - -for ( String path : paths ) -{ - File file = new File( localRepositoryPath, path ); - System.out.println( "Checking for existence of " + file ); - if ( !file.isFile() ) - { - throw new FileNotFoundException( "Missing: " + file.getAbsolutePath() ); - } -} - -File file = new File( basedir, "test-0.1.pom" ); -if ( !file.isFile() ) -{ - throw new FileNotFoundException( "Missing: " + file.getAbsolutePath() ); -} - -file = new File( basedir, "test-0.1.tar.gz" ); -if ( !file.isFile() ) -{ - throw new FileNotFoundException( "Missing: " + file.getAbsolutePath() ); -} - -return true; diff --git a/src/it/install-file-minstall-121-war/invoker.properties b/src/it/install-file-minstall-121-war/invoker.properties deleted file mode 100644 index 0413238..0000000 --- a/src/it/install-file-minstall-121-war/invoker.properties +++ /dev/null @@ -1,18 +0,0 @@ -# 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 = org.apache.maven.plugins:maven-install-plugin:${project.version}:install-file diff --git a/src/it/install-file-minstall-121-war/pom.xml b/src/it/install-file-minstall-121-war/pom.xml deleted file mode 100644 index d4c252b..0000000 --- a/src/it/install-file-minstall-121-war/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ -<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <groupId>org.apache.maven.its.install.121</groupId> - <artifactId>test-war</artifactId> - <version>1.0</version> - <packaging>jar</packaging> - - <description> - Test to install a file via install:install-file using - packaging and expected having a different file extension. - </description> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-install-plugin</artifactId> - <version>@project.version@</version> - </plugin> - </plugins> - </build> - -</project> diff --git a/src/it/install-file-minstall-121-war/setup.groovy b/src/it/install-file-minstall-121-war/setup.groovy deleted file mode 100644 index 3d2bc79..0000000 --- a/src/it/install-file-minstall-121-war/setup.groovy +++ /dev/null @@ -1,29 +0,0 @@ -/* - * 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.*; -import java.util.*; - -import org.codehaus.plexus.util.*; - -File file = new File( localRepositoryPath, "org/apache/maven/its/install/121/test-war" ); -System.out.println( "Deleting " + file ); -FileUtils.deleteDirectory( file ); - -return true; diff --git a/src/it/install-file-minstall-121-war/test-0.1.pom b/src/it/install-file-minstall-121-war/test-0.1.pom deleted file mode 100644 index 23fd7dd..0000000 --- a/src/it/install-file-minstall-121-war/test-0.1.pom +++ /dev/null @@ -1,35 +0,0 @@ -<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <parent> - <groupId>org.apache.maven.its.install.121</groupId> - <artifactId>parent</artifactId> - <version>1.0</version> - </parent> - - <!-- NOTE: Inherit everything from the parent --> - <artifactId>test-war</artifactId> - -</project> diff --git a/src/it/install-file-minstall-121-war/test-0.1.war b/src/it/install-file-minstall-121-war/test-0.1.war deleted file mode 100644 index 226277c..0000000 Binary files a/src/it/install-file-minstall-121-war/test-0.1.war and /dev/null differ diff --git a/src/it/install-file-minstall-121-war/test.properties b/src/it/install-file-minstall-121-war/test.properties deleted file mode 100644 index 40edeff..0000000 --- a/src/it/install-file-minstall-121-war/test.properties +++ /dev/null @@ -1,20 +0,0 @@ -# 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. - -file = test-0.1.war -pomFile = test-0.1.pom -packaging = war diff --git a/src/it/install-file-minstall-121-war/verify.groovy b/src/it/install-file-minstall-121-war/verify.groovy deleted file mode 100644 index e4e5842..0000000 --- a/src/it/install-file-minstall-121-war/verify.groovy +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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.*; -import java.util.*; - -String[] paths = -[ - "org/apache/maven/its/install/121/test-war/maven-metadata-local.xml", - "org/apache/maven/its/install/121/test-war/1.0/test-war-1.0.pom", - "org/apache/maven/its/install/121/test-war/1.0/test-war-1.0.war", -]; - -for ( String path : paths ) -{ - File file = new File( localRepositoryPath, path ); - System.out.println( "Checking for existence of " + file ); - if ( !file.isFile() ) - { - throw new FileNotFoundException( "Missing: " + file.getAbsolutePath() ); - } -} - -File file = new File( basedir, "test-0.1.pom" ); -if ( !file.isFile() ) -{ - throw new FileNotFoundException( "Missing: " + file.getAbsolutePath() ); -} - -file = new File( basedir, "test-0.1.war" ); -if ( !file.isFile() ) -{ - throw new FileNotFoundException( "Missing: " + file.getAbsolutePath() ); -} - -return true; diff --git a/src/it/install-file-minstall-121/invoker.properties b/src/it/install-file-minstall-121/invoker.properties deleted file mode 100644 index 0413238..0000000 --- a/src/it/install-file-minstall-121/invoker.properties +++ /dev/null @@ -1,18 +0,0 @@ -# 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 = org.apache.maven.plugins:maven-install-plugin:${project.version}:install-file diff --git a/src/it/install-file-minstall-121/pom.xml b/src/it/install-file-minstall-121/pom.xml deleted file mode 100644 index 4ba0c85..0000000 --- a/src/it/install-file-minstall-121/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ -<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <groupId>org.apache.maven.its.install.121</groupId> - <artifactId>test</artifactId> - <version>1.0</version> - <packaging>jar</packaging> - - <description> - Test to install a file via install:install-file using - packaging and expected having a different file extension. - </description> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-install-plugin</artifactId> - <version>@project.version@</version> - </plugin> - </plugins> - </build> - -</project> diff --git a/src/it/install-file-minstall-121/setup.groovy b/src/it/install-file-minstall-121/setup.groovy deleted file mode 100644 index 623cb65..0000000 --- a/src/it/install-file-minstall-121/setup.groovy +++ /dev/null @@ -1,29 +0,0 @@ -/* - * 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.*; -import java.util.*; - -import org.codehaus.plexus.util.*; - -File file = new File( localRepositoryPath, "org/apache/maven/its/install/121" ); -System.out.println( "Deleting " + file ); -FileUtils.deleteDirectory( file ); - -return true; diff --git a/src/it/install-file-minstall-121/test-0.1.jar b/src/it/install-file-minstall-121/test-0.1.jar deleted file mode 100644 index 226277c..0000000 Binary files a/src/it/install-file-minstall-121/test-0.1.jar and /dev/null differ diff --git a/src/it/install-file-minstall-121/test-0.1.pom b/src/it/install-file-minstall-121/test-0.1.pom deleted file mode 100644 index dd23c6e..0000000 --- a/src/it/install-file-minstall-121/test-0.1.pom +++ /dev/null @@ -1,35 +0,0 @@ -<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <parent> - <groupId>org.apache.maven.its.install.121</groupId> - <artifactId>parent</artifactId> - <version>1.0</version> - </parent> - - <!-- NOTE: Inherit everything from the parent --> - <artifactId>test</artifactId> - -</project> diff --git a/src/it/install-file-minstall-121/test.properties b/src/it/install-file-minstall-121/test.properties deleted file mode 100644 index 0bf34e9..0000000 --- a/src/it/install-file-minstall-121/test.properties +++ /dev/null @@ -1,20 +0,0 @@ -# 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. - -file = test-0.1.jar -pomFile = test-0.1.pom -packaging = maven-plugin diff --git a/src/it/install-file-minstall-121/verify.groovy b/src/it/install-file-minstall-121/verify.groovy deleted file mode 100644 index c77965d..0000000 --- a/src/it/install-file-minstall-121/verify.groovy +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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.*; -import java.util.*; - -String[] paths = -[ - "org/apache/maven/its/install/121/test/maven-metadata-local.xml", - "org/apache/maven/its/install/121/test/1.0/test-1.0.pom", - "org/apache/maven/its/install/121/test/1.0/test-1.0.jar", -]; - -for ( String path : paths ) -{ - File file = new File( localRepositoryPath, path ); - System.out.println( "Checking for existence of " + file ); - if ( !file.isFile() ) - { - throw new FileNotFoundException( "Missing: " + file.getAbsolutePath() ); - } -} - -File file = new File( basedir, "test-0.1.pom" ); -if ( !file.isFile() ) -{ - throw new FileNotFoundException( "Missing: " + file.getAbsolutePath() ); -} - -file = new File( basedir, "test-0.1.jar" ); -if ( !file.isFile() ) -{ - throw new FileNotFoundException( "Missing: " + file.getAbsolutePath() ); -} - -return true; diff --git a/src/it/install-file-missing-file/invoker.properties b/src/it/install-file-missing-file/invoker.properties deleted file mode 100644 index c7485d3..0000000 --- a/src/it/install-file-missing-file/invoker.properties +++ /dev/null @@ -1,19 +0,0 @@ -# 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 = org.apache.maven.plugins:maven-install-plugin:${project.version}:install-file -DgroupId=foo -DartifactId=foo -Dversion=1 -Dfile=/tmp/doesnotexit-foo-bar-wine-beer -Dpackaging=jar -DgeneratePom=true -invoker.buildResult = failure diff --git a/src/it/local-repo-override/invoker.properties b/src/it/local-repo-override/invoker.properties deleted file mode 100644 index 0413238..0000000 --- a/src/it/local-repo-override/invoker.properties +++ /dev/null @@ -1,18 +0,0 @@ -# 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 = org.apache.maven.plugins:maven-install-plugin:${project.version}:install-file diff --git a/src/it/local-repo-override/pom.xml b/src/it/local-repo-override/pom.xml deleted file mode 100644 index 71ec569..0000000 --- a/src/it/local-repo-override/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ -<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <groupId>org.apache.maven.its.install.lro</groupId> - <artifactId>test</artifactId> - <version>1.0</version> - <packaging>jar</packaging> - - <description> - Tests the manual installation into a different local repo than the one configured in the settings - (MINSTALL-35). - </description> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-install-plugin</artifactId> - <version>@project.version@</version> - </plugin> - </plugins> - </build> - -</project> diff --git a/src/it/local-repo-override/setup.groovy b/src/it/local-repo-override/setup.groovy deleted file mode 100644 index d37913a..0000000 --- a/src/it/local-repo-override/setup.groovy +++ /dev/null @@ -1,29 +0,0 @@ -/* - * 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.*; -import java.util.*; - -import org.codehaus.plexus.util.*; - -File file = new File( basedir, "target" ); -System.out.println( "Deleting " + file ); -FileUtils.deleteDirectory( file ); - -return true; diff --git a/src/it/local-repo-override/test.jar b/src/it/local-repo-override/test.jar deleted file mode 100644 index 226277c..0000000 Binary files a/src/it/local-repo-override/test.jar and /dev/null differ diff --git a/src/it/local-repo-override/test.properties b/src/it/local-repo-override/test.properties deleted file mode 100644 index cd619e3..0000000 --- a/src/it/local-repo-override/test.properties +++ /dev/null @@ -1,23 +0,0 @@ -# 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. - -file = test.jar -groupId = gid -artifactId = test -version = 0.1 -packaging = jar -localRepositoryPath = target/local-repo diff --git a/src/it/local-repo-override/verify.groovy b/src/it/local-repo-override/verify.groovy deleted file mode 100644 index 0967f3e..0000000 --- a/src/it/local-repo-override/verify.groovy +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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.*; -import java.util.*; - -String[] paths = -[ - "gid/test/0.1/test-0.1.jar", -]; - -for ( String path : paths ) -{ - File file = new File( new File( basedir, "target/local-repo" ), path ); - System.out.println( "Checking for existence of " + file ); - if ( !file.isFile() ) - { - throw new FileNotFoundException( "Existing: " + file.getAbsolutePath() ); - } -} - -return true; diff --git a/src/test/java/org/apache/maven/plugins/install/InstallFileMojoTest.java b/src/test/java/org/apache/maven/plugins/install/InstallFileMojoTest.java index 06ebcde..ee3911b 100644 --- a/src/test/java/org/apache/maven/plugins/install/InstallFileMojoTest.java +++ b/src/test/java/org/apache/maven/plugins/install/InstallFileMojoTest.java @@ -28,6 +28,7 @@ import java.nio.file.Files; import java.nio.file.Path; import java.util.jar.JarEntry; import java.util.jar.JarOutputStream; +import java.util.stream.Stream; import org.apache.maven.api.plugin.testing.Basedir; import org.apache.maven.api.plugin.testing.InjectMojo; @@ -38,11 +39,14 @@ import org.apache.maven.execution.MavenSession; import org.apache.maven.model.Model; import org.apache.maven.model.io.xpp3.MavenXpp3Reader; import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.xml.XmlStreamReader; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; @@ -588,6 +592,190 @@ public class InstallFileMojoTest { assertFalse(new File(localRepo, jarPath).exists(), "The artifact should only be installed in " + overrideRepo); } + // ------------------------------------------------------------------------- + // Tests converted from the minstall-121 ITs (file/pomFile/packaging/extension) + // ------------------------------------------------------------------------- + + private static final class PackagingCase { + private final String sourceFileName; + private final String packaging; + private final String extension; + private final String artifactId; + private final String artifactPath; + private final String pomPath; + private final String metadataPath; + + PackagingCase( + String sourceFileName, + String packaging, + String extension, + String artifactId, + String artifactPath, + String pomPath, + String metadataPath) { + this.sourceFileName = sourceFileName; + this.packaging = packaging; + this.extension = extension; + this.artifactId = artifactId; + this.artifactPath = artifactPath; + this.pomPath = pomPath; + this.metadataPath = metadataPath; + } + + String sourceFileName() { + return sourceFileName; + } + + String packaging() { + return packaging; + } + + String extension() { + return extension; + } + + String artifactId() { + return artifactId; + } + + String artifactPath() { + return artifactPath; + } + + String pomPath() { + return pomPath; + } + + String metadataPath() { + return metadataPath; + } + + @Override + public String toString() { + return artifactId; + } + } + + private static Stream<PackagingCase> packagingCases() { + String repoPrefix = "org/apache/maven/its/install/121/"; + return Stream.of( + new PackagingCase( + "test-0.1.jar", + "maven-plugin", + null, + "test", + repoPrefix + "test/1.0/test-1.0.jar", + repoPrefix + "test/1.0/test-1.0.pom", + repoPrefix + "test/maven-metadata-local.xml"), + new PackagingCase( + "test-0.1.jar", + "bundle", + "jar", + "maven-bundle", + repoPrefix + "maven-bundle/1.0/maven-bundle-1.0.jar", + repoPrefix + "maven-bundle/1.0/maven-bundle-1.0.pom", + repoPrefix + "maven-bundle/maven-metadata-local.xml"), + new PackagingCase( + "test-0.1.jar", + "java-source", + null, + "test-java-source", + repoPrefix + "test-java-source/1.0/test-java-source-1.0-sources.jar", + repoPrefix + "test-java-source/1.0/test-java-source-1.0.pom", + repoPrefix + "test-java-source/maven-metadata-local.xml"), + new PackagingCase( + "test-0.1.jar", + "maven-archetype", + "jar", + "maven-archetype", + repoPrefix + "maven-archetype/1.0/maven-archetype-1.0.jar", + repoPrefix + "maven-archetype/1.0/maven-archetype-1.0.pom", + repoPrefix + "maven-archetype/maven-metadata-local.xml"), + new PackagingCase( + "test-0.1.tar.gz", + "war", + "tar.gz", + "test-targz", + repoPrefix + "test-targz/1.0/test-targz-1.0.tar.gz", + repoPrefix + "test-targz/1.0/test-targz-1.0.pom", + repoPrefix + "test-targz/maven-metadata-local.xml"), + new PackagingCase( + "test-0.1.war", + "war", + null, + "test-war", + repoPrefix + "test-war/1.0/test-war-1.0.war", + repoPrefix + "test-war/1.0/test-war-1.0.pom", + repoPrefix + "test-war/maven-metadata-local.xml")); + } + + @ParameterizedTest(name = "{0}") + @MethodSource("packagingCases") + @InjectMojo(goal = "install-file") + void installFileWithPackagingAndExtension(PackagingCase testCase, InstallFileMojo mojo) throws Exception { + assertNotNull(mojo); + + Path caseDir = tempDir.resolve(testCase.artifactId()); + Files.createDirectories(caseDir); + File pomFile = caseDir.resolve("test-0.1.pom").toFile(); + Files.write(pomFile.toPath(), pomXmlWithParent(testCase.artifactId()).getBytes(StandardCharsets.UTF_8)); + File sourceFile = caseDir.resolve(testCase.sourceFileName()).toFile(); + Files.copy( + MojoExtension.getTestFile("target/maven-install-test-1.0-SNAPSHOT.jar") + .toPath(), + sourceFile.toPath()); + + // The ITs relied on pomFile for all coordinates; class-level test coordinates must not leak in. + setMojoField(mojo, "groupId", null); + setMojoField(mojo, "artifactId", null); + setMojoField(mojo, "version", null); + setMojoField(mojo, "packaging", testCase.packaging()); + setMojoField(mojo, "extension", testCase.extension()); + setMojoField(mojo, "pomFile", pomFile); + setMojoField(mojo, "file", sourceFile); + + mojo.execute(); + + assertTrue(pomFile.isFile(), "Source POM should still exist: " + pomFile); + assertTrue(sourceFile.isFile(), "Source file should still exist: " + sourceFile); + assertInstalled(localRepo, testCase.artifactPath()); + assertInstalled(localRepo, testCase.pomPath()); + assertInstalled(localRepo, testCase.metadataPath()); + assertEquals( + Files.readAllLines(pomFile.toPath()), + Files.readAllLines(new File(localRepo, testCase.pomPath()).toPath()), + "The installed POM must be the supplied pomFile, not a generated one"); + } + + @Test + @InjectMojo(goal = "install-file") + @MojoParameter(name = "packaging", value = "jar") + void fileDoesNotExists(InstallFileMojo mojo) throws Exception { + File missing = tempDir.resolve("does-not-exist.jar").toFile(); + setMojoField(mojo, "file", missing); + + MojoFailureException e = assertThrows(MojoFailureException.class, mojo::execute); + assertTrue(e.getMessage().contains("does not exist"), e.getMessage()); + assertFalse(localRepo.exists(), "Nothing should be installed into " + localRepo); + } + + private static String pomXmlWithParent(String artifactId) { + return "<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" + + " http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n" + + " <modelVersion>4.0.0</modelVersion>\n" + + " <parent>\n" + + " <groupId>org.apache.maven.its.install.121</groupId>\n" + + " <artifactId>parent</artifactId>\n" + + " <version>1.0</version>\n" + + " </parent>\n" + + " <artifactId>" + + artifactId + + "</artifactId>\n" + + "</project>\n"; + } + private void assertInstalled(File repo, String path) { File installed = new File(repo, path); assertTrue(installed.isFile(), "Missing installed file: " + installed);
