Class DashboardMapperMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
de.iip_ecosphere.platform.tools.maven.python.AbstractLoggingMojo
de.iip_ecosphere.platform.configuration.maven.DashboardMapperMojo
All Implemented Interfaces:
DependencyResolver.Caller, de.iip_ecosphere.platform.tools.maven.python.Logger, org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

@Mojo(name="mapDashboard", defaultPhase=PACKAGE) public class DashboardMapperMojo extends de.iip_ecosphere.platform.tools.maven.python.AbstractLoggingMojo implements DependencyResolver.Caller
Experimental dashboard mapper build process integration.
Author:
Holger Eichelberger, SSE
  • Field Details

    • AS_PROCESS

      private static final boolean AS_PROCESS
      See Also:
    • project

      @Parameter(defaultValue="${project}", required=true, readonly=true) private org.apache.maven.project.MavenProject project
    • session

      @Parameter(defaultValue="${session}", required=true, readonly=true) private org.apache.maven.execution.MavenSession session
    • pluginGroupId

      @Parameter(defaultValue="${plugin.groupId}", readonly=true) private String pluginGroupId
    • pluginVersion

      @Parameter(defaultValue="${plugin.version}", readonly=true) private String pluginVersion
    • repoSystem

      private org.eclipse.aether.RepositorySystem repoSystem
    • projectBuilder

      private org.apache.maven.project.ProjectBuilder projectBuilder
    • repoSession

      @Parameter(defaultValue="${repositorySystemSession}", readonly=true) private org.eclipse.aether.RepositorySystemSession repoSession
    • plugins

      @Parameter(property="configuration.aasPlugins", required=false, defaultValue="support.aas.basyx, support.aas.basyx2") private String plugins
    • mainConfiguration

      @Parameter(property="configuration.mainConfiguration", required=false, defaultValue="PlatformConfiguration") private String mainConfiguration
    • projectDirectory

      @Parameter(property="configuration.projectDirectory", required=false, defaultValue="") private String projectDirectory
    • modelDirectory

      @Parameter(property="configuration.modelDirectory", required=false, defaultValue="src/main/easy") private String modelDirectory
    • metaModelDirectory

      @Parameter(property="configuration.metaModelDirectory", required=false, defaultValue="target/easy") private String metaModelDirectory
    • outputFile

      @Parameter(property="configuration.outputFile", required=false, defaultValue="") private String outputFile
    • pluginId

      @Parameter(property="configuration.pluginId", required=false, defaultValue="") private String pluginId
    • postUrl

      @Parameter(property="configuration.postUrl", required=false, defaultValue="") private String postUrl
    • cleanTemp

      @Parameter(property="configuration.cleanTemp", required=false, defaultValue="false") private boolean cleanTemp
    • skip

      @Parameter(property="configuration.skip", required=false, defaultValue="false") private boolean skip
    • skipMapDashboard

      @Parameter(property="configuration.skipMapDashboard", required=false, defaultValue="false") private boolean skipMapDashboard
    • inContainer

      @Parameter(property="configuration.inContainer", required=false, defaultValue="true") private boolean inContainer
    • failOnError

      @Parameter(property="configuration.failOnError", required=false, defaultValue="false") private boolean failOnError
    • basedir

      @Parameter(defaultValue="${project.basedir}", required=true, readonly=true) private File basedir
    • resolver

      private DependencyResolver resolver
  • Constructor Details

    • DashboardMapperMojo

      @Inject public DashboardMapperMojo(org.apache.maven.project.ProjectBuilder projectBuilder, org.eclipse.aether.RepositorySystem repoSystem)
      Creates an instance.
      Parameters:
      projectBuilder - the project builder
      repoSystem - the repo system
  • Method Details

    • getSession

      public org.apache.maven.execution.MavenSession getSession()
      Description copied from interface: DependencyResolver.Caller
      Returns the maven session.
      Specified by:
      getSession in interface DependencyResolver.Caller
      Returns:
      the session
    • getProjectBuilder

      public org.apache.maven.project.ProjectBuilder getProjectBuilder()
      Description copied from interface: DependencyResolver.Caller
      Returns the maven project builder.
      Specified by:
      getProjectBuilder in interface DependencyResolver.Caller
      Returns:
      the builder
    • getRepoSystem

      public org.eclipse.aether.RepositorySystem getRepoSystem()
      Description copied from interface: DependencyResolver.Caller
      Returns the maven repository system.
      Specified by:
      getRepoSystem in interface DependencyResolver.Caller
      Returns:
      the repositories
    • getProject

      public org.apache.maven.project.MavenProject getProject()
      Description copied from interface: DependencyResolver.Caller
      Returns the maven project.
      Specified by:
      getProject in interface DependencyResolver.Caller
      Returns:
      the project
    • execute

      public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
      Specified by:
      execute in interface org.apache.maven.plugin.Mojo
      Throws:
      org.apache.maven.plugin.MojoExecutionException
      org.apache.maven.plugin.MojoFailureException
    • registerPlugin

      private static void registerPlugin(File folder)
      Registers folder as plugin.
      Parameters:
      folder - the folder
    • toModelDirectory

      private File toModelDirectory(String path, File projectDirectory, String... fldrs)
      Turns the specified path into a model directory. If absolute, take path. If not, try to validate path, alternatively fldrs in the given sequence whether they can be found in projectDirectory or one of its parent directories. This search is needed in particular for test setups where the actual meta model resides in a parent directory and we do not want to include that path in all uses of this plugin.
      Parameters:
      path - the specified path, may be empty or null for none specified
      projectDirectory - the project directory to start searching at
      fldrs - relative folders to search for
      Returns:
      the meta model folder
    • toFile

      private File toFile(String path, String dflt)
      Turns a string path into a file instance.
      Parameters:
      path - the path, may be null or empty for none
      dflt - the default path if path is empty or null
      Returns:
      the file instance, will be null if there was no path given
    • toFile

      private File toFile(String path)
      Turns a string path into a file instance.
      Parameters:
      path - the path, may be null or empty for none
      Returns:
      the file instance, will be null if there was no path given
    • createTmpDir

      public static File createTmpDir(String name)
      Creates a temporary directory.
      Parameters:
      name - the name of the directory within the standard temporary folder
      Returns:
      the temporary directory
    • extractPlugin

      private File extractPlugin(String plugin, File pluginFile)
      Extracts a plugin.
      Parameters:
      plugin - the plugin name
      pluginFile - the plugin file as resolved by Maven
      Returns:
      the extracted folder or null if failed
    • extractSuffix

      private static String extractSuffix(String prefix, String line, String dflt)
      Extracts the suffix after removing the prefix.
      Parameters:
      prefix - the prefix to look for, may be null
      line - the line to extract the suffix from
      dflt - the default value if there is no prefix, usually line
      Returns:
      line or the line without the prefix
    • getLocalRepoBaseDir

      File getLocalRepoBaseDir()
      Returns the base directory of the local repository.
      Returns:
      the base directory
    • rewriteCpFile

      private void rewriteCpFile(File file)
      Rewrites the classpath files specified by file.
      Parameters:
      file - the file to rewrite