Package org.codehaus.mojo.license.utils
Class MojoHelper
java.lang.Object
org.codehaus.mojo.license.utils.MojoHelper
Mojo helper methods.
- Since:
- 1.0
- Author:
- tchemit dev@tchemit.fr
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
addResourceDir
(File dir, org.apache.maven.project.MavenProject project, String... includes) Add the directory as a resource of the given project.static boolean
addResourceDir
(File dir, org.apache.maven.project.MavenProject project, List<?> resources, String... includes) Add the directory as a resource in the given resource list.static String
static String
convertTime
(long value) static String
getArtifactId
(org.apache.maven.artifact.Artifact artifact) static String
getArtifactName
(org.apache.maven.project.MavenProject project) static Set
<org.apache.maven.artifact.Artifact> getDependencyArtifacts
(org.apache.maven.project.MavenProject project) MavenProject.getDependencyArtifacts()
is deprecated.static String
getProjectName
(org.apache.maven.project.MavenProject project) static URL
suffix a givenbaseUrl
with the givensuffix
static Comparator
<org.apache.maven.project.MavenProject> static Comparator
<org.apache.maven.project.MavenProject>
-
Field Details
-
TIME_FACTORS
protected static final double[] TIME_FACTORS -
TIME_UNITES
-
-
Constructor Details
-
MojoHelper
public MojoHelper()
-
-
Method Details
-
addResourceDir
public static boolean addResourceDir(File dir, org.apache.maven.project.MavenProject project, String... includes) Add the directory as a resource of the given project.- Parameters:
dir
- the directory to addproject
- the project to updateincludes
- the includes of the resource- Returns:
true
if the resources was added (not already existing)
-
addResourceDir
public static boolean addResourceDir(File dir, org.apache.maven.project.MavenProject project, List<?> resources, String... includes) Add the directory as a resource in the given resource list.- Parameters:
dir
- the directory to addproject
- the project involvedresources
- the list of existing resourcesincludes
- includes of the new resources- Returns:
true
if the resource was added (not already existing)
-
newMavenProjectComparator
-
newMavenProjectComparatorByName
-
convertTime
-
convert
-
getUrl
suffix a givenbaseUrl
with the givensuffix
- Parameters:
baseUrl
- base url to usesuffix
- suffix to add- Returns:
- the new url
-
getArtifactId
-
getArtifactName
-
getProjectName
-
getParams
-
getDependencyArtifacts
public static Set<org.apache.maven.artifact.Artifact> getDependencyArtifacts(org.apache.maven.project.MavenProject project) MavenProject.getDependencyArtifacts()
is deprecated.This method checks if the dependency artifacts is
null
and returns an emptyHashSet
to avoid theNullPointerException
s caused by theMavenProject.getDependencyArtifacts()
returningnull
.- Parameters:
project
- the MavenProject to retrieve artifacts from- Returns:
- a HashSet of dependencies or an empty set
-