Class CheckAutoContainerPlugin

java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.nuiton.plugin.AbstractPlugin
org.nuiton.helper.plugin.CheckAutoContainerPlugin
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo, org.nuiton.plugin.Plugin

@Mojo(name="check-auto-container", defaultPhase=VALIDATE, requiresProject=true, requiresOnline=true, requiresDependencyResolution=RUNTIME) public class CheckAutoContainerPlugin extends org.nuiton.plugin.AbstractPlugin
Check all dependencies are auto contained in the given repositories.
Since:
1.2.5
Author:
Tony Chemit - chemit@codelutin.com
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.nuiton.plugin.Plugin

    org.nuiton.plugin.Plugin.InitState, org.nuiton.plugin.Plugin.Packaging
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected boolean
    A flag to add the maven central repository https://repo1.maven.org/maven2 to repositories.
    protected org.apache.maven.artifact.repository.ArtifactRepositoryFactory
    Artifact repository factory component.
    protected org.apache.maven.artifact.resolver.ArtifactResolver
    Wagon manager component.
    protected boolean
    A flag to fail if project is not auto container.
    static final String
     
    static final String
     
    protected org.apache.maven.project.MavenProject
    Project.
    protected org.apache.maven.settings.Proxy
    Active proxy from settings (if any).
    protected List<?>
    The projects in reactor (used to detected sibling dependencies).
    protected Map<String,String>
    Map of repositories to use.
    protected boolean
    A flag to execute only once the mojo.
    protected boolean
    A flag to restrict only to run on root module.
    protected boolean
    A flag to skip the goal.
    protected boolean
    A flag to activate verbose mode.

    Fields inherited from interface org.apache.maven.plugin.Mojo

    ROLE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected org.apache.maven.artifact.Artifact
    acceptArtifact(org.apache.maven.artifact.Artifact a, List<String> siblings)
     
    protected boolean
     
    protected List<org.apache.maven.artifact.repository.ArtifactRepository>
     
    protected void
     
    protected String
    getArtifactId(org.apache.maven.artifact.Artifact artifact)
     
    org.apache.maven.project.MavenProject
     
    protected org.apache.maven.wagon.proxy.ProxyInfo
     
    protected List<String>
     
    void
     
    protected boolean
     
    boolean
     
    protected List<org.apache.maven.artifact.Artifact>
     
    void
    setProject(org.apache.maven.project.MavenProject project)
     
    void
    setVerbose(boolean verbose)
     

    Methods inherited from class org.nuiton.plugin.AbstractPlugin

    acceptPackaging, addCompileSourceRoots, addDirectoryToUrlsList, addResourceDir, addTestCompileSourceRoots, addTestResourceDir, addUrlToUrlsList, afterExecute, backupFile, checkEncoding, checkPackaging, checkResource, checkRunOnceDone, copyFile, createDirectoryIfNecessary, createNewFile, deleteFile, execute, getBackupFile, getFileFromBasedir, getFilesToTreate, getFilesToTreateForRoots, getRootProject, getTemplate, hasClassPath, initClassLoader, isExecutionRoot, isFileNewerThanPomFile, needInvoke, needInvoke, rejectPackaging, removeCompileSourceRoots, removeTestCompileSourceRoots, renameFile, writeFile

    Methods inherited from class org.apache.maven.plugin.AbstractMojo

    getLog, getPluginContext, setLog, setPluginContext

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.maven.plugin.Mojo

    getLog, setLog
  • Field Details

    • repositories

      @Parameter protected Map<String,String> repositories
      Map of repositories to use. Keys are repository id and Values are repository url.
      Since:
      1.2.5
    • addMavenCentral

      @Parameter(property="addMavenCentral", defaultValue="false") protected boolean addMavenCentral
      A flag to add the maven central repository https://repo1.maven.org/maven2 to repositories.
      Since:
      1.2.5
    • failIfNotSafe

      @Parameter(property="helper.failIfNotSafe", defaultValue="false") protected boolean failIfNotSafe
      A flag to fail if project is not auto container.
      Since:
      1.2.5
    • verbose

      @Parameter(property="helper.verbose", defaultValue="${maven.verbose}") protected boolean verbose
      A flag to activate verbose mode.
      Since:
      1.2.5
    • runOnce

      @Parameter(property="helper.runOnce", defaultValue="true") protected boolean runOnce
      A flag to execute only once the mojo. Note: By default, value is true since it is not necessary to check twice for a same artifact.
      Since:
      1.2.6
    • runOnlyOnRoot

      @Parameter(property="helper.runOnlyOnRoot", defaultValue="true") protected boolean runOnlyOnRoot
      A flag to restrict only to run on root module.
      Since:
      2.1
    • skipCheckAutocontainer

      @Parameter(property="helper.skipCheckAutocontainer", defaultValue="false") protected boolean skipCheckAutocontainer
      A flag to skip the goal.
      Since:
      2.1
    • project

      @Parameter(defaultValue="${project}", required=true, readonly=true) protected org.apache.maven.project.MavenProject project
      Project.
      Since:
      1.2.5
    • reactorProjects

      @Parameter(property="reactorProjects", readonly=true) protected List<?> reactorProjects
      The projects in reactor (used to detected sibling dependencies).
      Since:
      1.2.5
    • proxy

      @Parameter(property="settings.activeProxy", required=true, readonly=true) protected org.apache.maven.settings.Proxy proxy
      Active proxy from settings (if any).
      Since:
      1.2.5
    • artifactRepositoryFactory

      @Component protected org.apache.maven.artifact.repository.ArtifactRepositoryFactory artifactRepositoryFactory
      Artifact repository factory component.
      Since:
      1.2.5
    • artifactResolver

      @Component protected org.apache.maven.artifact.resolver.ArtifactResolver artifactResolver
      Wagon manager component.
      Since:
      1.2.5
    • MAVEN_CENTRAL_ID

      public static final String MAVEN_CENTRAL_ID
      See Also:
    • MAVEN_CENTRAL_URL

      public static final String MAVEN_CENTRAL_URL
      See Also:
  • Constructor Details

    • CheckAutoContainerPlugin

      public CheckAutoContainerPlugin()
  • Method Details

    • getProject

      public org.apache.maven.project.MavenProject getProject()
    • setProject

      public void setProject(org.apache.maven.project.MavenProject project)
    • isVerbose

      public boolean isVerbose()
    • setVerbose

      public void setVerbose(boolean verbose)
    • init

      public void init() throws Exception
      Specified by:
      init in class org.nuiton.plugin.AbstractPlugin
      Throws:
      Exception
    • checkSkip

      protected boolean checkSkip()
      Overrides:
      checkSkip in class org.nuiton.plugin.AbstractPlugin
    • doAction

      protected void doAction() throws Exception
      Specified by:
      doAction in class org.nuiton.plugin.AbstractPlugin
      Throws:
      Exception
    • createSafeRepositories

      protected List<org.apache.maven.artifact.repository.ArtifactRepository> createSafeRepositories()
    • prepareArtifacts

      protected List<org.apache.maven.artifact.Artifact> prepareArtifacts()
    • acceptArtifact

      protected org.apache.maven.artifact.Artifact acceptArtifact(org.apache.maven.artifact.Artifact a, List<String> siblings)
    • getArtifactId

      protected String getArtifactId(org.apache.maven.artifact.Artifact artifact)
    • getRepositoryCache

      protected List<String> getRepositoryCache(String url)
    • getProxyInfo

      protected org.apache.maven.wagon.proxy.ProxyInfo getProxyInfo()
    • isGoalSkip

      protected boolean isGoalSkip()