From b6e39963fc1d188a8229a5ed49c04b706e670ac1 Mon Sep 17 00:00:00 2001 From: "benji.potter" Date: Wed, 10 Oct 2012 20:43:11 +0200 Subject: [PATCH 1/3] Warning and error build correction Change color on flex output file Update gitignore for non eclipse use. --- .gitignore | 5 ++++- interceptors/always-offline/pom.xml | 2 +- interceptors/console-colorizer/pom.xml | 2 +- .../console-colorizer/src/main/jflex/OutputLexer.flex | 5 ++++- interceptors/yamlpom/pom.xml | 2 +- pom.xml | 9 +++++++-- 6 files changed, 18 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 7130d65..4c535ce 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,11 @@ -target +*.settings/ +*.project +*.classpath *.iml *.ipr *.iws *~ *.sh +*target/ pom.yml .pom.yml diff --git a/interceptors/always-offline/pom.xml b/interceptors/always-offline/pom.xml index 894bff4..f3b8eab 100644 --- a/interceptors/always-offline/pom.xml +++ b/interceptors/always-offline/pom.xml @@ -3,7 +3,7 @@ org.twdata.maven.trap - maven-trap-parent + maven-interceptor-parent 0.6-SNAPSHOT diff --git a/interceptors/console-colorizer/pom.xml b/interceptors/console-colorizer/pom.xml index 76c0a2a..e413590 100644 --- a/interceptors/console-colorizer/pom.xml +++ b/interceptors/console-colorizer/pom.xml @@ -3,7 +3,7 @@ org.twdata.maven.trap - maven-trap-parent + maven-interceptor-parent 0.6-SNAPSHOT diff --git a/interceptors/console-colorizer/src/main/jflex/OutputLexer.flex b/interceptors/console-colorizer/src/main/jflex/OutputLexer.flex index d4f2199..64f32d3 100644 --- a/interceptors/console-colorizer/src/main/jflex/OutputLexer.flex +++ b/interceptors/console-colorizer/src/main/jflex/OutputLexer.flex @@ -56,7 +56,10 @@ WhiteSpace = {LineTerminator} | [ \t\f] { "BUILD FAILURE" { term.bg(RED); term.fg(BLACK); out.print(yytext()); term.clear(); } - "BUILD SUCCESSFUL" { term.bg(GREEN); term.fg(BLACK); out.print(yytext()); term.clear(); } + "BUILD SUCCESS" { term.bg(GREEN); term.fg(BLACK); out.print(yytext()); term.clear(); } + "SUCCESS" { term.bg(GREEN); term.fg(BLACK); out.print(yytext()); term.clear(); } + "FAILURE" { term.bg(RED); term.fg(BLACK); out.print(yytext()); term.clear(); } + "SKIPPED" { term.bg(BLUE); term.fg(BLACK); out.print(yytext()); term.clear(); } {InputCharacter} { out.print(yytext()); } {LineTerminator} { out.print(yytext()); term.clear(); yybegin(YYINITIAL); } } diff --git a/interceptors/yamlpom/pom.xml b/interceptors/yamlpom/pom.xml index 03b80ac..2d8af65 100644 --- a/interceptors/yamlpom/pom.xml +++ b/interceptors/yamlpom/pom.xml @@ -3,7 +3,7 @@ org.twdata.maven.trap - maven-trap-parent + maven-interceptor-parent 0.6-SNAPSHOT diff --git a/pom.xml b/pom.xml index ecb3259..c267338 100644 --- a/pom.xml +++ b/pom.xml @@ -41,6 +41,7 @@ org.apache.maven.plugins maven-scm-plugin + 1.8 org.apache.maven.scm @@ -51,6 +52,7 @@ maven-compiler-plugin + 2.5.1 1.5 1.5 @@ -80,7 +82,10 @@ - scm:git:git://github.com/mrdon/Console-Colorizer.git - scm:git:git://github.com/mrdon/Console-Colorizer.git + scm:git:git://github.com/benjipotter/maven-trap.git + scm:git:git://github.com/benjipotter/maven-trap.git + + UTF-8 + From dc2ea0fda825bc0b1c32449991fd67930243fb9f Mon Sep 17 00:00:00 2001 From: "benji.potter" Date: Wed, 10 Oct 2012 21:10:12 +0200 Subject: [PATCH 2/3] moddify README --- README.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..3c82c03 --- /dev/null +++ b/README.md @@ -0,0 +1,35 @@ +Usage: +====== + +1- Copy maven-trap-0.5.jar file to M2_HOME/boot +2- Edit the M2_HOME/bin/mvn script and change the last line from: + +```shell +exec "$JAVACMD" \ + $MAVEN_OPTS \ + -cp "${M2_HOME}"/boot/classworlds-*.jar \ + "-Dclassworlds.conf=${M2_HOME}/bin/m2.conf" \ + "-Dmaven.home=${M2_HOME}" \ + ${CLASSWORLDS_LAUNCHER} $QUOTED_ARGS +``` + +to: + +```shell +exec "$JAVACMD" \ + $MAVEN_OPTS \ + -cp "${M2_HOME}"/boot/classworlds-1.1.jar:"${M2_HOME}"/boot/maven-trap-0.5.jar \ + "-Dclassworlds.conf=${M2_HOME}/bin/m2.conf" \ + "-Dmaven.home=${M2_HOME}" \ + org.twdata.maven.trap.Dispatcher $QUOTED_ARGS +``` + +3- Switch on whatever features you'd like by setting environment variables + (unsetting to disable): + - MAVEN_COLOR : Output colorization + - MAVEN_ALWAYS_OFFLINE : Changes default to be offline, -o to go online + - MAVEN_YAMLPOM : Automatic creating and syncing of YAML version of the POM + +Now, you can use 'mvn' like normal. Alternatively, you can make the +changes to a cloned 'mvn2' script to avoid modifying any original files. Also, +you may want to change 'mvnDebug' as well if you use that frequently. From ce9e9ca80bd6abf1ff1dc4f17f1bf102b3e3bdf7 Mon Sep 17 00:00:00 2001 From: "benji.potter" Date: Wed, 10 Oct 2012 21:10:47 +0200 Subject: [PATCH 3/3] Modify README --- README.txt | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 README.txt diff --git a/README.txt b/README.txt deleted file mode 100644 index 39fd9d0..0000000 --- a/README.txt +++ /dev/null @@ -1,30 +0,0 @@ -Usage: - -1. Copy maven-trap-0.5.jar file to M2_HOME/boot -2. Edit the M2_HOME/bin/mvn script and change the last line from: - -exec "$JAVACMD" \ - $MAVEN_OPTS \ - -cp "${M2_HOME}"/boot/classworlds-*.jar \ - "-Dclassworlds.conf=${M2_HOME}/bin/m2.conf" \ - "-Dmaven.home=${M2_HOME}" \ - ${CLASSWORLDS_LAUNCHER} $QUOTED_ARGS - -to: - -exec "$JAVACMD" \ - $MAVEN_OPTS \ - -cp "${M2_HOME}"/boot/classworlds-1.1.jar:"${M2_HOME}"/boot/maven-trap-0.5.jar \ - "-Dclassworlds.conf=${M2_HOME}/bin/m2.conf" \ - "-Dmaven.home=${M2_HOME}" \ - org.twdata.maven.trap.Dispatcher $QUOTED_ARGS - -3. Switch on whatever features you'd like by setting environment variables - (unsetting to disable): - - MAVEN_COLOR : Output colorization - - MAVEN_ALWAYS_OFFLINE : Changes default to be offline, -o to go online - - MAVEN_YAMLPOM : Automatic creating and syncing of YAML version of the POM - -Now, you can use 'mvn' like normal. Alternatively, you can make the -changes to a cloned 'mvn2' script to avoid modifying any original files. Also, -you may want to change 'mvnDebug' as well if you use that frequently.