gnodet commented on code in PR #178: URL: https://github.com/apache/maven-integration-testing/pull/178#discussion_r908471771
########## core-it-support/core-it-bootstrap/pom.xml: ########## @@ -19,45 +19,53 @@ specific language governing permissions and limitations under the License. --> -<project> +<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.bootstrap</groupId> - <artifactId>maven-it-boostrap</artifactId> - <version>1.0</version> + <groupId>org.apache.maven.its</groupId> + <artifactId>core-it-support</artifactId> + <version>2.1-SNAPSHOT</version> </parent> - <groupId>org.apache.maven.its.bootstrap</groupId> - <artifactId>group-13</artifactId> - <version>1.0</version> - <packaging>jar</packaging> - - <name>Maven Integration Test :: Boostrap :: Group-13</name> - - <properties> - </properties> + <artifactId>core-it-bootstrap</artifactId> + <packaging>maven-plugin</packaging> + <name>Bootstrap plugin</name> <dependencies> - <dependency> - <groupId>org.codehaus.plexus</groupId> - <artifactId>plexus-utils</artifactId> - <version>2.0.5</version> - </dependency> <dependency> <groupId>org.apache.maven</groupId> <artifactId>maven-plugin-api</artifactId> - <version>3.1.0</version> + <version>2.0</version> </dependency> <dependency> - <groupId>org.apache.maven</groupId> - <artifactId>maven-core</artifactId> - <version>3.1.0</version> + <groupId>org.apache.maven.plugin-tools</groupId> + <artifactId>maven-plugin-annotations</artifactId> </dependency> <dependency> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-plugin-plugin</artifactId> - <version>3.6.0</version> + <groupId>org.apache.maven.shared</groupId> + <artifactId>maven-artifact-transfer</artifactId> + <version>0.13.1</version> Review Comment: I don't think this is limited to 3.9.0+ at the moment. ########## core-it-support/core-it-bootstrap/src/main/java/org/apache/maven/its/bootstrap/DownloadMojo.java: ########## @@ -0,0 +1,153 @@ +package org.apache.maven.its.bootstrap; + +/* + * 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.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import org.apache.maven.execution.MavenSession; +import org.apache.maven.model.Dependency; +import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugins.annotations.Component; +import org.apache.maven.plugins.annotations.Mojo; +import org.apache.maven.plugins.annotations.Parameter; +import org.apache.maven.project.DefaultProjectBuildingRequest; +import org.apache.maven.project.ProjectBuildingRequest; +import org.apache.maven.shared.transfer.dependencies.resolve.DependencyResolver; +import org.apache.maven.shared.transfer.dependencies.resolve.DependencyResolverException; +import org.codehaus.plexus.util.StringUtils; + +/** + * Boostrap plugin to download all required dependencies + */ +@Mojo( name = "download" ) +public class DownloadMojo + extends AbstractMojo +{ + + /** + * A list of artifacts coordinates. + */ + @Parameter + private List<Dependency> dependencies = new ArrayList<>(); + + /** + * A list of string of the form groupId:artifactId:version[:packaging[:classifier]]. + */ + @Parameter + private List<String> artifacts = new ArrayList<>(); + + /** + * A file containing lines of the form groupId:artifactId:version[:packaging[:classifier]]. + */ + @Parameter + private File file; + + @Component + private DependencyResolver dependencyResolver; + + @Component + private MavenSession session; + + @Override + public void execute() throws MojoFailureException + { + if ( file != null && file.exists() ) + { + try ( BufferedReader reader = new BufferedReader( new FileReader( file ) ) ) + { + while ( true ) + { + String line = reader.readLine(); + if ( line != null ) Review Comment: See below. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org