Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change basedir to project.basedir #218

Merged
merged 2 commits into from
Sep 2, 2021
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
*/
package com.mycila.maven.plugin.license.git;

import com.mycila.maven.plugin.license.AbstractLicenseMojo;
import com.mycila.maven.plugin.license.PropertiesProvider;
import com.mycila.maven.plugin.license.document.Document;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

import com.mycila.maven.plugin.license.AbstractLicenseMojo;
import com.mycila.maven.plugin.license.PropertiesProvider;
import com.mycila.maven.plugin.license.document.Document;

/**
* An implementation of {@link PropertiesProvider} that adds {@value #COPYRIGHT_CREATION_AUTHOR_NAME_KEY} and
* {@value #COPYRIGHT_CREATION_AUTHOR_EMAIL_KEY} values - see
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
*/
package com.mycila.maven.plugin.license.git;

import com.mycila.maven.plugin.license.AbstractLicenseMojo;
import com.mycila.maven.plugin.license.PropertiesProvider;
import com.mycila.maven.plugin.license.document.Document;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

import com.mycila.maven.plugin.license.AbstractLicenseMojo;
import com.mycila.maven.plugin.license.PropertiesProvider;
import com.mycila.maven.plugin.license.document.Document;

/**
* An implementation of {@link PropertiesProvider} that adds {@value #COPYRIGHT_LAST_YEAR_KEY} and
* {@value #COPYRIGHT_YEARS_KEY} values - see
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@
*/
package com.mycila.maven.plugin.license.git;

import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.Iterator;
import java.util.TimeZone;

import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.api.Status;
import org.eclipse.jgit.api.errors.GitAPIException;
Expand All @@ -41,6 +33,14 @@
import org.eclipse.jgit.treewalk.filter.PathFilter;
import org.eclipse.jgit.treewalk.filter.TreeFilter;

import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.Iterator;
import java.util.TimeZone;

/**
* A jGit library wrapper to query the date of the last commit.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,19 @@
*/
package com.mycila.maven.plugin.license.git;

import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

import com.mycila.maven.plugin.license.document.Document;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;

import com.mycila.maven.plugin.license.document.Document;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

/**
* @author <a href="mailto:[email protected]">Peter Palaga</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,19 @@
*/
package com.mycila.maven.plugin.license.git;

import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

import com.mycila.maven.plugin.license.document.Document;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;

import com.mycila.maven.plugin.license.document.Document;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

/**
* @author <a href="mailto:[email protected]">Peter Palaga</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@
*/
package com.mycila.maven.plugin.license.git;

import static org.junit.Assert.assertEquals;
import com.mycila.maven.plugin.license.git.GitLookup.DateSource;
import org.eclipse.jgit.api.errors.GitAPIException;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
Expand All @@ -29,14 +35,7 @@
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;

import org.eclipse.jgit.api.errors.GitAPIException;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;

import com.mycila.maven.plugin.license.git.GitLookup.DateSource;
import static org.junit.Assert.assertEquals;

/**
* @author <a href="mailto:[email protected]">Peter Palaga</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@
*/
package com.mycila.maven.plugin.license.git;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

import org.junit.Assert;
import org.junit.Test;

import com.mycila.maven.plugin.license.git.GitPathResolver;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

/**
* @author <a href="mailto:[email protected]">Peter Palaga</a>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import java.nio.file.Files
import java.nio.file.Path
import java.util.Arrays
import java.util.List

final Path base = basedir.toPath()

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import java.nio.file.Files
import java.nio.file.Path
import java.util.Arrays
import java.util.List

import static org.junit.Assert.*
import static org.junit.Assert.assertEquals


final Path base = basedir.toPath()
Expand Down
2 changes: 1 addition & 1 deletion license-maven-plugin/src/it/legacy-config/verify.groovy
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import java.nio.file.Files
import java.nio.file.Path

import static org.junit.Assert.*
import static org.junit.Assert.assertEquals


final Path base = basedir.toPath()
Expand Down
4 changes: 1 addition & 3 deletions license-maven-plugin/src/it/multi-license/verify.groovy
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import java.nio.file.Files
import java.nio.file.Path
import java.util.Arrays
import java.util.List

import static org.junit.Assert.*
import static org.junit.Assert.assertEquals


final Path base = basedir.toPath()
Expand Down
2 changes: 1 addition & 1 deletion license-maven-plugin/src/it/pom-properties/verify.groovy
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import java.nio.file.Files
import java.nio.file.Path

import static org.junit.Assert.*
import static org.junit.Assert.assertEquals


final Path base = basedir.toPath()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import java.nio.file.Files
import java.nio.file.Path

import static org.junit.Assert.*
import static org.junit.Assert.assertEquals


final Path base = basedir.toPath()
Expand Down
2 changes: 0 additions & 2 deletions license-maven-plugin/src/it/tri-license-set/setup.groovy
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import java.nio.file.Files
import java.nio.file.Path
import java.util.Arrays
import java.util.List

final Path base = basedir.toPath()

Expand Down
4 changes: 1 addition & 3 deletions license-maven-plugin/src/it/tri-license-set/verify.groovy
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import java.nio.file.Files
import java.nio.file.Path
import java.util.Arrays
import java.util.List

import static org.junit.Assert.*
import static org.junit.Assert.assertEquals


final Path base = basedir.toPath()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,38 @@
*/
package com.mycila.maven.plugin.license;

import static com.mycila.maven.plugin.license.document.DocumentType.defaultMapping;
import static com.mycila.maven.plugin.license.util.FileUtils.asPath;
import static java.lang.String.format;
import static java.util.Arrays.asList;
import static java.util.Arrays.deepToString;
import com.mycila.maven.plugin.license.dependencies.LicenseMessage;
import com.mycila.maven.plugin.license.dependencies.LicensePolicy;
import com.mycila.maven.plugin.license.document.Document;
import com.mycila.maven.plugin.license.document.DocumentFactory;
import com.mycila.maven.plugin.license.document.DocumentPropertiesLoader;
import com.mycila.maven.plugin.license.document.DocumentType;
import com.mycila.maven.plugin.license.header.AdditionalHeaderDefinition;
import com.mycila.maven.plugin.license.header.Header;
import com.mycila.maven.plugin.license.header.HeaderDefinition;
import com.mycila.maven.plugin.license.header.HeaderSource;
import com.mycila.maven.plugin.license.header.HeaderType;
import com.mycila.maven.plugin.license.util.Selection;
import com.mycila.maven.plugin.license.util.resource.ResourceFinder;
import com.mycila.xmltool.XMLDoc;
import org.apache.maven.artifact.DependencyResolutionRequiredException;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.model.Organization;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.ProjectBuilder;
import org.apache.maven.settings.Server;
import org.apache.maven.settings.Settings;
import org.apache.maven.settings.crypto.DefaultSettingsDecryptionRequest;
import org.apache.maven.settings.crypto.SettingsDecrypter;
import org.apache.maven.settings.crypto.SettingsDecryptionRequest;
import org.apache.maven.settings.crypto.SettingsDecryptionResult;
import org.apache.maven.shared.dependency.graph.DependencyGraphBuilder;
import org.xml.sax.InputSource;

import java.io.File;
import java.io.IOException;
Expand All @@ -41,39 +68,11 @@
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import org.apache.maven.artifact.DependencyResolutionRequiredException;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.model.Organization;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.ProjectBuilder;
import org.apache.maven.settings.Server;
import org.apache.maven.settings.Settings;
import org.apache.maven.settings.crypto.DefaultSettingsDecryptionRequest;
import org.apache.maven.settings.crypto.SettingsDecrypter;
import org.apache.maven.settings.crypto.SettingsDecryptionRequest;
import org.apache.maven.settings.crypto.SettingsDecryptionResult;
import org.apache.maven.shared.dependency.graph.DependencyGraphBuilder;
import org.xml.sax.InputSource;

import com.mycila.maven.plugin.license.dependencies.LicenseMessage;
import com.mycila.maven.plugin.license.dependencies.LicensePolicy;
import com.mycila.maven.plugin.license.document.Document;
import com.mycila.maven.plugin.license.document.DocumentFactory;
import com.mycila.maven.plugin.license.document.DocumentPropertiesLoader;
import com.mycila.maven.plugin.license.document.DocumentType;
import com.mycila.maven.plugin.license.header.AdditionalHeaderDefinition;
import com.mycila.maven.plugin.license.header.Header;
import com.mycila.maven.plugin.license.header.HeaderDefinition;
import com.mycila.maven.plugin.license.header.HeaderSource;
import com.mycila.maven.plugin.license.header.HeaderType;
import com.mycila.maven.plugin.license.util.Selection;
import com.mycila.maven.plugin.license.util.resource.ResourceFinder;
import com.mycila.xmltool.XMLDoc;
import static com.mycila.maven.plugin.license.document.DocumentType.defaultMapping;
import static com.mycila.maven.plugin.license.util.FileUtils.asPath;
import static java.lang.String.format;
import static java.util.Arrays.asList;
import static java.util.Arrays.deepToString;

/**
* <b>Date:</b> 18-Feb-2008<br> <b>Author:</b> Mathieu Carbou
Expand All @@ -91,7 +90,7 @@ public abstract class AbstractLicenseMojo extends AbstractMojo {
* value for the base directory. This default value can be overridden
* in each LicenseSet by setting {@link LicenseSet#basedir}.
*/
@Parameter(property = "license.basedir", defaultValue = "${basedir}", alias = "basedir", required = true)
@Parameter(property = "license.basedir", defaultValue = "${project.basedir}", alias = "basedir", required = true)
public File defaultBasedir;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,17 @@
import com.mycila.maven.plugin.license.dependencies.MavenProjectLicenses;
import com.mycila.maven.plugin.license.document.Document;
import com.mycila.maven.plugin.license.header.Header;

import org.apache.maven.artifact.Artifact;
import org.apache.maven.model.License;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;

import java.io.File;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.Map.Entry;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.stream.Collectors;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,15 @@
*/
package com.mycila.maven.plugin.license.dependencies;

import org.apache.maven.artifact.Artifact;
import org.apache.maven.model.License;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.stream.Collectors;

import org.apache.maven.artifact.Artifact;
import org.apache.maven.model.License;

import com.mycila.maven.plugin.license.dependencies.LicensePolicy.Rule;

/**
* Aggregate license policy enforcement with default enforcer bindings based on {@link LicensePolicy.Type}.
*
Expand Down
Loading