Class SchemaGeneratorMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- io.debezium.schemagenerator.maven.SchemaGeneratorMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="generate-api-spec", defaultPhase=PREPARE_PACKAGE, requiresDependencyResolution=COMPILE_PLUS_RUNTIME) public class SchemaGeneratorMojo extends org.apache.maven.plugin.AbstractMojoGenerates the API spec for the connector(s) in a project.
-
-
Field Summary
Fields Modifier and Type Field Description private StringfilenamePrefixprivate StringfilenameSuffixprivate Stringformatprivate booleangroupDirectoryPerConnectorprivate FileoutputDirectoryprivate org.apache.maven.project.MavenProjectprojectGives access to the Maven project information.private List<org.eclipse.aether.repository.RemoteRepository>remoteReposprivate org.eclipse.aether.RepositorySystemSessionrepoSessionprivate org.eclipse.aether.RepositorySystemrepoSystemprivate org.apache.maven.execution.MavenSessionsession
-
Constructor Summary
Constructors Constructor Description SchemaGeneratorMojo()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private StringclassPathEntryFor(Class<?> clazz)private intexec(String className, String classPath, List<String> jvmArgs, List<String> args)voidexecute()private StringgetClassPath()private Set<org.eclipse.aether.artifact.Artifact>getDependencies(org.apache.maven.artifact.Artifact inputArtifact)private org.apache.maven.artifact.ArtifactgetGeneratorPluginArtifact()Returns the schema generator plug-in artifactprivate static booleanisWindows()private static StringquoteIfNecessary(String value)private org.eclipse.aether.artifact.ArtifactresolveArtifact(org.eclipse.aether.artifact.Artifact inputArtifact)
-
-
-
Field Detail
-
format
@Parameter(defaultValue="openapi", property="schema.format") private String format
-
outputDirectory
@Parameter(defaultValue="${project.build.directory}${file.separator}generated-sources", required=true) private File outputDirectory
-
groupDirectoryPerConnector
@Parameter(defaultValue="false") private boolean groupDirectoryPerConnector
-
filenamePrefix
@Parameter(defaultValue="") private String filenamePrefix
-
filenameSuffix
@Parameter(defaultValue="") private String filenameSuffix
-
project
@Parameter(defaultValue="${project}", required=true, readonly=true) private org.apache.maven.project.MavenProject projectGives access to the Maven project information.
-
session
@Parameter(defaultValue="${session}") private org.apache.maven.execution.MavenSession session
-
repoSystem
@Component private org.eclipse.aether.RepositorySystem repoSystem
-
repoSession
@Parameter(defaultValue="${repositorySystemSession}", readonly=true, required=true) private org.eclipse.aether.RepositorySystemSession repoSession
-
remoteRepos
@Parameter(defaultValue="${project.remoteProjectRepositories}", readonly=true, required=true) private List<org.eclipse.aether.repository.RemoteRepository> remoteRepos
-
-
Method Detail
-
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
-
exec
private int exec(String className, String classPath, List<String> jvmArgs, List<String> args) throws IOException, InterruptedException
- Throws:
IOExceptionInterruptedException
-
getClassPath
private String getClassPath() throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
getGeneratorPluginArtifact
private org.apache.maven.artifact.Artifact getGeneratorPluginArtifact()
Returns the schema generator plug-in artifact
-
getDependencies
private Set<org.eclipse.aether.artifact.Artifact> getDependencies(org.apache.maven.artifact.Artifact inputArtifact) throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
resolveArtifact
private org.eclipse.aether.artifact.Artifact resolveArtifact(org.eclipse.aether.artifact.Artifact inputArtifact)
-
isWindows
private static boolean isWindows()
-
-