diff --git a/pom.xml b/pom.xml index 59369aa6..31c3a327 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ oss-parent 6 - com.wakaleo.schemaspy + com.wakaleo maven-schemaspy-plugin maven-plugin 5.0.4-SNAPSHOT @@ -131,6 +131,23 @@ + + + org.apache.maven.plugins + maven-jar-plugin + 2.3.1 + + + + net.sourceforge.schemaspy.Main + + + ${buildNumber} + + + + + diff --git a/src/main/java/com/wakaleo/schemaspy/SchemaSpyReport.java b/src/main/java/com/wakaleo/schemaspy/SchemaSpyReport.java index 50e40f17..ffce072c 100644 --- a/src/main/java/com/wakaleo/schemaspy/SchemaSpyReport.java +++ b/src/main/java/com/wakaleo/schemaspy/SchemaSpyReport.java @@ -212,6 +212,13 @@ public class SchemaSpyReport extends AbstractMavenReport { */ private Boolean noHtml; + /** + * Detail of execution logging. + * + * @parameter logLevel + */ + private String logLevel; + /** * Some databases, like Derby, will crash if you use the old driver object * to establish a connection (eg "connection = driver.connect(...)"). In @@ -441,6 +448,7 @@ protected void executeReport(Locale locale) throws MavenReportException { addFlagToArguments(argList, "-ahic", allowHtmlInComments); addFlagToArguments(argList, "-noimplied", noImplied); addFlagToArguments(argList, "-nohtml", noHtml); + addToArguments(argList, "-loglevel", logLevel); addFlagToArguments(argList, "-norows", noRows); addFlagToArguments(argList, "-noviews", noViews); addFlagToArguments(argList, "-noschema", noSchema); diff --git a/src/main/java/net/sourceforge/schemaspy/Config.java b/src/main/java/net/sourceforge/schemaspy/Config.java index 3bde8f35..40366a32 100644 --- a/src/main/java/net/sourceforge/schemaspy/Config.java +++ b/src/main/java/net/sourceforge/schemaspy/Config.java @@ -28,6 +28,7 @@ import java.io.IOException; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; +import java.net.URLDecoder; import java.sql.DatabaseMetaData; import java.util.ArrayList; import java.util.Arrays; @@ -1210,7 +1211,25 @@ public boolean isDbHelpRequired() { public static String getLoadedFromJar() { String classpath = System.getProperty("java.class.path"); - return new StringTokenizer(classpath, File.pathSeparator).nextToken(); + String loadedFrom = new StringTokenizer(classpath, File.pathSeparator).nextToken(); + String path = Config.class.getProtectionDomain().getCodeSource().getLocation().getPath(); + String decodedPath = null ; + try { + decodedPath = URLDecoder.decode(path, "UTF-8"); + } + catch (java.io.UnsupportedEncodingException uee) { + System.err.println("Unsupported UTF-8 encoding exception caught processing path = \"" + + "\" - defaulting to first classpath element" + ); + decodedPath = loadedFrom ; + } + System.err.println("classpath="+classpath); + System.err.println("loadedFrom="+loadedFrom); + System.err.println("path="+path); + System.err.println("decodedPath="+decodedPath); + return decodedPath ; + //return loadedFrom ; + //return new StringTokenizer(classpath, File.pathSeparator).nextToken(); } /** @@ -1718,4 +1737,4 @@ public List asList() throws IOException { return params; } -} \ No newline at end of file +}