Package de.saumya.mojo.gem
Class JarsLockMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
de.saumya.mojo.gem.JarsLockMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="jars-lock",
defaultPhase=INITIALIZE,
requiresDependencyResolution=TEST)
public class JarsLockMojo
extends org.apache.maven.plugin.AbstractMojo
installs a set of given gems without resolving any transitive dependencies
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanforce update of Jars.lock file.list of gems.private static final Stringwhere to copy the jars - default to JARS_HOME environment if set.Jars.lock file to be updated or created.protected org.apache.maven.artifact.repository.ArtifactRepositorylocal repository for internal use.(package private) Filelog output file.protected org.apache.maven.project.MavenProjectreference to maven project for internal use.protected org.apache.maven.repository.RepositorySystemupdate of Jars.lock file for a given artifactIdFields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate JarsLockMojo.StatuscheckForUpdates(List<String> lines) private org.apache.maven.artifact.ArtifactcreateArtifact(String jar, String type) private org.apache.maven.plugin.MojoExecutionExceptionexception(String text, IOException e) voidexecute()private List<org.apache.maven.artifact.Artifact>private StringgetSystemFile(String file) private StringjarsLock()private String(package private) voidprivate org.apache.maven.artifact.resolver.ArtifactResolutionResultresolve(boolean hasUpdate) private org.apache.maven.artifact.resolver.ArtifactResolutionResultprivate StringtoLine(org.apache.maven.artifact.Artifact a) toLines(Collection<org.apache.maven.artifact.Artifact> artifacts) private voidprivate voidupdateJarsLock(List<String> lines) private voidprivate voidwriteJarsLock(List<String> lines) Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
JARS_HOME
- See Also:
-
project
@Parameter(defaultValue="${project}", readonly=true) protected org.apache.maven.project.MavenProject projectreference to maven project for internal use. -
jarsLock
Jars.lock file to be updated or created. -
jarsHome
where to copy the jars - default to JARS_HOME environment if set. -
force
@Parameter(defaultValue="false", property="jars.force") public boolean forceforce update of Jars.lock file. -
update
update of Jars.lock file for a given artifactId -
gems
list of gems. one line one gem: {gemname}:{version}:{scope} or {gemname}:{version} where scope defaults to compile. -
outputFile
log output file. -
repositorySystem
@Component protected org.apache.maven.repository.RepositorySystem repositorySystem -
localRepository
@Parameter(defaultValue="${localRepository}", readonly=true) protected org.apache.maven.artifact.repository.ArtifactRepository localRepositorylocal repository for internal use.
-
-
Constructor Details
-
JarsLockMojo
public JarsLockMojo()
-
-
Method Details
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-
processJarsLock
void processJarsLock() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
getArtifacts
-
updateJarsLock
private void updateJarsLock(List<String> lines) throws org.apache.maven.plugin.MojoExecutionException - Throws:
org.apache.maven.plugin.MojoExecutionException
-
exception
-
message
-
toLines
-
updateArtifact
private void updateArtifact() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
resolveUpdate
private org.apache.maven.artifact.resolver.ArtifactResolutionResult resolveUpdate() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
resolve
private org.apache.maven.artifact.resolver.ArtifactResolutionResult resolve(boolean hasUpdate) throws org.apache.maven.plugin.MojoExecutionException - Throws:
org.apache.maven.plugin.MojoExecutionException
-
createArtifact
-
jarsLock
-
vendorJars
- Throws:
IOException
-
writeJarsLock
- Throws:
FileNotFoundException
-
checkForUpdates
private JarsLockMojo.Status checkForUpdates(List<String> lines) throws IOException, org.apache.maven.plugin.MojoExecutionException - Throws:
IOExceptionorg.apache.maven.plugin.MojoExecutionException
-
loadJarsLock
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
toLine
-
getSystemFile
-