Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
import org.apache.maven.shared.utils.logging.MessageUtils;
import org.utplsql.api.DBHelper;
import org.utplsql.api.FileMapperOptions;
import org.utplsql.api.JavaApiVersionInfo;
Expand Down Expand Up @@ -61,14 +62,14 @@ public class UtPLSQLMojo extends AbstractMojo {
protected boolean skipCompatibilityCheck;

@Parameter
protected List<ReporterParameter> reporters = new ArrayList<ReporterParameter>();
protected List<ReporterParameter> reporters = new ArrayList<>();

@Parameter
protected List<String> paths = new ArrayList<String>();
protected List<String> paths = new ArrayList<>();

// Sources Configuration
@Parameter
protected List<Resource> sources = new ArrayList<Resource>();
protected List<Resource> sources = new ArrayList<>();

@Parameter
private String sourcesOwner;
Expand Down Expand Up @@ -117,8 +118,8 @@ public class UtPLSQLMojo extends AbstractMojo {
@Parameter(defaultValue = "${maven.test.failure.ignore}")
protected boolean ignoreFailure;

// Color in the console, loaded by environment variables
private boolean colorConsole = PluginDefault.resolveColor();
// Color in the console, bases on maven logging configuration
private boolean colorConsole = MessageUtils.isColorEnabled();

// Reporter Writer
private ReporterWriter reporterWriter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package org.utplsql.maven.plugin.helper;

import java.io.File;
import java.util.Arrays;
import java.util.Map;

import org.apache.maven.model.Resource;

Expand All @@ -14,13 +12,6 @@
*/
public class PluginDefault
{

private static final String STYLE_COLOR_PROPERTY = "style.color";

private static final String BATCH_MODE = "B";

private static final String LOG_FILE = "l";

// Source Directory
public static final String SOURCE_DIRECTORY = "src/main/plsql";

Expand Down Expand Up @@ -69,32 +60,4 @@ private static Resource buildDirectory(String directory, String includes)
resource.setIncludes(Arrays.asList(includes));
return resource;
}

/**
*
* @return
*/
public static boolean resolveColor()
{
final Map<String, String> env = System.getenv();
String color = env.get(STYLE_COLOR_PROPERTY);

if ("always".equals(color))
{
return true;
}

if ("never".equals(color))
{
return false;
}

if (env.containsKey(BATCH_MODE) || env.containsKey(LOG_FILE))
{
return false;
}

return false;
}

}