Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions utils/license-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,43 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.eclipse.set</groupId>
<artifactId>license-maven-plugin</artifactId>
<version>1.0.1</version>
<version>1.1.1</version>

<packaging>maven-plugin</packaging>
<properties>
<maven.compiler.target>17</maven.compiler.target>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<maven.compiler.source>21</maven.compiler.source>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>3.9.3</version>
<version>3.9.9</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<version>3.9.0</version>
<version>3.15.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>3.9.3</version>
<version>3.9.9</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.6.0</version>
<version>3.8.1</version>
</dependency>
<dependency>
<groupId>org.eclipse.dash</groupId>
<artifactId>license-tool-plugin</artifactId>
<version>1.0.3-SNAPSHOT</version>
<version>1.1.1-SNAPSHOT</version>
</dependency>
</dependencies>
<repositories>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
Expand Down Expand Up @@ -40,7 +41,7 @@ private static IDependencyListReader getReader(Path path) throws FileNotFoundExc
File input = path.toFile();
if (input.exists()) {
if ("package-lock.json".equals(input.getName())) {
return new PackageLockFileReader(new FileInputStream(input));
return new PackageLockFileReader(new InputStreamReader(new FileInputStream(input)));
}
return new FlatFileReader(new FileReader(input));
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@
import org.eclipse.dash.licenses.maven.AbstractArtifactFilteringMojo;
import org.eclipse.dash.licenses.maven.MavenProxySettings;
import org.eclipse.dash.licenses.maven.MavenSettings;
import org.eclipse.dash.licenses.projects.ProjectService;
import org.eclipse.dash.licenses.review.CreateReviewRequestCollector;
import org.eclipse.dash.licenses.review.GitLabSupport;
import org.eclipse.dash.licenses.validation.EclipseProjectIdValidator;
import org.sonatype.plexus.components.sec.dispatcher.SecDispatcher;

import com.google.inject.Guice;
Expand All @@ -72,6 +72,13 @@ public class LicenseCheckMojo extends AbstractArtifactFilteringMojo {
*/
@Parameter(property = "dash.projectId")
private String projectId;


/**
* Optionally specify the Eclipse Project repository that is the source of the request
*/
@Parameter(property = "dash.repo")
private String repo;

/**
* Output a summary to the given file. If not specified, then a dependencies
Expand Down Expand Up @@ -187,7 +194,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
// Validate the user-given dash license tool settings
ISettings settings;
try {
settings = new MavenSettings(batch, foundationApi, clearlyDefinedApi, licenses, confidence, projectId, iplabToken);
settings = new MavenSettings(batch, foundationApi, clearlyDefinedApi, licenses, confidence, projectId, iplabToken, repo);
} catch (IllegalArgumentException e) {
throw new MojoExecutionException("Invalid setting: " + e.getMessage());
}
Expand All @@ -212,12 +219,8 @@ public void execute() throws MojoExecutionException, MojoFailureException {
String source = a.getGroupId().startsWith(P2_GROUPID_PREFIX) ? "orbit" : "mavencentral";
// TODO could get duplicates here if two artifact coords differ only by
// classifier
IContentId id = M2EDependencyMapper.mapDependency(ContentId.getContentId(type, source, a.getGroupId(), a.getArtifactId(), a.getVersion()));
id = SETSnapshotDropper.mapDependency(id);
deps.add(id);
deps.add(ContentId.getContentId(type, source, a.getGroupId(), a.getArtifactId(), a.getVersion()));
});

deps.addAll(ExtraDependencies.getExtraDependencies());

List<IResultsCollector> collectors = new ArrayList<>();

Expand All @@ -231,7 +234,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
Injector injector = Guice.createInjector(new LicenseToolModule(settings, createProxySettings()));

if (settings.getProjectId() != null) {
var validator = injector.getInstance(EclipseProjectIdValidator.class);
var validator = injector.getInstance(ProjectService.class);
if (!validator.validate(settings.getProjectId(), message -> getLog().error(message))) {
throw new MojoExecutionException("Invalid project id.");
}
Expand Down Expand Up @@ -296,4 +299,4 @@ protected IProxySettings createProxySettings() {
proxyServer.getPassword(), securityDispatcher, getLog());
}

}
}