Package com.cloudbees.maven.license
Class CompleterDelegate
- java.lang.Object
-
- com.cloudbees.maven.license.CompleterDelegate
-
public class CompleterDelegate extends Object
Base class for completer scripts that define convenience methods.The completion phase runs on each dependency to complete the missing license information, accept one from dual-licensed libraries, etc.
- Author:
- Kohsuke Kawaguchi
-
-
Field Summary
Fields Modifier and Type Field Description org.apache.maven.project.MavenProjectdependencyorg.apache.maven.project.MavenProjectproject
-
Constructor Summary
Constructors Constructor Description CompleterDelegate(org.apache.maven.project.MavenProject dependency, org.apache.maven.project.MavenProject project)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(String name)From the multi-licensed modules, accept one of them.org.apache.maven.model.Licenselicense(String name, String url)Creates a new license object.voidmatch(Object criteria, groovy.lang.Closure body)If the current dependency matches the given groupId/artifactId, execute the bodyvoidrewriteLicense(Collection<org.apache.maven.model.License> expected, org.apache.maven.model.License to)Verifies that the license of the current dependency is the ones listed in the 'expected' argument, rewrite it with the specified one.
-
-
-
Method Detail
-
match
public void match(Object criteria, groovy.lang.Closure body)
If the current dependency matches the given groupId/artifactId, execute the body- Parameters:
criteria- A string like "groupId:artifactId" that matches the current dependency ("*" is allowed for wildcard), or a collection/array of them.
-
rewriteLicense
public void rewriteLicense(Collection<org.apache.maven.model.License> expected, org.apache.maven.model.License to)
Verifies that the license of the current dependency is the ones listed in the 'expected' argument, rewrite it with the specified one. This is for completing missing license info, and for selecting one from multi-licensed dependencies.
-
license
public org.apache.maven.model.License license(String name, String url)
Creates a new license object.
-
accept
public void accept(String name)
From the multi-licensed modules, accept one of them.
-
-