Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
dantran committed Nov 22, 2016
2 parents 582ca65 + 8ae1a3e commit 6755560
Show file tree
Hide file tree
Showing 175 changed files with 1,480 additions and 1,190 deletions.
4 changes: 2 additions & 2 deletions apache-maven/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ under the License.
<artifactId>aether-transport-wagon</artifactId>
</dependency>
<dependency>
<groupId>com.planet57.gossip</groupId>
<artifactId>gossip-slf4j</artifactId>
<groupId>org.apache.maven</groupId>
<artifactId>maven-slf4j-provider</artifactId>
</dependency>
<dependency>
<groupId>org.fusesource.jansi</groupId>
Expand Down
4 changes: 2 additions & 2 deletions apache-maven/src/bin/m2.conf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
main is org.apache.maven.cli.MavenCli from plexus.core

set maven.home default ${user.home}/m2
set maven.conf default ${maven.home}/conf

[plexus.core]
load ${maven.home}/conf/logging
load ${maven.conf}/logging
optionally ${maven.home}/lib/ext/*.jar
load ${maven.home}/lib/*.jar
32 changes: 30 additions & 2 deletions apache-maven/src/bin/mvn
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ fi
# first directory with .mvn subdirectory is considered project base directory
find_maven_basedir() {
(
basedir="`pwd`"
basedir=`find_file_argument_basedir "$@"`
wdir="`pwd`"
while [ "$wdir" != '/' ] ; do
if [ -d "$wdir"/.mvn ] ; then
Expand All @@ -134,14 +134,41 @@ find_maven_basedir() {
)
}

find_file_argument_basedir() {
(
basedir="`pwd`"

found_file_switch=0
for arg in "$@"; do
if [ ${found_file_switch} -eq 1 ]; then
if [ -f ${arg} ]; then
basedir=$(dirname $(readlink -f "${arg}"))
if [ ! -d ${basedir} ]; then
echo "Directory ${basedir} extracted from the -f/--file command-line argument ${arg} does not exist" >&2
exit 1
fi
else
echo "POM file ${arg} specified with the -f/--file command line argument does not exist" >&2
exit 1
fi
break
fi
if [ "$arg" = "-f" -o "$arg" = "--file" ]; then
found_file_switch=1
fi
done
echo "${basedir}"
)
}

# concatenates all lines of a file
concat_lines() {
if [ -f "$1" ]; then
echo "`tr -s '\n' ' ' < "$1"`"
fi
}

MAVEN_PROJECTBASEDIR="${MAVEN_BASEDIR:-`find_maven_basedir`}"
MAVEN_PROJECTBASEDIR="${MAVEN_BASEDIR:-`find_maven_basedir "$@"`}"
MAVEN_OPTS="`concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config"` $MAVEN_OPTS"

# For Cygwin, switch project base directory path to Windows format before
Expand All @@ -164,4 +191,5 @@ exec "$JAVACMD" \
-classpath "${CLASSWORLDS_JAR}" \
"-Dclassworlds.conf=${MAVEN_HOME}/bin/m2.conf" \
"-Dmaven.home=${MAVEN_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
"-Dlibrary.jansi.path=${MAVEN_HOME}/lib" \
${CLASSWORLDS_LAUNCHER} "$@"
59 changes: 55 additions & 4 deletions apache-maven/src/bin/mvn.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -86,19 +86,69 @@ set MAVEN_CMD_LINE_ARGS=%*
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
if not "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir

set "EXEC_DIR=%CD%"
set "WDIR=%EXEC_DIR%"
set EXEC_DIR=%CD%
set WDIR=%EXEC_DIR%

@REM Look for the --file switch and start the search for the .mvn directory from the specified
@REM POM location, if supplied.

set FILE_ARG=
:arg_loop
if "%~1" == "-f" (
set "FILE_ARG=%~2"
shift
goto process_file_arg
)
if "%~1" == "--file" (
set "FILE_ARG=%~2"
shift
goto process_file_arg
)
@REM If none of the above, skip the argument
shift
if not "%~1" == "" (
goto arg_loop
) else (
goto findBaseDir
)

:process_file_arg
if "%FILE_ARG%" == "" (
goto findBaseDir
)
if not exist "%FILE_ARG%" (
echo POM file %FILE_ARG% specified the -f/--file command-line argument does not exist >&2
goto error
)
call :get_directory_from_file %FILE_ARG%
if not exist "%POM_DIR%" (
echo Directory %POM_DIR% extracted from the -f/--file command-line argument %FILE_ARG% does not exist >&2
goto error
)
set WDIR=%POM_DIR%
goto findBaseDir

:get_directory_from_file
set "POM_DIR=%~dp1"
:stripPomDir
if not "_%POM_DIR:~-1%"=="_\" goto pomDirStripped
set "POM_DIR=%POM_DIR:~0,-1%"
goto stripPomDir
:pomDirStripped
exit /b

:findBaseDir
cd /d %WDIR%
:findBaseDirLoop
if exist "%WDIR%\.mvn" goto baseDirFound
cd ..
if "%WDIR%"=="%CD%" goto baseDirNotFound
set "WDIR=%CD%"
goto findBaseDir
goto findBaseDirLoop

:baseDirFound
set "MAVEN_PROJECTBASEDIR=%WDIR%"
cd "%EXEC_DIR%"
cd /d "%EXEC_DIR%"
goto endDetectBaseDir

:baseDirNotFound
Expand Down Expand Up @@ -128,6 +178,7 @@ for %%i in ("%MAVEN_HOME%"\boot\plexus-classworlds-*) do set CLASSWORLDS_JAR="%%
"-Dclassworlds.conf=%MAVEN_HOME%\bin\m2.conf" ^
"-Dmaven.home=%MAVEN_HOME%" ^
"-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^
"-Dlibrary.jansi.path=%MAVEN_HOME%\lib" ^
%CLASSWORLDS_LAUNCHER% %MAVEN_CMD_LINE_ARGS%
if ERRORLEVEL 1 goto error
goto end
Expand Down
44 changes: 1 addition & 43 deletions apache-maven/src/conf/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ under the License.
| 2. Global Level. This settings.xml file provides configuration for all Maven
| users on a machine (assuming they're all using the same Maven
| installation). It's normally provided in
| ${maven.home}/conf/settings.xml.
| ${maven.conf}/settings.xml.
|
| NOTE: This location can be overridden with the CLI option:
|
Expand Down Expand Up @@ -244,47 +244,6 @@ under the License.
</properties>
</profile>
-->

<!--
| Default profile holding various defaults.
|-->
<profile>
<!--
This intentionally uses a UUID to not clash with any profile
id already in use before this profile got added to the settings.
-->
<id>f06abaa7-178e-441e-bb0d-10a92d7ce014</id>

<repositories>
<repository>
<id>central</id>
<name>Central Repository</name>
<url>https://repo.maven.apache.org/maven2</url>
<layout>default</layout>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<updatePolicy>never</updatePolicy>
</releases>
</repository>
</repositories>

<pluginRepositories>
<pluginRepository>
<id>central</id>
<name>Central Repository</name>
<url>https://repo.maven.apache.org/maven2</url>
<layout>default</layout>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<updatePolicy>never</updatePolicy>
</releases>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>

<!-- activeProfiles
Expand All @@ -295,7 +254,6 @@ under the License.
<activeProfile>alwaysActiveProfile</activeProfile>
<activeProfile>anotherAlwaysActiveProfile</activeProfile>
-->
<activeProfile>f06abaa7-178e-441e-bb0d-10a92d7ce014</activeProfile>
</activeProfiles>

</settings>
42 changes: 21 additions & 21 deletions apache-maven/src/conf/toolchains.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ under the License.
| 2. Global Level. This toolchains.xml file provides configuration for all Maven
| users on a machine (assuming they're all using the same Maven
| installation). It's normally provided in
| ${maven.home}/conf/toolchains.xml.
| ${maven.conf}/toolchains.xml.
|
| NOTE: This location can be overridden with the CLI option:
|
Expand All @@ -44,37 +44,37 @@ under the License.
<toolchains xmlns="http://maven.apache.org/TOOLCHAINS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/TOOLCHAINS/1.1.0 http://maven.apache.org/xsd/toolchains-1.1.0.xsd">

<!--
| With toolchains you can refer to installations on your system. This
| way you don't have to hardcode paths in your pom.xml.
|
| Every toolchain consist of 3 elements:
| * type: the type of tool. An often used value is 'jdk'. Toolchains-aware
| plugins should document which type you must use.
|
| * provides: A list of key/value-pairs.
| Based on the toolchain-configuration in the pom.xml Maven will search for
| matching <provides/> configuration. You can decide for yourself which key-value
| pairs to use. Often used keys are 'version', 'vendor' and 'arch'. By default
| the version has a special meaning. If you configured in the pom.xml '1.5'
<!--
| With toolchains you can refer to installations on your system. This
| way you don't have to hardcode paths in your pom.xml.
|
| Every toolchain consist of 3 elements:
| * type: the type of tool. An often used value is 'jdk'. Toolchains-aware
| plugins should document which type you must use.
|
| * provides: A list of key/value-pairs.
| Based on the toolchain-configuration in the pom.xml Maven will search for
| matching <provides/> configuration. You can decide for yourself which key-value
| pairs to use. Often used keys are 'version', 'vendor' and 'arch'. By default
| the version has a special meaning. If you configured in the pom.xml '1.5'
| Maven will search for 1.5 and above.
|
|
| * configuration: Additional configuration for this tool.
| Look for documentation of the toolchains-aware plugin which configuration elements
| can be used.
| can be used.
|
| See also https://maven.apache.org/guides/mini/guide-using-toolchains.html
|
| General example
<toolchain>
<type/>
<provides>
<version>1.0</version>
</provides>
<provides>
<version>1.0</version>
</provides>
<configuration/>
</toolchain>
| JDK examples
<toolchain>
Expand All @@ -97,7 +97,7 @@ under the License.
<jdkHome>/path/to/jdk/1.6</jdkHome>
</configuration>
</toolchain>
-->

</toolchains>
10 changes: 5 additions & 5 deletions apache-maven/src/main/appended-resources/META-INF/LICENSE.vm
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@
## under the License.
##

Apache Maven includes a number of components and libraries with separate
copyright notices and license terms. Your use of those components are
subject to the terms and conditions of the following licenses.
Apache Maven includes a number of components and libraries with separate
copyright notices and license terms. Your use of those components are
subject to the terms and conditions of the following licenses.

#set ( $apacheTxt = "The Apache Software License, Version 2.0" )

#foreach ( $project in $projects )
#foreach ( $license in $project.licenses)
#if ( ! ($apacheTxt == $license.name) )
#if ( ! ($apacheTxt == $license.name) )
#set ( $artId = $project.artifact.artifactId)
#set ( $lf = $locator )
#set ( $url = $license.url )
## glass fish URL is now invalid, use a fixed one
#if ($url == "https://glassfish.dev.java.net/public/CDDLv1.0.html")
#set ( $url = 'https://glassfish.java.net/public/CDDLv1.0.html' )
#end
#if ($url)
#if ($url)
#set ( $licFile = 'lib/' + $artId + '.license' )
#set ( $downloaded = $lf.getResourceAsFile($url, "licenses/${licFile}") )
#end
Expand Down
1 change: 0 additions & 1 deletion apache-maven/src/main/assembly/component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ under the License.
<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 -->
Expand Down
6 changes: 6 additions & 0 deletions doap_Maven.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,12 @@ under the License.
<browse rdf:resource="https://git-wip-us.apache.org/repos/asf/maven.git"/>
</GitRepository>
</repository>
<repository>
<GitRepository>
<location rdf:resource="https://git-wip-us.apache.org/repos/asf/maven-integration-testing.git"/>
<browse rdf:resource="https://git-wip-us.apache.org/repos/asf/maven-integration-testing.git"/>
</GitRepository>
</repository>
<maintainer>
<foaf:Person>
<foaf:name>Apache Maven PMC</foaf:name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

/**
* Populates Aether {@link ArtifactDescriptorResult} from Maven project {@link Model}.
*
*
* @since 3.2.4
* @provisional This class is part of work in progress and can be changed or removed without notice.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
* under the License.
*/

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.Properties;

import org.eclipse.aether.DefaultRepositorySystemSession;
Expand Down Expand Up @@ -130,22 +127,14 @@ public static DefaultRepositorySystemSession newSession()

session.setArtifactDescriptorPolicy( new SimpleArtifactDescriptorPolicy( true, true ) );

// MNG-5670 guard against ConcurrentModificationException
// MNG-6053 guard against key without value
final Properties systemProperties = new Properties();
// This relies on the fact that load/store are synchronized internally.
try ( final ByteArrayOutputStream out = new ByteArrayOutputStream() )
{
System.getProperties().store( out, null );

try ( final ByteArrayInputStream in = new ByteArrayInputStream( out.toByteArray() ) )
{
systemProperties.load( in );
}
}
catch ( final IOException e )
// MNG-5670 guard against ConcurrentModificationException
// MNG-6053 guard against key without value
Properties sysProp = System.getProperties();
synchronized ( sysProp )
{
throw new AssertionError( "Unexpected IO error copying system properties.", e );
systemProperties.putAll( sysProp );
}

session.setSystemProperties( systemProperties );
Expand Down
Loading

0 comments on commit 6755560

Please sign in to comment.