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 Summary
FieldsModifier and TypeFieldDescriptionprivate static final booleanprivate booleanprivate booleanprivate booleanprivate Stringprivate Stringprivate Stringprivate Stringprivate Stringprivate Stringprivate Stringprivate Stringprivate org.apache.maven.project.MavenProjectprivate org.apache.maven.project.ProjectBuilderprivate Stringprivate org.eclipse.aether.RepositorySystemSessionprivate org.eclipse.aether.RepositorySystemprivate DependencyResolverprivate org.apache.maven.execution.MavenSessionprivate booleanprivate booleanFields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic FilecreateTmpDir(String name) Creates a temporary directory.voidexecute()private FileextractPlugin(String plugin, File pluginFile) Extracts a plugin.private static StringextractSuffix(String prefix, String line, String dflt) Extracts the suffix after removing the prefix.(package private) FileReturns the base directory of the local repository.org.apache.maven.project.MavenProjectReturns the maven project.org.apache.maven.project.ProjectBuilderReturns the maven project builder.org.eclipse.aether.RepositorySystemReturns the maven repository system.org.apache.maven.execution.MavenSessionReturns the maven session.private static voidregisterPlugin(File folder) Registersfolderas plugin.private voidrewriteCpFile(File file) Rewrites the classpath files specified byfile.private FileTurns a string path into a file instance.private FileTurns a string path into a file instance.private FiletoMetamodelDirectory(String path, File projectDirectory) Turns the specifiedpathinto the metamodel directory.Methods inherited from class de.iip_ecosphere.platform.tools.maven.python.AbstractLoggingMojo
error, error, info, warnMethods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.iip_ecosphere.platform.configuration.maven.DependencyResolver.Caller
getLog, getRemoteRepos, getRepoSession
-
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
-
pluginVersion
-
repoSystem
@Component private org.eclipse.aether.RepositorySystem repoSystem -
projectBuilder
@Component 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 -
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 -
resolver
-
-
Constructor Details
-
DashboardMapperMojo
public DashboardMapperMojo()
-
-
Method Details
-
getSession
public org.apache.maven.execution.MavenSession getSession()Description copied from interface:DependencyResolver.CallerReturns the maven session.- Specified by:
getSessionin interfaceDependencyResolver.Caller- Returns:
- the session
-
getProjectBuilder
public org.apache.maven.project.ProjectBuilder getProjectBuilder()Description copied from interface:DependencyResolver.CallerReturns the maven project builder.- Specified by:
getProjectBuilderin interfaceDependencyResolver.Caller- Returns:
- the builder
-
getRepoSystem
public org.eclipse.aether.RepositorySystem getRepoSystem()Description copied from interface:DependencyResolver.CallerReturns the maven repository system.- Specified by:
getRepoSystemin interfaceDependencyResolver.Caller- Returns:
- the repositories
-
getProject
public org.apache.maven.project.MavenProject getProject()Description copied from interface:DependencyResolver.CallerReturns the maven project.- Specified by:
getProjectin interfaceDependencyResolver.Caller- Returns:
- the project
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Specified by:
executein interfaceorg.apache.maven.plugin.Mojo- Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-
registerPlugin
Registersfolderas plugin.- Parameters:
folder- the folder
-
toMetamodelDirectory
Turns the specifiedpathinto the metamodel directory. If absolute, takepath. If not, try to validatepath, alternatively "target/easy" and "src/main/easy" whether they can be found inprojectDirectoryor 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 specifiedprojectDirectory- the project directory to start searching at- Returns:
- the meta model folder
-
toFile
Turns a string path into a file instance.- Parameters:
path- the path, may be null or empty for nonedflt- the default path if path is empty or null- Returns:
- the file instance, will be null if there was no path given
-
toFile
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
Creates a temporary directory.- Parameters:
name- the name of the directory within the standard temporary folder- Returns:
- the temporary directory
-
extractPlugin
Extracts a plugin.- Parameters:
plugin- the plugin namepluginFile- the plugin file as resolved by Maven- Returns:
- the extracted folder or null if failed
-
extractSuffix
Extracts the suffix after removing the prefix.- Parameters:
prefix- the prefix to look for, may be nullline- the line to extract the suffix fromdflt- the default value if there is no prefix, usuallyline- Returns:
lineor the line without the prefix
-
getLocalRepoBaseDir
File getLocalRepoBaseDir()Returns the base directory of the local repository.- Returns:
- the base directory
-
rewriteCpFile
Rewrites the classpath files specified byfile.- Parameters:
file- the file to rewrite
-