You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2017/01/24 17:40:40 UTC
[1/4] maven git commit: Jenkins file notification email title
improvement
Repository: maven
Updated Branches:
refs/heads/master be5caccaf -> 21d1bfb5a
Jenkins file notification email title improvement
Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/21d1bfb5
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/21d1bfb5
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/21d1bfb5
Branch: refs/heads/master
Commit: 21d1bfb5a08ecf67a10b88a6fdbda98e7361376b
Parents: 94bc4de
Author: Herv� Boutemy <hb...@apache.org>
Authored: Mon Jan 23 23:11:22 2017 +0100
Committer: Herv� Boutemy <hb...@apache.org>
Committed: Tue Jan 24 18:40:07 2017 +0100
----------------------------------------------------------------------
Jenkinsfile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven/blob/21d1bfb5/Jenkinsfile
----------------------------------------------------------------------
diff --git a/Jenkinsfile b/Jenkinsfile
index 07ce2e6..5b82d78 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -131,7 +131,7 @@ parallel linuxJava7:{
}
} finally {
node('ubuntu') {
- emailext body: "See ${env.BUILD_URL}", recipientProviders: [[$class: 'CulpritsRecipientProvider'], [$class: 'FailingTestSuspectsRecipientProvider'], [$class: 'FirstFailingBuildSuspectsRecipientProvider']], replyTo: 'dev@maven.apache.org', subject: "Maven Jenkinsfile finished with ${currentBuild.result}", to: 'notifications@maven.apache.org'
+ emailext body: "See ${env.BUILD_URL}", recipientProviders: [[$class: 'CulpritsRecipientProvider'], [$class: 'FailingTestSuspectsRecipientProvider'], [$class: 'FirstFailingBuildSuspectsRecipientProvider']], replyTo: 'dev@maven.apache.org', subject: "${env.JOB_NAME} - build ${env.BUILD_DISPLAY_NAME} - ${currentBuild.result}", to: 'notifications@maven.apache.org'
}
}
[3/4] maven git commit: [MNG-6093] use monkey patched slf4j-simple
provider with Maven color
Posted by hb...@apache.org.
[MNG-6093] use monkey patched slf4j-simple provider with Maven color
Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/94bc4de2
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/94bc4de2
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/94bc4de2
Branch: refs/heads/master
Commit: 94bc4de2ea54afa09a353034ed06edf0f68a8d87
Parents: b80915b
Author: Herv� Boutemy <hb...@apache.org>
Authored: Thu Sep 22 17:46:53 2016 +0200
Committer: Herv� Boutemy <hb...@apache.org>
Committed: Tue Jan 24 18:40:07 2017 +0100
----------------------------------------------------------------------
apache-maven/pom.xml | 4 +-
.../maven/slf4j-configuration.properties | 1 +
maven-slf4j-provider/pom.xml | 116 +++++++++++++++++++
.../java/org/slf4j/impl/MavenSimpleLogger.java | 115 ++++++++++++++++++
.../slf4j/impl/MavenSimpleLoggerFactory.java | 44 +++++++
.../src/main/script/patch-slf4j-simple.groovy | 53 +++++++++
maven-slf4j-provider/src/site/site.xml | 36 ++++++
pom.xml | 6 +
src/site/xdoc/index.xml | 2 +
9 files changed, 375 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven/blob/94bc4de2/apache-maven/pom.xml
----------------------------------------------------------------------
diff --git a/apache-maven/pom.xml b/apache-maven/pom.xml
index f7c28ed..b2fa989 100644
--- a/apache-maven/pom.xml
+++ b/apache-maven/pom.xml
@@ -88,8 +88,8 @@
<artifactId>aether-transport-wagon</artifactId>
</dependency>
<dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-slf4j-provider</artifactId>
</dependency>
<dependency>
<groupId>org.fusesource.jansi</groupId>
http://git-wip-us.apache.org/repos/asf/maven/blob/94bc4de2/maven-embedder/src/main/resources/META-INF/maven/slf4j-configuration.properties
----------------------------------------------------------------------
diff --git a/maven-embedder/src/main/resources/META-INF/maven/slf4j-configuration.properties b/maven-embedder/src/main/resources/META-INF/maven/slf4j-configuration.properties
index 8741836..ae1bc39 100644
--- a/maven-embedder/src/main/resources/META-INF/maven/slf4j-configuration.properties
+++ b/maven-embedder/src/main/resources/META-INF/maven/slf4j-configuration.properties
@@ -18,5 +18,6 @@
# key = Slf4j effective logger factory implementation
# value = corresponding o.a.m.cli.logging.Slf4jConfiguration class
org.slf4j.impl.SimpleLoggerFactory org.apache.maven.cli.logging.impl.Slf4jSimpleConfiguration
+org.slf4j.impl.MavenSimpleLoggerFactory org.apache.maven.cli.logging.impl.Slf4jSimpleConfiguration
org.slf4j.helpers.Log4jLoggerFactory org.apache.maven.cli.logging.impl.Log4j2Configuration
ch.qos.logback.classic.LoggerContext org.apache.maven.cli.logging.impl.LogbackConfiguration
http://git-wip-us.apache.org/repos/asf/maven/blob/94bc4de2/maven-slf4j-provider/pom.xml
----------------------------------------------------------------------
diff --git a/maven-slf4j-provider/pom.xml b/maven-slf4j-provider/pom.xml
new file mode 100644
index 0000000..81af382
--- /dev/null
+++ b/maven-slf4j-provider/pom.xml
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven</artifactId>
+ <version>3.5.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>maven-slf4j-provider</artifactId>
+
+ <name>Maven SLF4J Simple Provider</name>
+ <description>
+ Maven SLF4J provider based on SLF4J's simple provider, monkey-patched to support Maven styled colors
+ for levels and stacktraces rendering.
+ </description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.shared</groupId>
+ <artifactId>maven-shared-utils</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <version>${slf4jVersion}</version>
+ <type>jar</type>
+ <classifier>sources</classifier>
+ <overWrite>false</overWrite>
+ <outputDirectory>${project.build.directory}/generated-sources/slf4j-simple</outputDirectory>
+ <includes>org/slf4j/impl/*.java</includes>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ <executions>
+ <execution>
+ <id>unzip-slf4j-simple</id>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>1.12</version>
+ <executions>
+ <execution>
+ <id>add-slf4j-simple</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>${project.build.directory}/generated-sources/slf4j-simple</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.gmaven</groupId>
+ <artifactId>groovy-maven-plugin</artifactId>
+ <version>2.0</version>
+ <executions>
+ <execution>
+ <id>patch-slf4j-simple</id>
+ <phase>process-sources</phase>
+ <goals>
+ <goal>execute</goal>
+ </goals>
+ <configuration>
+ <source>${project.basedir}/src/main/script/patch-slf4j-simple.groovy</source>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/maven/blob/94bc4de2/maven-slf4j-provider/src/main/java/org/slf4j/impl/MavenSimpleLogger.java
----------------------------------------------------------------------
diff --git a/maven-slf4j-provider/src/main/java/org/slf4j/impl/MavenSimpleLogger.java b/maven-slf4j-provider/src/main/java/org/slf4j/impl/MavenSimpleLogger.java
new file mode 100644
index 0000000..17f1f48
--- /dev/null
+++ b/maven-slf4j-provider/src/main/java/org/slf4j/impl/MavenSimpleLogger.java
@@ -0,0 +1,115 @@
+package org.slf4j.impl;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import static org.apache.maven.shared.utils.logging.MessageUtils.buffer;
+
+import java.io.PrintStream;
+
+/**
+ * Logger for Maven, that support colorization of levels and stacktraces.
+ * This class implements 2 methods introduced in slf4j-simple provider local copy.
+ * @since 3.5.0
+ */
+public class MavenSimpleLogger
+ extends SimpleLogger
+{
+ MavenSimpleLogger( String name )
+ {
+ super( name );
+ }
+
+ @Override
+ protected String renderLevel( int level )
+ {
+ switch ( level )
+ {
+ case LOG_LEVEL_TRACE:
+ return buffer().debug( "TRACE" ).toString();
+ case LOG_LEVEL_DEBUG:
+ return buffer().debug( "DEBUG" ).toString();
+ case LOG_LEVEL_INFO:
+ return buffer().info( "INFO" ).toString();
+ case LOG_LEVEL_WARN:
+ return buffer().warning( "WARNING" ).toString();
+ case LOG_LEVEL_ERROR:
+ default:
+ return buffer().error( "ERROR" ).toString();
+ }
+ }
+
+ @Override
+ protected void renderThrowable( Throwable t, PrintStream stream )
+ {
+ stream.print( buffer().failure( t.getClass().getName() ) );
+ if ( t.getMessage() != null )
+ {
+ stream.print( ": " );
+ stream.print( buffer().failure( t.getMessage() ) );
+ }
+ stream.println();
+
+ while ( t != null )
+ {
+ for ( StackTraceElement e : t.getStackTrace() )
+ {
+ stream.print( " " );
+ stream.print( buffer().strong( "at" ) );
+ stream.print( " " + e.getClassName() + "." + e.getMethodName() );
+ stream.print( buffer().a( " (" ).strong( getLocation( e ) ).a( ")" ) );
+ stream.println();
+ }
+
+ t = t.getCause();
+ if ( t != null )
+ {
+ stream.print( buffer().strong( "Caused by" ).a( ": " ).a( t.getClass().getName() ) );
+ if ( t.getMessage() != null )
+ {
+ stream.print( ": " );
+ stream.print( buffer().failure( t.getMessage() ) );
+ }
+ stream.println();
+ }
+ }
+ }
+
+ protected String getLocation( final StackTraceElement e )
+ {
+ assert e != null;
+
+ if ( e.isNativeMethod() )
+ {
+ return "Native Method";
+ }
+ else if ( e.getFileName() == null )
+ {
+ return "Unknown Source";
+ }
+ else if ( e.getLineNumber() >= 0 )
+ {
+ return String.format( "%s:%s", e.getFileName(), e.getLineNumber() );
+ }
+ else
+ {
+ return e.getFileName();
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/maven/blob/94bc4de2/maven-slf4j-provider/src/main/java/org/slf4j/impl/MavenSimpleLoggerFactory.java
----------------------------------------------------------------------
diff --git a/maven-slf4j-provider/src/main/java/org/slf4j/impl/MavenSimpleLoggerFactory.java b/maven-slf4j-provider/src/main/java/org/slf4j/impl/MavenSimpleLoggerFactory.java
new file mode 100644
index 0000000..d56e346
--- /dev/null
+++ b/maven-slf4j-provider/src/main/java/org/slf4j/impl/MavenSimpleLoggerFactory.java
@@ -0,0 +1,44 @@
+package org.slf4j.impl;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.slf4j.Logger;
+
+public class MavenSimpleLoggerFactory
+ extends SimpleLoggerFactory
+{
+ /**
+ * Return an appropriate {@link MavenSimpleLogger} instance by name.
+ */
+ public Logger getLogger( String name )
+ {
+ Logger simpleLogger = loggerMap.get( name );
+ if ( simpleLogger != null )
+ {
+ return simpleLogger;
+ }
+ else
+ {
+ Logger newInstance = new MavenSimpleLogger( name );
+ Logger oldInstance = loggerMap.putIfAbsent( name, newInstance );
+ return oldInstance == null ? newInstance : oldInstance;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/maven/blob/94bc4de2/maven-slf4j-provider/src/main/script/patch-slf4j-simple.groovy
----------------------------------------------------------------------
diff --git a/maven-slf4j-provider/src/main/script/patch-slf4j-simple.groovy b/maven-slf4j-provider/src/main/script/patch-slf4j-simple.groovy
new file mode 100644
index 0000000..bba8646
--- /dev/null
+++ b/maven-slf4j-provider/src/main/script/patch-slf4j-simple.groovy
@@ -0,0 +1,53 @@
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+dir = new File( basedir, 'target/generated-sources/slf4j-simple/org/slf4j/impl' );
+
+file = new File( dir, 'StaticLoggerBinder.java' );
+content = file.text;
+
+// check if already patched
+if ( content.contains( 'MavenSimpleLoggerFactory' ) )
+{
+ println ' slf4j-simple already patched';
+ return;
+}
+
+
+println ' patching StaticLoggerBinder.java';
+content = content.replaceAll( 'SimpleLoggerFactory', 'MavenSimpleLoggerFactory' );
+file.write( content );
+
+
+println ' patching SimpleLogger.java';
+file = new File( dir, 'SimpleLogger.java' );
+content = file.text;
+content = content.replaceAll( 'private static final int LOG_LEVEL_', 'protected static final int LOG_LEVEL_' );
+content = content.replaceAll( 't.printStackTrace(TARGET_STREAM)', 'renderThrowable(t, TARGET_STREAM);' );
+
+index = content.indexOf( 'switch (level) {' );
+end = content.indexOf( '}', index ) + 1;
+content = content.substring( 0, index ) + 'buf.append(renderLevel(level));' + content.substring( end );
+
+content = content.substring( 0, content.lastIndexOf( '}' ) );
+content += ' protected void renderThrowable(Throwable t, PrintStream stream) {}\n';
+content += ' protected String renderLevel(int level) { return ""; }\n}\n';
+
+file.write( content );
http://git-wip-us.apache.org/repos/asf/maven/blob/94bc4de2/maven-slf4j-provider/src/site/site.xml
----------------------------------------------------------------------
diff --git a/maven-slf4j-provider/src/site/site.xml b/maven-slf4j-provider/src/site/site.xml
new file mode 100644
index 0000000..3a16bf9
--- /dev/null
+++ b/maven-slf4j-provider/src/site/site.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project xmlns="http://maven.apache.org/DECORATION/1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/DECORATION/1.0.0 http://maven.apache.org/xsd/decoration-1.0.0.xsd">
+ <body>
+ <menu name="Overview">
+ <item name="Introduction" href="index.html"/>
+ <item name="JavaDocs" href="apidocs/index.html"/>
+ <item name="Source Xref" href="xref/index.html"/>
+ <!--item name="FAQ" href="faq.html"/-->
+ </menu>
+
+ <menu ref="parent"/>
+ <menu ref="reports"/>
+ </body>
+</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/maven/blob/94bc4de2/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index f8b67aa..fba262b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -84,6 +84,7 @@
<module>maven-artifact</module>
<module>maven-aether-provider</module>
<module>maven-repository-metadata</module>
+ <module>maven-slf4j-provider</module>
<module>maven-embedder</module>
<module>maven-compat</module>
<module>apache-maven</module>
@@ -217,6 +218,11 @@
<artifactId>maven-builder-support</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-slf4j-provider</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<!--bootstrap-end-comment-->
<!-- Plexus -->
<dependency>
http://git-wip-us.apache.org/repos/asf/maven/blob/94bc4de2/src/site/xdoc/index.xml
----------------------------------------------------------------------
diff --git a/src/site/xdoc/index.xml b/src/site/xdoc/index.xml
index b98b4ee..11fa0de 100644
--- a/src/site/xdoc/index.xml
+++ b/src/site/xdoc/index.xml
@@ -55,6 +55,8 @@
<area shape="rect" coords="446,234,537,269" alt="maven-settings" href="maven-settings/" />
<area shape="rect" coords="388,284,521,319" alt="maven-model-builder" href="maven-model-builder/" />
<area shape="rect" coords="409,342,500,378" alt="maven-model" href="maven-model/" />
+ <area shape="rect" coords="TODO" alt="maven-slf4j-provider" href="maven-slf4j-provider/" />
+ <area shape="rect" coords="88,59,192,94" alt="slf4j-api" href="http://www.slf4j.org/manual.html" />
<area shape="rect" coords="551,58,707,94" alt="commons-cli" href="http://commons.apache.org/cli/" />
<area shape="rect" coords="551,116,739,152" alt="wagon-provider-api" href="http://maven.apache.org/wagon/wagon-provider-api/" />
<area shape="rect" coords="550,175,690,211" alt="plexus-sec-dispatcher" href="https://github.com/codehaus-plexus/plexus-sec-dispatcher" />
[2/4] maven git commit: [MNG-3507] added color to Maven execution
output messages
Posted by hb...@apache.org.
[MNG-3507] added color to Maven execution output messages
Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/b80915b8
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/b80915b8
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/b80915b8
Branch: refs/heads/master
Commit: b80915b8822b51aafa962a9ef53a61c0ac59033d
Parents: 8b66162
Author: Herv� Boutemy <hb...@apache.org>
Authored: Sun Jun 5 13:11:45 2016 +0200
Committer: Herv� Boutemy <hb...@apache.org>
Committed: Tue Jan 24 18:40:07 2017 +0100
----------------------------------------------------------------------
apache-maven/pom.xml | 4 +
apache-maven/src/bin/mvn | 1 +
apache-maven/src/bin/mvn.cmd | 2 +-
maven-core/pom.xml | 4 +
.../lifecycle/LifecycleExecutionException.java | 27 ++---
.../main/resources/META-INF/maven/extension.xml | 3 +
maven-embedder/pom.xml | 4 +
.../java/org/apache/maven/cli/CLIManager.java | 4 +-
.../org/apache/maven/cli/CLIReportingUtils.java | 6 +-
.../java/org/apache/maven/cli/MavenCli.java | 87 ++++++++++++--
.../maven/cli/event/ExecutionEventLogger.java | 117 ++++++++++---------
maven-embedder/src/site/apt/index.apt.vm | 5 +
pom.xml | 10 ++
13 files changed, 192 insertions(+), 82 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven/blob/b80915b8/apache-maven/pom.xml
----------------------------------------------------------------------
diff --git a/apache-maven/pom.xml b/apache-maven/pom.xml
index 735e5b8..f7c28ed 100644
--- a/apache-maven/pom.xml
+++ b/apache-maven/pom.xml
@@ -91,6 +91,10 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.fusesource.jansi</groupId>
+ <artifactId>jansi</artifactId>
+ </dependency>
</dependencies>
<build>
http://git-wip-us.apache.org/repos/asf/maven/blob/b80915b8/apache-maven/src/bin/mvn
----------------------------------------------------------------------
diff --git a/apache-maven/src/bin/mvn b/apache-maven/src/bin/mvn
index 6875628..f3acb73 100755
--- a/apache-maven/src/bin/mvn
+++ b/apache-maven/src/bin/mvn
@@ -241,4 +241,5 @@ exec "$JAVACMD" \
-classpath "${M2_HOME}"/boot/plexus-classworlds-*.jar \
"-Dclassworlds.conf=${M2_HOME}/bin/m2.conf" \
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
+ "-Dlibrary.jansi.path=${MAVEN_HOME}/lib/ext" \
${CLASSWORLDS_LAUNCHER} "$@"
http://git-wip-us.apache.org/repos/asf/maven/blob/b80915b8/apache-maven/src/bin/mvn.cmd
----------------------------------------------------------------------
diff --git a/apache-maven/src/bin/mvn.cmd b/apache-maven/src/bin/mvn.cmd
index d35c1d2..5ad99ae 100644
--- a/apache-maven/src/bin/mvn.cmd
+++ b/apache-maven/src/bin/mvn.cmd
@@ -154,7 +154,7 @@ for %%i in ("%M2_HOME%"\boot\plexus-classworlds-*) do set CLASSWORLDS_JAR="%%i"
set CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
-%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %CLASSWORLDS_JAR% "-Dclassworlds.conf=%M2_HOME%\bin\m2.conf" "-Dmaven.home=%M2_HOME%" "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %CLASSWORLDS_LAUNCHER% %MAVEN_CMD_LINE_ARGS%
+%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %CLASSWORLDS_JAR% "-Dclassworlds.conf=%M2_HOME%\bin\m2.conf" "-Dmaven.home=%M2_HOME%" "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" "-Dlibrary.jansi.path=%MAVEN_HOME%\lib\ext" %CLASSWORLDS_LAUNCHER% %MAVEN_CMD_LINE_ARGS%
if ERRORLEVEL 1 goto error
goto end
http://git-wip-us.apache.org/repos/asf/maven/blob/b80915b8/maven-core/pom.xml
----------------------------------------------------------------------
diff --git a/maven-core/pom.xml b/maven-core/pom.xml
index ac1968b..efff5c1 100644
--- a/maven-core/pom.xml
+++ b/maven-core/pom.xml
@@ -75,6 +75,10 @@
<groupId>org.eclipse.aether</groupId>
<artifactId>aether-util</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.apache.maven.shared</groupId>
+ <artifactId>maven-shared-utils</artifactId>
+ </dependency>
<!-- Plexus -->
<dependency>
<groupId>org.eclipse.sisu</groupId>
http://git-wip-us.apache.org/repos/asf/maven/blob/b80915b8/maven-core/src/main/java/org/apache/maven/lifecycle/LifecycleExecutionException.java
----------------------------------------------------------------------
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/LifecycleExecutionException.java b/maven-core/src/main/java/org/apache/maven/lifecycle/LifecycleExecutionException.java
index 349576c..62ae269 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/LifecycleExecutionException.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/LifecycleExecutionException.java
@@ -19,8 +19,11 @@ package org.apache.maven.lifecycle;
* under the License.
*/
+import static org.apache.maven.shared.utils.logging.MessageUtils.buffer;
+
import org.apache.maven.plugin.MojoExecution;
import org.apache.maven.project.MavenProject;
+import org.apache.maven.shared.utils.logging.MessageBuilder;
/**
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
@@ -75,34 +78,26 @@ public class LifecycleExecutionException
private static String createMessage( MojoExecution execution, MavenProject project, Throwable cause )
{
- StringBuilder buffer = new StringBuilder( 256 );
+ MessageBuilder buffer = buffer( 256 );
- buffer.append( "Failed to execute goal" );
+ buffer.a( "Failed to execute goal" );
if ( execution != null )
{
- buffer.append( ' ' );
- buffer.append( execution.getGroupId() );
- buffer.append( ':' );
- buffer.append( execution.getArtifactId() );
- buffer.append( ':' );
- buffer.append( execution.getVersion() );
- buffer.append( ':' );
- buffer.append( execution.getGoal() );
- buffer.append( " (" );
- buffer.append( execution.getExecutionId() );
- buffer.append( ")" );
+ buffer.a( ' ' ).a( execution.getGroupId() ).a( ':' );
+ buffer.mojo( execution.getArtifactId() + ':' + execution.getVersion() + ':' + execution.getGoal() );
+ buffer.a( ' ' ).strong( '(' + execution.getExecutionId() + ')' );
}
if ( project != null )
{
- buffer.append( " on project " );
- buffer.append( project.getArtifactId() );
+ buffer.a( " on project " );
+ buffer.project( project.getArtifactId() );
}
if ( cause != null )
{
- buffer.append( ": " ).append( cause.getMessage() );
+ buffer.a( ": " ).failure( cause.getMessage() );
}
return buffer.toString();
http://git-wip-us.apache.org/repos/asf/maven/blob/b80915b8/maven-core/src/main/resources/META-INF/maven/extension.xml
----------------------------------------------------------------------
diff --git a/maven-core/src/main/resources/META-INF/maven/extension.xml b/maven-core/src/main/resources/META-INF/maven/extension.xml
index e3af5a0..07e60aa 100644
--- a/maven-core/src/main/resources/META-INF/maven/extension.xml
+++ b/maven-core/src/main/resources/META-INF/maven/extension.xml
@@ -118,6 +118,8 @@ under the License.
<exportedPackage>org.slf4j.spi.*</exportedPackage>
<exportedPackage>org.slf4j.helpers.*</exportedPackage>
+ <!-- JAnsi -->
+ <exportedPackage>org.fusesource.jansi.*</exportedPackage>
</exportedPackages>
<exportedArtifacts>
@@ -156,6 +158,7 @@ under the License.
<exportedArtifact>javax.inject:javax.inject</exportedArtifact>
<exportedArtifact>org.slf4j:slf4j-api</exportedArtifact>
+ <exportedArtifact>org.fusesource.jansi:jansi</exportedArtifact>
<!--
| We must also filter out the old or NoClassDefFoundErrors will surface
http://git-wip-us.apache.org/repos/asf/maven/blob/b80915b8/maven-embedder/pom.xml
----------------------------------------------------------------------
diff --git a/maven-embedder/pom.xml b/maven-embedder/pom.xml
index e02e43d..04b8da6 100644
--- a/maven-embedder/pom.xml
+++ b/maven-embedder/pom.xml
@@ -47,6 +47,10 @@
<scope>runtime</scope>
</dependency>
<dependency>
+ <groupId>org.apache.maven.shared</groupId>
+ <artifactId>maven-shared-utils</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
</dependency>
http://git-wip-us.apache.org/repos/asf/maven/blob/b80915b8/maven-embedder/src/main/java/org/apache/maven/cli/CLIManager.java
----------------------------------------------------------------------
diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/CLIManager.java b/maven-embedder/src/main/java/org/apache/maven/cli/CLIManager.java
index f461835..673f52d 100644
--- a/maven-embedder/src/main/java/org/apache/maven/cli/CLIManager.java
+++ b/maven-embedder/src/main/java/org/apache/maven/cli/CLIManager.java
@@ -108,7 +108,7 @@ public class CLIManager
{
options = new Options();
options.addOption( OptionBuilder.withLongOpt( "help" ).withDescription( "Display help information" ).create( HELP ) );
- options.addOption( OptionBuilder.withLongOpt( "file" ).hasArg().withDescription( "Force the use of an alternate POM file (or directory with pom.xml)." ).create( ALTERNATE_POM_FILE ) );
+ options.addOption( OptionBuilder.withLongOpt( "file" ).hasArg().withDescription( "Force the use of an alternate POM file (or directory with pom.xml, disables output color)" ).create( ALTERNATE_POM_FILE ) );
options.addOption( OptionBuilder.withLongOpt( "define" ).hasArg().withDescription( "Define a system property" ).create( SET_SYSTEM_PROPERTY ) );
options.addOption( OptionBuilder.withLongOpt( "offline" ).withDescription( "Work offline" ).create( OFFLINE ) );
options.addOption( OptionBuilder.withLongOpt( "version" ).withDescription( "Display version information" ).create( VERSION ) );
@@ -118,7 +118,7 @@ public class CLIManager
options.addOption( OptionBuilder.withLongOpt( "non-recursive" ).withDescription( "Do not recurse into sub-projects" ).create( NON_RECURSIVE ) );
options.addOption( OptionBuilder.withLongOpt( "update-snapshots" ).withDescription( "Forces a check for missing releases and updated snapshots on remote repositories" ).create( UPDATE_SNAPSHOTS ) );
options.addOption( OptionBuilder.withLongOpt( "activate-profiles" ).withDescription( "Comma-delimited list of profiles to activate" ).hasArg().create( ACTIVATE_PROFILES ) );
- options.addOption( OptionBuilder.withLongOpt( "batch-mode" ).withDescription( "Run in non-interactive (batch) mode" ).create( BATCH_MODE ) );
+ options.addOption( OptionBuilder.withLongOpt( "batch-mode" ).withDescription( "Run in non-interactive (batch) mode (disables output color)" ).create( BATCH_MODE ) );
options.addOption( OptionBuilder.withLongOpt( "no-snapshot-updates" ).withDescription( "Suppress SNAPSHOT updates" ).create( SUPRESS_SNAPSHOT_UPDATES ) );
options.addOption( OptionBuilder.withLongOpt( "strict-checksums" ).withDescription( "Fail the build if checksums don't match" ).create( CHECKSUM_FAILURE_POLICY ) );
options.addOption( OptionBuilder.withLongOpt( "lax-checksums" ).withDescription( "Warn if checksums don't match" ).create( CHECKSUM_WARNING_POLICY ) );
http://git-wip-us.apache.org/repos/asf/maven/blob/b80915b8/maven-embedder/src/main/java/org/apache/maven/cli/CLIReportingUtils.java
----------------------------------------------------------------------
diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/CLIReportingUtils.java b/maven-embedder/src/main/java/org/apache/maven/cli/CLIReportingUtils.java
index 214704b..f164852 100644
--- a/maven-embedder/src/main/java/org/apache/maven/cli/CLIReportingUtils.java
+++ b/maven-embedder/src/main/java/org/apache/maven/cli/CLIReportingUtils.java
@@ -19,6 +19,8 @@ package org.apache.maven.cli;
* under the License.
*/
+import static org.apache.maven.shared.utils.logging.MessageUtils.buffer;
+
import java.io.IOException;
import java.io.InputStream;
import java.text.SimpleDateFormat;
@@ -54,8 +56,8 @@ public final class CLIReportingUtils
{
final String ls = System.getProperty( "line.separator" );
Properties properties = getBuildProperties();
- StringBuilder version = new StringBuilder();
- version.append( createMavenVersionString( properties ) ).append( ls );
+ StringBuilder version = new StringBuilder( 256 );
+ version.append( buffer().strong( createMavenVersionString( properties ) ) ).append( ls );
version.append( reduce(
properties.getProperty( "distributionShortName" ) + " home: " + System.getProperty( "maven.home",
"<unknown Maven "
http://git-wip-us.apache.org/repos/asf/maven/blob/b80915b8/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
----------------------------------------------------------------------
diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java b/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
index 9da7c4d..8455848 100644
--- a/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
+++ b/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
@@ -19,6 +19,8 @@ package org.apache.maven.cli;
* under the License.
*/
+import static org.apache.maven.shared.utils.logging.MessageUtils.buffer;
+
import com.google.common.base.Charsets;
import com.google.common.io.Files;
import com.google.inject.AbstractModule;
@@ -62,6 +64,8 @@ import org.apache.maven.model.building.ModelProcessor;
import org.apache.maven.project.MavenProject;
import org.apache.maven.properties.internal.EnvironmentUtils;
import org.apache.maven.properties.internal.SystemProperties;
+import org.apache.maven.shared.utils.logging.MessageBuilder;
+import org.apache.maven.shared.utils.logging.MessageUtils;
import org.apache.maven.toolchain.building.DefaultToolchainsBuildingRequest;
import org.apache.maven.toolchain.building.ToolchainsBuilder;
import org.apache.maven.toolchain.building.ToolchainsBuildingResult;
@@ -107,6 +111,8 @@ import java.util.Map.Entry;
import java.util.Properties;
import java.util.Set;
import java.util.StringTokenizer;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
// TODO: push all common bits back to plexus cli and prepare for transition to Guice. We don't need 50 ways to make CLIs
@@ -196,7 +202,12 @@ public class MavenCli
public static int main( String[] args, ClassWorld classWorld )
{
MavenCli cli = new MavenCli();
- return cli.doMain( new CliRequest( args, classWorld ) );
+
+ MessageUtils.systemInstall();
+ int result = cli.doMain( new CliRequest( args, classWorld ) );
+ MessageUtils.systemUninstall();
+
+ return result;
}
// TODO: need to externalize CliRequest
@@ -206,7 +217,11 @@ public class MavenCli
return cli.doMain( new CliRequest( args, classWorld ) );
}
- // This supports painless invocation by the Verifier during embedded execution of the core ITs
+ /**
+ * This supports painless invocation by the Verifier during embedded execution of the core ITs.
+ * See <a href="http://maven.apache.org/shared/maven-verifier/xref/org/apache/maven/it/Embedded3xLauncher.html">
+ * <code>Embedded3xLauncher</code> in <code>maven-verifier</code></a>
+ */
public int doMain( String[] args, String workingDirectory, PrintStream stdout, PrintStream stderr )
{
PrintStream oldout = System.out;
@@ -450,11 +465,18 @@ public class MavenCli
// else fall back to default log level specified in conf
// see https://issues.apache.org/jira/browse/MNG-2570
+ if ( cliRequest.commandLine.hasOption( CLIManager.BATCH_MODE ) )
+ {
+ MessageUtils.setColorEnabled( false );
+ }
+
if ( cliRequest.commandLine.hasOption( CLIManager.LOG_FILE ) )
{
File logFile = new File( cliRequest.commandLine.getOptionValue( CLIManager.LOG_FILE ) );
logFile = resolveFile( logFile, cliRequest.workingDirectory );
+ MessageUtils.setColorEnabled( false );
+
// redirect stdout and stderr to file
try
{
@@ -499,6 +521,26 @@ public class MavenCli
{
slf4jLogger.info( "Enabling strict checksum verification on all artifact downloads." );
}
+
+ if ( slf4jLogger.isDebugEnabled() )
+ {
+ slf4jLogger.debug( "Message scheme: " + ( MessageUtils.isColorEnabled() ? "color" : "plain" ) );
+ if ( MessageUtils.isColorEnabled() )
+ {
+ MessageBuilder buff = MessageUtils.buffer();
+ buff.a( "Message styles: " );
+ buff.debug( "debug" ).a( ' ' );
+ buff.info( "info" ).a( ' ' );
+ buff.warning( "warning" ).a( ' ' );
+ buff.error( "error" ).a( ' ' );
+ buff.success( "success" ).a( ' ' );
+ buff.failure( "failure" ).a( ' ' );
+ buff.strong( "strong" ).a( ' ' );
+ buff.mojo( "mojo" ).a( ' ' );
+ buff.project( "project" );
+ slf4jLogger.debug( buff.toString() );
+ }
+ }
}
private void properties( CliRequest cliRequest )
@@ -890,11 +932,13 @@ public class MavenCli
if ( !cliRequest.showErrors )
{
- slf4jLogger.error( "To see the full stack trace of the errors, re-run Maven with the -e switch." );
+ slf4jLogger.error( "To see the full stack trace of the errors, re-run Maven with the "
+ + buffer().strong( "-e" ) + " switch." );
}
if ( !slf4jLogger.isDebugEnabled() )
{
- slf4jLogger.error( "Re-run Maven using the -X switch to enable full debug logging." );
+ slf4jLogger.error( "Re-run Maven using the " + buffer().strong( "-X" )
+ + " switch to enable full debug logging." );
}
if ( !references.isEmpty() )
@@ -905,7 +949,7 @@ public class MavenCli
for ( Map.Entry<String, String> entry : references.entrySet() )
{
- slf4jLogger.error( entry.getValue() + " " + entry.getKey() );
+ slf4jLogger.error( buffer().strong( entry.getValue() ) + " " + entry.getKey() );
}
}
@@ -913,7 +957,8 @@ public class MavenCli
{
slf4jLogger.error( "" );
slf4jLogger.error( "After correcting the problems, you can resume the build with the command" );
- slf4jLogger.error( " mvn <goals> -rf :" + project.getArtifactId() );
+ slf4jLogger.error( buffer().a( " " ).strong( "mvn <goals> -rf :"
+ + project.getArtifactId() ).toString() );
}
if ( MavenExecutionRequest.REACTOR_FAIL_NEVER.equals( cliRequest.request.getReactorFailureBehavior() ) )
@@ -954,19 +999,37 @@ public class MavenCli
{
if ( msg.indexOf( '\n' ) < 0 )
{
- msg += " -> " + referenceKey;
+ msg += " -> " + buffer().strong( referenceKey );
}
else
{
- msg += "\n-> " + referenceKey;
+ msg += "\n-> " + buffer().strong( referenceKey );
}
}
String[] lines = msg.split( "(\r\n)|(\r)|(\n)" );
+ String currentColor = "";
for ( int i = 0; i < lines.length; i++ )
{
- String line = indent + lines[i].trim();
+ // add eventual current color inherited from previous line
+ String line = currentColor + lines[i];
+
+ // look for last ANSI escape sequence to check if nextColor
+ Matcher matcher = LAST_ANSI_SEQUENCE.matcher( line );
+ String nextColor = "";
+ if ( matcher.find() )
+ {
+ nextColor = matcher.group( 1 );
+ if ( ANSI_RESET.equals( nextColor ) )
+ {
+ // last ANSI escape code is reset: no next color
+ nextColor = "";
+ }
+ }
+
+ // effective line, with indent and reset if end is colored
+ line = indent + line + ( "".equals( nextColor ) ? "" : ANSI_RESET );
if ( ( i == lines.length - 1 ) && ( showErrors
|| ( summary.getException() instanceof InternalErrorException ) ) )
@@ -977,6 +1040,8 @@ public class MavenCli
{
slf4jLogger.error( line );
}
+
+ currentColor = nextColor;
}
indent += " ";
@@ -987,6 +1052,10 @@ public class MavenCli
}
}
+ private static final Pattern LAST_ANSI_SEQUENCE = Pattern.compile( "(\u001B\\[[;\\d]*[ -/]*[@-~])[^\u001B]*$" );
+
+ private static final String ANSI_RESET = "\u001B\u005Bm";
+
@SuppressWarnings( "checkstyle:methodlength" )
private void configure( CliRequest cliRequest )
throws Exception
http://git-wip-us.apache.org/repos/asf/maven/blob/b80915b8/maven-embedder/src/main/java/org/apache/maven/cli/event/ExecutionEventLogger.java
----------------------------------------------------------------------
diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/event/ExecutionEventLogger.java b/maven-embedder/src/main/java/org/apache/maven/cli/event/ExecutionEventLogger.java
index a0eab13..25ec38d 100644
--- a/maven-embedder/src/main/java/org/apache/maven/cli/event/ExecutionEventLogger.java
+++ b/maven-embedder/src/main/java/org/apache/maven/cli/event/ExecutionEventLogger.java
@@ -21,6 +21,7 @@ package org.apache.maven.cli.event;
import static org.apache.maven.cli.CLIReportingUtils.formatDuration;
import static org.apache.maven.cli.CLIReportingUtils.formatTimestamp;
+import static org.apache.maven.shared.utils.logging.MessageUtils.buffer;
import org.apache.commons.lang3.Validate;
import org.apache.maven.execution.AbstractExecutionListener;
@@ -33,6 +34,7 @@ import org.apache.maven.execution.MavenSession;
import org.apache.maven.plugin.MojoExecution;
import org.apache.maven.plugin.descriptor.MojoDescriptor;
import org.apache.maven.project.MavenProject;
+import org.apache.maven.shared.utils.logging.MessageBuilder;
import org.codehaus.plexus.util.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -74,6 +76,16 @@ public class ExecutionEventLogger
return buffer.toString();
}
+ private void infoLine( char c )
+ {
+ infoMain( chars( c, LINE_LENGTH ) );
+ }
+
+ private void infoMain( String msg )
+ {
+ logger.info( buffer().strong( msg ).toString() );
+ }
+
@Override
public void projectDiscoveryStarted( ExecutionEvent event )
{
@@ -88,9 +100,9 @@ public class ExecutionEventLogger
{
if ( logger.isInfoEnabled() && event.getSession().getProjects().size() > 1 )
{
- logger.info( chars( '-', LINE_LENGTH ) );
+ infoLine( '-' );
- logger.info( "Reactor Build Order:" );
+ infoMain( "Reactor Build Order:" );
logger.info( "" );
@@ -115,15 +127,15 @@ public class ExecutionEventLogger
logStats( event.getSession() );
- logger.info( chars( '-', LINE_LENGTH ) );
+ infoLine( '-' );
}
}
private void logReactorSummary( MavenSession session )
{
- logger.info( chars( '-', LINE_LENGTH ) );
+ infoLine( '-' );
- logger.info( "Reactor Summary:" );
+ infoMain( "Reactor Summary:" );
logger.info( "" );
@@ -149,11 +161,12 @@ public class ExecutionEventLogger
if ( buildSummary == null )
{
- buffer.append( "SKIPPED" );
+ buffer.append( buffer().warning( "SKIPPED" ) );
}
else if ( buildSummary instanceof BuildSuccess )
{
- buffer.append( "SUCCESS [" );
+ buffer.append( buffer().success( "SUCCESS" ) );
+ buffer.append( " [" );
String buildTimeDuration = formatDuration( buildSummary.getTime() );
int padSize = MAX_PADDED_BUILD_TIME_DURATION_LENGTH - buildTimeDuration.length();
if ( padSize > 0 )
@@ -165,7 +178,8 @@ public class ExecutionEventLogger
}
else if ( buildSummary instanceof BuildFailure )
{
- buffer.append( "FAILURE [" );
+ buffer.append( buffer().failure( "FAILURE" ) );
+ buffer.append( " [" );
String buildTimeDuration = formatDuration( buildSummary.getTime() );
int padSize = MAX_PADDED_BUILD_TIME_DURATION_LENGTH - buildTimeDuration.length();
if ( padSize > 0 )
@@ -182,21 +196,23 @@ public class ExecutionEventLogger
private void logResult( MavenSession session )
{
- logger.info( chars( '-', LINE_LENGTH ) );
+ infoLine( '-' );
+ MessageBuilder buffer = buffer();
if ( session.getResult().hasExceptions() )
{
- logger.info( "BUILD FAILURE" );
+ buffer.failure( "BUILD FAILURE" );
}
else
{
- logger.info( "BUILD SUCCESS" );
+ buffer.success( "BUILD SUCCESS" );
}
+ logger.info( buffer.toString() );
}
private void logStats( MavenSession session )
{
- logger.info( chars( '-', LINE_LENGTH ) );
+ infoLine( '-' );
long finish = System.currentTimeMillis();
@@ -222,13 +238,13 @@ public class ExecutionEventLogger
{
if ( logger.isInfoEnabled() )
{
- logger.info( chars( ' ', LINE_LENGTH ) );
- logger.info( chars( '-', LINE_LENGTH ) );
+ logger.info( "" );
+ infoLine( '-' );
- logger.info( "Skipping " + event.getProject().getName() );
+ infoMain( "Skipping " + event.getProject().getName() );
logger.info( "This project has been banned from the build due to previous failures." );
- logger.info( chars( '-', LINE_LENGTH ) );
+ infoLine( '-' );
}
}
@@ -237,12 +253,12 @@ public class ExecutionEventLogger
{
if ( logger.isInfoEnabled() )
{
- logger.info( chars( ' ', LINE_LENGTH ) );
- logger.info( chars( '-', LINE_LENGTH ) );
+ logger.info( "" );
+ infoLine( '-' );
- logger.info( "Building " + event.getProject().getName() + " " + event.getProject().getVersion() );
+ infoMain( "Building " + event.getProject().getName() + " " + event.getProject().getVersion() );
- logger.info( chars( '-', LINE_LENGTH ) );
+ infoLine( '-' );
}
}
@@ -264,14 +280,13 @@ public class ExecutionEventLogger
{
if ( logger.isInfoEnabled() )
{
- StringBuilder buffer = new StringBuilder( 128 );
+ logger.info( "" );
- buffer.append( "--- " );
+ MessageBuilder buffer = buffer().strong( "--- " );
append( buffer, event.getMojoExecution() );
append( buffer, event.getProject() );
- buffer.append( " ---" );
+ buffer.strong( " ---" );
- logger.info( "" );
logger.info( buffer.toString() );
}
}
@@ -285,16 +300,15 @@ public class ExecutionEventLogger
{
if ( logger.isInfoEnabled() )
{
- StringBuilder buffer = new StringBuilder( 128 );
+ logger.info( "" );
- buffer.append( ">>> " );
+ MessageBuilder buffer = buffer().strong( ">>> " );
append( buffer, event.getMojoExecution() );
- buffer.append( " > " );
+ buffer.strong( " > " );
appendForkInfo( buffer, event.getMojoExecution().getMojoDescriptor() );
append( buffer, event.getProject() );
- buffer.append( " >>>" );
+ buffer.strong( " >>>" );
- logger.info( "" );
logger.info( buffer.toString() );
}
}
@@ -310,56 +324,56 @@ public class ExecutionEventLogger
{
if ( logger.isInfoEnabled() )
{
- StringBuilder buffer = new StringBuilder( 128 );
+ logger.info( "" );
- buffer.append( "<<< " );
+ MessageBuilder buffer = buffer().strong( "<<< " );
append( buffer, event.getMojoExecution() );
- buffer.append( " < " );
+ buffer.strong( " < " );
appendForkInfo( buffer, event.getMojoExecution().getMojoDescriptor() );
append( buffer, event.getProject() );
- buffer.append( " <<<" );
+ buffer.strong( " <<<" );
- logger.info( "" );
logger.info( buffer.toString() );
logger.info( "" );
}
}
- private void append( StringBuilder buffer, MojoExecution me )
+ private void append( MessageBuilder buffer, MojoExecution me )
{
- buffer.append( me.getArtifactId() ).append( ':' ).append( me.getVersion() );
- buffer.append( ':' ).append( me.getGoal() );
+ buffer.mojo( me.getArtifactId() + ':' + me.getVersion() + ':' + me.getGoal() );
if ( me.getExecutionId() != null )
{
- buffer.append( " (" ).append( me.getExecutionId() ).append( ')' );
+ buffer.a( ' ' ).strong( '(' + me.getExecutionId() + ')' );
}
}
- private void appendForkInfo( StringBuilder buffer, MojoDescriptor md )
+ private void appendForkInfo( MessageBuilder buffer, MojoDescriptor md )
{
+ StringBuilder buff = new StringBuilder();
if ( StringUtils.isNotEmpty( md.getExecutePhase() ) )
{
// forked phase
if ( StringUtils.isNotEmpty( md.getExecuteLifecycle() ) )
{
- buffer.append( '[' );
- buffer.append( md.getExecuteLifecycle() );
- buffer.append( ']' );
+ buff.append( '[' );
+ buff.append( md.getExecuteLifecycle() );
+ buff.append( ']' );
}
- buffer.append( md.getExecutePhase() );
+ buff.append( md.getExecutePhase() );
}
else
{
// forked goal
- buffer.append( ':' );
- buffer.append( md.getExecuteGoal() );
+ buff.append( ':' );
+ buff.append( md.getExecuteGoal() );
}
+ buffer.strong( buff.toString() );
}
- private void append( StringBuilder buffer, MavenProject project )
+ private void append( MessageBuilder buffer, MavenProject project )
{
- buffer.append( " @ " ).append( project.getArtifactId() );
+ buffer.a( " @ " ).project( project.getArtifactId() );
}
@Override
@@ -367,13 +381,12 @@ public class ExecutionEventLogger
{
if ( logger.isInfoEnabled() && event.getMojoExecution().getForkedExecutions().size() > 1 )
{
- logger.info( chars( ' ', LINE_LENGTH ) );
- logger.info( chars( '>', LINE_LENGTH ) );
+ logger.info( "" );
+ infoLine( '>' );
- logger.info( "Forking " + event.getProject().getName() + " " + event.getProject().getVersion() );
+ infoMain( "Forking " + event.getProject().getName() + " " + event.getProject().getVersion() );
- logger.info( chars( '>', LINE_LENGTH ) );
+ infoLine( '>' );
}
}
-
}
http://git-wip-us.apache.org/repos/asf/maven/blob/b80915b8/maven-embedder/src/site/apt/index.apt.vm
----------------------------------------------------------------------
diff --git a/maven-embedder/src/site/apt/index.apt.vm b/maven-embedder/src/site/apt/index.apt.vm
index 519fdae..17220c9 100644
--- a/maven-embedder/src/site/apt/index.apt.vm
+++ b/maven-embedder/src/site/apt/index.apt.vm
@@ -40,3 +40,8 @@ ${project.name}
* <<<.mvn/maven.config>>> containing Maven command-line parameter,
* <<<.mvn/extensions.xml>>> containing {{{./core-extensions.html}a list of extensions}}.
+
+ * since 3.5.0, output is colorized by default, with color disabled in batch mode: see
+ {{{/shared/maven-shared-utils/apidocs/org/apache/maven/shared/utils/logging/package-summary.html}styled message API}}
+ for more details.
+
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/maven/blob/b80915b8/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 8ea9b29..f8b67aa 100644
--- a/pom.xml
+++ b/pom.xml
@@ -267,6 +267,16 @@
<version>${plexusInterpolationVersion}</version>
</dependency>
<dependency>
+ <groupId>org.apache.maven.shared</groupId>
+ <artifactId>maven-shared-utils</artifactId>
+ <version>3.1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.fusesource.jansi</groupId>
+ <artifactId>jansi</artifactId>
+ <version>1.13</version>
+ </dependency>
+ <dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4jVersion}</version>
[4/4] maven git commit: [MNG-5904] Remove the whole Ant build
Posted by hb...@apache.org.
[MNG-5904] Remove the whole Ant build
Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/8b661620
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/8b661620
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/8b661620
Branch: refs/heads/master
Commit: 8b661620521de63586f825257e9c08c37e251eb5
Parents: be5cacc
Author: Karl Heinz Marbaise <kh...@apache.org>
Authored: Fri Dec 11 19:41:02 2015 +0100
Committer: Herv� Boutemy <hb...@apache.org>
Committed: Tue Jan 24 18:40:07 2017 +0100
----------------------------------------------------------------------
README.md | 6 +-
apache-maven/README.txt | 2 +-
apache-maven/pom.xml | 55 +++-
apache-maven/src/main/assembly/bin.xml | 74 +-----
apache-maven/src/main/assembly/component.xml | 89 +++++++
apache-maven/src/main/assembly/dir.xml | 30 +++
apache-maven/src/main/assembly/src.xml | 3 +-
build.xml | 307 ----------------------
maven-ant-tasks-2.1.1.jar | Bin 1314262 -> 0 bytes
9 files changed, 184 insertions(+), 382 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven/blob/8b661620/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index a263dca..7a5ed4d 100644
--- a/README.md
+++ b/README.md
@@ -12,12 +12,12 @@ Maven is available under the [Apache License, Version 2.0](http://www.apache.org
If you want to bootstrap Maven, you'll need:
- Java 1.7+
-- Ant 1.8 or later
+- Maven 3.0.5 or later
-Run Ant, specifying a location into which the completed Maven distro should be installed:
+Run Maven, specifying a location into which the completed Maven distro should be installed:
```
-ant -Dmaven.home="$HOME/apps/maven/apache-maven-3.3.x-SNAPSHOT"
+mvn -DdistributionTargetDir="$HOME/app/maven/apache-maven-3.5.x-SNAPSHOT" clean package
```
Once the build completes, you should have a new Maven distro ready to roll in that directory!
http://git-wip-us.apache.org/repos/asf/maven/blob/8b661620/apache-maven/README.txt
----------------------------------------------------------------------
diff --git a/apache-maven/README.txt b/apache-maven/README.txt
index b05080d..cbaa7d4 100644
--- a/apache-maven/README.txt
+++ b/apache-maven/README.txt
@@ -16,7 +16,7 @@
Release Notes
-------------
- The full list of changes can be found at http://maven.apache.org/release-notes.html.
+ The full list of changes can be found at http://maven.apache.org/docs/history.html.
System Requirements
-------------------
http://git-wip-us.apache.org/repos/asf/maven/blob/8b661620/apache-maven/pom.xml
----------------------------------------------------------------------
diff --git a/apache-maven/pom.xml b/apache-maven/pom.xml
index 2db95cf..735e5b8 100644
--- a/apache-maven/pom.xml
+++ b/apache-maven/pom.xml
@@ -151,7 +151,7 @@
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
- <id>create-distro</id>
+ <id>create-distro-packages</id>
<phase>package</phase>
<goals>
<goal>single</goal>
@@ -182,6 +182,59 @@
<profiles>
<profile>
+ <id>create-distribution-in-dir</id>
+ <activation>
+ <property>
+ <name>distributionTargetDir</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-clean-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>clean</goal>
+ </goals>
+ <id>clean-target-dir</id>
+ <phase>prepare-package</phase>
+ <configuration>
+ <filesets>
+ <fileset>
+ <directory>${distributionTargetDir}</directory>
+ </fileset>
+ </filesets>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>create-distribution-dir</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <configuration>
+ <finalName>./</finalName>
+ <appendAssemblyId>false</appendAssemblyId>
+ <attach>false</attach>
+ <outputDirectory>${distributionTargetDir}</outputDirectory>
+ <descriptors>
+ <descriptor>src/main/assembly/dir.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
<id>apache-release</id>
<build>
<plugins>
http://git-wip-us.apache.org/repos/asf/maven/blob/8b661620/apache-maven/src/main/assembly/bin.xml
----------------------------------------------------------------------
diff --git a/apache-maven/src/main/assembly/bin.xml b/apache-maven/src/main/assembly/bin.xml
index ea14a9d..79723c2 100644
--- a/apache-maven/src/main/assembly/bin.xml
+++ b/apache-maven/src/main/assembly/bin.xml
@@ -17,78 +17,14 @@ specific language governing permissions and limitations
under the License.
-->
-<assembly>
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
<id>bin</id>
<formats>
<format>zip</format>
<format>tar.gz</format>
</formats>
- <dependencySets>
- <dependencySet>
- <useProjectArtifact>false</useProjectArtifact>
- <outputDirectory>boot</outputDirectory>
- <includes>
- <include>org.codehaus.plexus:plexus-classworlds</include>
- </includes>
- </dependencySet>
- <dependencySet>
- <useProjectArtifact>false</useProjectArtifact>
- <outputDirectory>lib</outputDirectory>
- <excludes>
- <exclude>org.codehaus.plexus:plexus-classworlds</exclude>
- </excludes>
- </dependencySet>
- </dependencySets>
- <fileSets>
- <fileSet>
- <includes>
- <include>README*</include>
- </includes>
- </fileSet>
- <fileSet>
- <directory>target/maven-shared-archive-resources/META-INF</directory>
- <outputDirectory>/</outputDirectory>
- <includes>
- <include>LICENSE</include>
- <include>NOTICE</include>
- </includes>
- </fileSet>
- <fileSet>
- <directory>target/licenses/lib</directory>
- <outputDirectory>lib</outputDirectory>
- <includes>
- <include>**</include>
- </includes>
- </fileSet>
- <fileSet>
- <directory>src/bin</directory>
- <outputDirectory>bin</outputDirectory>
- <includes>
- <include>*.cmd</include>
- <include>*.conf</include>
- </includes>
- <lineEnding>dos</lineEnding>
- </fileSet>
- <fileSet>
- <directory>src/bin</directory>
- <outputDirectory>bin</outputDirectory>
- <includes>
- <include>m2</include>
- <include>mvn</include>
- <include>mvnDebug</include>
- <!-- This is so that CI systems can periodically run the profiler -->
- <include>mvnyjp</include>
- </includes>
- <lineEnding>unix</lineEnding>
- <fileMode>0755</fileMode>
- </fileSet>
- <fileSet>
- <directory>src/conf</directory>
- <outputDirectory>conf</outputDirectory>
- </fileSet>
- <fileSet>
- <directory>src/lib</directory>
- <outputDirectory>lib</outputDirectory>
- </fileSet>
- </fileSets>
+ <componentDescriptors>
+ <componentDescriptor>src/main/assembly/component.xml</componentDescriptor>
+ </componentDescriptors>
</assembly>
http://git-wip-us.apache.org/repos/asf/maven/blob/8b661620/apache-maven/src/main/assembly/component.xml
----------------------------------------------------------------------
diff --git a/apache-maven/src/main/assembly/component.xml b/apache-maven/src/main/assembly/component.xml
new file mode 100644
index 0000000..8ccf02a
--- /dev/null
+++ b/apache-maven/src/main/assembly/component.xml
@@ -0,0 +1,89 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<component xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/component/1.1.3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/component/1.1.3 http://maven.apache.org/xsd/component-1.1.3.xsd">
+ <dependencySets>
+ <dependencySet>
+ <useProjectArtifact>false</useProjectArtifact>
+ <outputDirectory>boot</outputDirectory>
+ <includes>
+ <include>org.codehaus.plexus:plexus-classworlds</include>
+ </includes>
+ </dependencySet>
+ <dependencySet>
+ <useProjectArtifact>false</useProjectArtifact>
+ <outputDirectory>lib</outputDirectory>
+ <excludes>
+ <exclude>org.codehaus.plexus:plexus-classworlds</exclude>
+ </excludes>
+ </dependencySet>
+ </dependencySets>
+ <fileSets>
+ <fileSet>
+ <includes>
+ <include>README*</include>
+ </includes>
+ </fileSet>
+ <fileSet>
+ <directory>target/maven-shared-archive-resources/META-INF</directory>
+ <outputDirectory>./</outputDirectory>
+ <includes>
+ <include>LICENSE</include>
+ <include>NOTICE</include>
+ </includes>
+ </fileSet>
+ <fileSet>
+ <directory>target/licenses/lib</directory>
+ <outputDirectory>lib</outputDirectory>
+ <includes>
+ <include>**</include>
+ </includes>
+ </fileSet>
+ <fileSet>
+ <directory>src/bin</directory>
+ <outputDirectory>bin</outputDirectory>
+ <includes>
+ <include>*.cmd</include>
+ <include>*.conf</include>
+ </includes>
+ <lineEnding>dos</lineEnding>
+ </fileSet>
+ <fileSet>
+ <directory>src/bin</directory>
+ <outputDirectory>bin</outputDirectory>
+ <includes>
+ <include>m2</include>
+ <include>mvn</include>
+ <include>mvnDebug</include>
+ <!-- This is so that CI systems can periodically run the profiler -->
+ <include>mvnyjp</include>
+ </includes>
+ <lineEnding>unix</lineEnding>
+ <fileMode>0755</fileMode>
+ </fileSet>
+ <fileSet>
+ <directory>src/conf</directory>
+ <outputDirectory>conf</outputDirectory>
+ </fileSet>
+ <fileSet>
+ <directory>src/lib</directory>
+ <outputDirectory>lib</outputDirectory>
+ </fileSet>
+ </fileSets>
+</component>
http://git-wip-us.apache.org/repos/asf/maven/blob/8b661620/apache-maven/src/main/assembly/dir.xml
----------------------------------------------------------------------
diff --git a/apache-maven/src/main/assembly/dir.xml b/apache-maven/src/main/assembly/dir.xml
new file mode 100644
index 0000000..0d2b887
--- /dev/null
+++ b/apache-maven/src/main/assembly/dir.xml
@@ -0,0 +1,30 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
+ <id>dir</id>
+ <formats>
+ <format>dir</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <componentDescriptors>
+ <componentDescriptor>src/main/assembly/component.xml</componentDescriptor>
+ </componentDescriptors>
+</assembly>
http://git-wip-us.apache.org/repos/asf/maven/blob/8b661620/apache-maven/src/main/assembly/src.xml
----------------------------------------------------------------------
diff --git a/apache-maven/src/main/assembly/src.xml b/apache-maven/src/main/assembly/src.xml
index 3bf10e0..fb0aee8 100644
--- a/apache-maven/src/main/assembly/src.xml
+++ b/apache-maven/src/main/assembly/src.xml
@@ -17,7 +17,8 @@ specific language governing permissions and limitations
under the License.
-->
-<assembly>
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
<id>src</id>
<formats>
<format>zip</format>
http://git-wip-us.apache.org/repos/asf/maven/blob/8b661620/build.xml
----------------------------------------------------------------------
diff --git a/build.xml b/build.xml
deleted file mode 100644
index ccfca3b..0000000
--- a/build.xml
+++ /dev/null
@@ -1,307 +0,0 @@
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<!-- START SNIPPET: ant-bootstrap
-
-By default the bootstrap will use ~/.m2/repository as the integration repository but you can define the integration
-repository by specifying a property on the command line:
-
-ant -Dmaven.repo.local=/my/integration/repository
-
-Those familiar with Maven will note this is the same way the local repository can be set from the command-line.
-This facilitates having a set of builds converge on the same repository for integration purposes.
-
-END SNIPPET: ant-bootstrap -->
-
-<project default="all" basedir="." xmlns:artifact="urn:maven-artifact-ant">
-
- <property name="distributionDirectory" value="apache-maven"/>
- <property name="distributionId" value="apache-maven"/>
- <property name="distributionShortName" value="Maven"/>
- <property name="distributionName" value="Apache Maven"/>
- <property name="it.workdir.version" value="3.0.x" />
- <property name="maven-compile.jvmargs" value="-Xmx512m -Xms512m"/>
- <property name="maven-compile.fork" value="true"/>
- <property name="maven-compile.maxmemory" value="512m"/>
-
- <target name="initTaskDefs">
- <echo>Building ${distributionName} ...</echo>
- <xmlproperty file="pom.xml" prefix="xmlPom" />
- <path id="maven-ant-tasks.classpath" path="maven-ant-tasks-2.1.1.jar" />
- <typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-artifact-ant" classpathref="maven-ant-tasks.classpath" />
- </target>
-
- <target name="isMavenHomeSet" depends="initTaskDefs">
- <property environment="env" />
- <condition property="maven.home" value="${env.M2_HOME}">
- <isset property="env.M2_HOME" />
- </condition>
- <fail message="You must set the M2_HOME environment variable or specify a maven.home property to this Ant script">
- <condition>
- <or>
- <not>
- <isset property="maven.home" />
- </not>
- <equals arg1="${maven.home}" arg2="" trim="true" />
- </or>
- </condition>
- </fail>
- <available property="maven.home.exists" file="${maven.home}" />
- </target>
-
- <target name="prompt-maven-home-exists" depends="isMavenHomeSet" if="maven.home.exists">
- <input addproperty="maven.home.exists.continue" validargs="yes,no" defaultvalue="no">WARNING:
-The specified target directory
- ${maven.home}
-already exists. It will be deleted and overwritten by the build.
-Do you want to continue?</input>
- <fail message="Build was aborted by user">
- <condition>
- <equals arg1="${maven.home.exists.continue}" arg2="no" trim="true" casesensitive="false" />
- </condition>
- </fail>
- </target>
-
- <target name="init" depends="isMavenHomeSet">
- <!-- Initialize properties -->
- <property name="maven.home.basename.expected" value="${distributionId}-${xmlPom.project.version}" />
- <property name="maven.assembly" location="${distributionDirectory}/target/${maven.home.basename.expected}-bin.zip" />
- <property name="maven.repo.local" value="${user.home}/.m2/repository" />
- <property name="maven.debug" value="-e" />
- <property name="maven.test.skip" value="false" />
- <property name="skipTests" value="false" />
- <property name="surefire.useFile" value="true" />
- <property name="maven.test.redirectTestOutputToFile" value="${surefire.useFile}" />
- <property name="maven.goal" value="install" />
- <echo>maven.home = ${maven.home}</echo>
- <echo>maven.repo.local = ${maven.repo.local}</echo>
- <echo>distributionId = ${distributionId}</echo>
- <echo>distributionName = ${distributionName}</echo>
- <echo>distributionDirectory = ${distributionDirectory}</echo>
- </target>
-
- <target name="clean-bootstrap" description="cleans up generated bootstrap classes">
- <delete dir="bootstrap" />
- </target>
-
- <target name="pull" depends="init" unless="skip.pull">
- <!-- Pull the dependencies that Maven needs to build -->
- <copy file="pom.xml" tofile="dependencies.xml" />
- <replace file="${basedir}/dependencies.xml" token="<!--bootstrap-start-comment-->" value="<!--" />
- <replace file="${basedir}/dependencies.xml" token="<!--bootstrap-end-comment-->" value="-->" />
- <artifact:pom file="${basedir}/dependencies.xml" id="pom">
- <localRepository path="${maven.repo.local}" />
- </artifact:pom>
- <artifact:dependencies pathId="pom.pathid" filesetId="pom.fileset" useScope="compile">
- <localRepository path="${maven.repo.local}" />
- <pom refid="pom" />
- </artifact:dependencies>
- <delete file="${basedir}/dependencies.xml" />
-
- <!-- Pull the dependencies for Modello -->
- <artifact:dependencies pathId="modello.pathid" filesetId="modello.fileset">
- <localRepository path="${maven.repo.local}" />
- <dependency groupId="org.codehaus.modello" artifactId="modello-maven-plugin" version="${pom.properties.modelloVersion}" />
- </artifact:dependencies>
-
- <!-- Pull the dependencies for the MetadataGenerator CLI -->
- <artifact:dependencies pathId="pmdg.pathid" filesetId="pmdg.fileset">
- <localRepository path="${maven.repo.local}" />
- <dependency groupId="org.codehaus.plexus" artifactId="plexus-component-metadata" version="${pom.properties.plexusVersion}" />
- </artifact:dependencies>
-
- </target>
-
- <target name="process-classes" depends="pull" description="generates plexus component metadata.">
- <mkdir dir="${basedir}/bootstrap/target" />
- <mkdir dir="${basedir}/bootstrap/target/classes" />
-
- <path id="pmdg.classpath">
- <path refid="maven.classpath" />
- <path refid="pmdg.pathid" />
- </path>
-
- <echo>Using plexus version ${pom.properties.plexusVersion}</echo>
- <java fork="true" classname="org.codehaus.plexus.metadata.PlexusMetadataGeneratorCli" failonerror="true">
- <classpath refid="pmdg.classpath" />
- <!-- We need to generate component descriptors from the maven-artifact sources which use javadoc annotations. -->
- <arg value="--source" />
- <arg value="${basedir}/maven-compat/src/main/java" />
- <!-- We have separated the artifact handlers and lifecycle mappings into a separate file. -->
- <arg value="--descriptors" />
- <arg value="${basedir}/maven-core/src/main/resources/META-INF/plexus" />
- <!-- Search the classes for annotations that we've compiled. -->
- <arg value="--classes" />
- <arg value="${basedir}/bootstrap/target/classes" />
- <!-- We'll make one big fat components descriptor. -->
- <arg value="--output" />
- <arg value="${basedir}/bootstrap/target/classes/META-INF/plexus/components.xml" />
- </java>
- </target>
-
- <target name="generate-sources" depends="pull" description="generates Java sources from Modello mdo model files">
- <mkdir dir="bootstrap/target" />
- <mkdir dir="bootstrap/target/generated-sources" />
-
- <macrodef name="modello-single-mode">
- <attribute name="file" />
- <attribute name="mode" />
- <attribute name="version" />
- <sequential>
- <java fork="true" classname="org.codehaus.modello.ModelloCli" failonerror="true">
- <classpath refid="modello.pathid" />
- <arg file="@{file}" />
- <!-- model file -->
- <arg value="@{mode}" />
- <!-- output type -->
- <arg file="bootstrap/target/generated-sources" />
- <!-- output directory -->
- <arg value="@{version}" />
- <!-- model version -->
- <arg value="false" />
- <!-- package with version -->
- <arg value="true" />
- <!-- use Java 5 -->
- <arg value="UTF-8" />
- <!-- encoding -->
- </java>
- </sequential>
- </macrodef>
-
- <macrodef name="modello">
- <attribute name="file" />
- <attribute name="version" default="1.0.0" />
- <sequential>
- <echo taskname="modello" message="Generating sources for @{file}" />
- <modello-single-mode file="@{file}" version="@{version}" mode="java" />
- <modello-single-mode file="@{file}" version="@{version}" mode="xpp3-reader" />
- <modello-single-mode file="@{file}" version="@{version}" mode="xpp3-writer" />
- </sequential>
- </macrodef>
-
- <macrodef name="modello-ex">
- <attribute name="file" />
- <attribute name="version" default="1.0.0" />
- <sequential>
- <modello file="@{file}" version="@{version}" />
- <modello-single-mode file="@{file}" version="@{version}" mode="xpp3-extended-reader" />
- </sequential>
- </macrodef>
-
- <modello-ex file="maven-model/src/main/mdo/maven.mdo" version="4.0.0" />
- <modello file="maven-plugin-api/src/main/mdo/lifecycle.mdo" />
- <modello file="maven-model-builder/src/main/mdo/profiles.mdo" />
- <modello file="maven-settings/src/main/mdo/settings.mdo" version="1.1.0" />
- <modello file="maven-core/src/main/mdo/toolchains.mdo" version="1.1.0" />
- <modello file="maven-repository-metadata/src/main/mdo/metadata.mdo" version="1.1.0" />
- <modello file="maven-compat/src/main/mdo/profiles.mdo" />
- <modello file="maven-compat/src/main/mdo/paramdoc.mdo" />
- <modello file="maven-embedder/src/main/mdo/core-extensions.mdo" />
- </target>
-
- <target name="compile-boot" depends="generate-sources" description="compiles the bootstrap sources">
- <path id="sources">
- <dirset dir=".">
- <include name="bootstrap/target/generated-sources" />
- <include name="*/src/main/java" />
- </dirset>
- </path>
-
- <mkdir dir="bootstrap/target/classes" />
- <javac destdir="bootstrap/target/classes" encoding="UTF-8" source="1.7" target="1.7" debug="true" includeAntRuntime="false">
- <src refid="sources" />
- <classpath refid="pom.pathid" />
- </javac>
-
- <copy todir="bootstrap/target/classes" encoding="ISO-8859-1">
- <fileset dir="maven-core/src/main/resources">
- <include name="**/build.properties" />
- </fileset>
- <filterset begintoken="${" endtoken="}">
- <filter token="project.version" value="${xmlPom.project.version}"/>
- </filterset>
- </copy>
- <echo file="bootstrap/target/classes/META-INF/maven/org.apache.maven/maven-core/pom.properties" encoding="ISO-8859-1">
- version = ${xmlPom.project.version}
- </echo>
-
- <path id="maven.classpath">
- <pathelement location="bootstrap/target/classes" />
- <dirset dir=".">
- <include name="*/src/main/resources" />
- </dirset>
- <path refid="pom.pathid" />
- </path>
- </target>
-
- <target name="maven-compile" depends="compile-boot,process-classes" description="compiles Maven using the bootstrap Maven, skipping automated tests">
- <java fork="${maven-compile.fork}" classname="org.apache.maven.cli.MavenCli" failonerror="true" timeout="600000" maxmemory="${maven-compile.maxmemory}">
- <!--jvmarg line="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000"/-->
- <!--jvmarg value="${maven-compile.jvmargs}"/-->
- <classpath refid="maven.classpath" />
- <arg value="${maven.debug}" />
- <arg value="-B" />
- <arg value="-V" />
- <arg value="clean" />
- <arg value="${maven.goal}" />
- <arg value="-Dmaven.test.skip=${maven.test.skip}" />
- <arg value="-DskipTests=${skipTests}" />
- <arg value="-Dmaven.repo.local=${maven.repo.local}" />
- <arg value="-Dsurefire.useFile=${surefire.useFile}" />
- <arg value="-Dmaven.test.redirectTestOutputToFile=${maven.test.redirectTestOutputToFile}" />
- <arg value="-DdistributionId=${distributionId}" />
- <arg value="-DdistributionShortName=${distributionShortName}" />
- <arg value="-DdistributionName=${distributionName}" />
- <jvmarg value="-Dmaven.multiModuleProjectDirectory=${basedir}" />
- </java>
- </target>
-
- <target name="maven-assembly" depends="maven-compile" description="generates the Maven installation assembly using the bootstrap Maven">
- <echo>
-The new Maven distribution was created as part of the MAVEN-COMPILE step, above.
-This goal just validates the presence of that distribution.
-</echo>
- <condition property="build.failed">
- <not>
- <available file="${maven.assembly}" />
- </not>
- </condition>
- <fail if="build.failed" message="Assembly task seemed to succeed, but couldn't find assembly file: ${maven.assembly}" />
- </target>
-
- <target name="extract-assembly" depends="init,prompt-maven-home-exists,maven-assembly" description="extracts the maven assembly into maven.home">
- <echo>Extracting assembly to ${maven.home} ...</echo>
- <!-- If we are starting from scratch make sure the directory is created -->
- <delete dir="${maven.home}" />
- <mkdir dir="${maven.home}" />
- <unzip src="${maven.assembly}" dest="${maven.home}">
- <mapper type="regexp" from="^[^\\/]+[\\/](.*)$$" to="\1" />
- </unzip>
- <chmod perm="+x">
- <fileset dir="${maven.home}/bin">
- <include name="mvn" />
- <include name="mvnDebug" />
- <include name="mvnyjp" />
- </fileset>
- </chmod>
- </target>
-
- <target name="all" depends="clean-bootstrap,init,extract-assembly" />
-
-</project>
http://git-wip-us.apache.org/repos/asf/maven/blob/8b661620/maven-ant-tasks-2.1.1.jar
----------------------------------------------------------------------
diff --git a/maven-ant-tasks-2.1.1.jar b/maven-ant-tasks-2.1.1.jar
deleted file mode 100644
index 7810a54..0000000
Binary files a/maven-ant-tasks-2.1.1.jar and /dev/null differ