Skip to content

Commit

Permalink
custom extensionhandler for maven-plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
llsand committed Jun 30, 2017
1 parent aa3838b commit c162b0c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,12 @@ public <T extends EObject> List<UnaryOperator<T>> getAdditionalExtensions( Class
};

private ExtensionHandler extensionHandler;
private String extensionhandlerClass = "de.opitzconsulting.orcas.diff.ExtensionHandlerImpl";

public void setExtensionhandlerClass( String pExtensionhandlerClass )
{
extensionhandlerClass = pExtensionhandlerClass;
}

public boolean isOrderColumnsByName()
{
Expand Down Expand Up @@ -361,7 +367,7 @@ public ExtensionHandler getExtensionHandler()
{
try
{
Class<?> lExtensionHandlerImplClass = Thread.currentThread().getContextClassLoader().loadClass( "de.opitzconsulting.orcas.diff.ExtensionHandlerImpl" );
Class<?> lExtensionHandlerImplClass = Thread.currentThread().getContextClassLoader().loadClass( extensionhandlerClass );
setExtensionHandler( (ExtensionHandler) lExtensionHandlerImplClass.newInstance() );
}
catch( Exception e )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,12 @@ public abstract class BaseOrcasMojo extends AbstractMojo
@Parameter
protected String orcaspassword;

/**
* The Extensionhandler-Class to use.
*/
@Parameter
private String extensionhandlerClass;

public void execute() throws MojoExecutionException
{
ParametersCall lParametersCall = new ParametersCall();
Expand Down Expand Up @@ -217,6 +223,11 @@ public void execute() throws MojoExecutionException
lParametersCall.setDateformat( dateformat );
lParametersCall.setExtensionParameter( extensionparameter );

if( extensionhandlerClass != null && !extensionhandlerClass.equals( "" ) )
{
lParametersCall.setExtensionhandlerClass( extensionhandlerClass );
}

if( usernameorcas != null && !usernameorcas.equals( "" ) )
{
lParametersCall.setOrcasDbUser( usernameorcas );
Expand Down

0 comments on commit c162b0c

Please sign in to comment.