Author: jdcasey
Date: Tue Sep 13 20:40:17 2005
New Revision: 280755
URL: http://svn.apache.org/viewcvs?rev=280755&view=rev
Log:
Re-resolving: MNG-757
o Added it0068 to guard against regressions of the type causing MNG-836
o Added it2001, which must be run manually, to verify the test case laid out in
MNG-757
o Reinstated the repository accumulation for successive traversal down the
transitivity chain, so that transitively resolved artifacts can be found in
repositories declared by POMs up the chain.
o Added a check for 'file:' at the beginning of the
Settings.getLocalRepository() result, before prepending 'file://' to allow for
relative definition of the local repository in test cases
Added:
maven/components/trunk/maven-core-it/it0068/
maven/components/trunk/maven-core-it/it0068/expected-results.txt (with
props)
maven/components/trunk/maven-core-it/it0068/goals.txt (with props)
maven/components/trunk/maven-core-it/it0068/pom.xml (with props)
maven/components/trunk/maven-core-it/it0068/prebuild-hook.txt (with props)
maven/components/trunk/maven-core-it/it0068/test.mdo (with props)
maven/components/trunk/maven-core-it/it2001/
maven/components/trunk/maven-core-it/it2001/a/
maven/components/trunk/maven-core-it/it2001/a/pom.xml (with props)
maven/components/trunk/maven-core-it/it2001/a/src/
maven/components/trunk/maven-core-it/it2001/a/src/main/
maven/components/trunk/maven-core-it/it2001/a/src/main/java/
maven/components/trunk/maven-core-it/it2001/a/src/main/java/org/
maven/components/trunk/maven-core-it/it2001/a/src/main/java/org/apache/
maven/components/trunk/maven-core-it/it2001/a/src/main/java/org/apache/maven/
maven/components/trunk/maven-core-it/it2001/a/src/main/java/org/apache/maven/it2001/
maven/components/trunk/maven-core-it/it2001/a/src/main/java/org/apache/maven/it2001/a/
maven/components/trunk/maven-core-it/it2001/a/src/main/java/org/apache/maven/it2001/a/Client.java
(with props)
maven/components/trunk/maven-core-it/it2001/b/
maven/components/trunk/maven-core-it/it2001/b/pom.xml (with props)
maven/components/trunk/maven-core-it/it2001/b/src/
maven/components/trunk/maven-core-it/it2001/b/src/main/
maven/components/trunk/maven-core-it/it2001/b/src/main/java/
maven/components/trunk/maven-core-it/it2001/b/src/main/java/org/
maven/components/trunk/maven-core-it/it2001/b/src/main/java/org/apache/
maven/components/trunk/maven-core-it/it2001/b/src/main/java/org/apache/maven/
maven/components/trunk/maven-core-it/it2001/b/src/main/java/org/apache/maven/it2001/
maven/components/trunk/maven-core-it/it2001/b/src/main/java/org/apache/maven/it2001/b/
maven/components/trunk/maven-core-it/it2001/b/src/main/java/org/apache/maven/it2001/b/Layer.java
(with props)
maven/components/trunk/maven-core-it/it2001/c/
maven/components/trunk/maven-core-it/it2001/c/pom.xml (with props)
maven/components/trunk/maven-core-it/it2001/c/src/
maven/components/trunk/maven-core-it/it2001/c/src/main/
maven/components/trunk/maven-core-it/it2001/c/src/main/java/
maven/components/trunk/maven-core-it/it2001/c/src/main/java/org/
maven/components/trunk/maven-core-it/it2001/c/src/main/java/org/apache/
maven/components/trunk/maven-core-it/it2001/c/src/main/java/org/apache/maven/
maven/components/trunk/maven-core-it/it2001/c/src/main/java/org/apache/maven/it2001/
maven/components/trunk/maven-core-it/it2001/c/src/main/java/org/apache/maven/it2001/c/
maven/components/trunk/maven-core-it/it2001/c/src/main/java/org/apache/maven/it2001/c/Core.java
(with props)
maven/components/trunk/maven-core-it/it2001/settings.xml (with props)
maven/components/trunk/maven-core-it/it2001/test.sh (with props)
Modified:
maven/components/trunk/maven-core-it/README.txt
maven/components/trunk/maven-core/src/main/java/org/apache/maven/cli/MavenCli.java
maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java
Modified: maven/components/trunk/maven-core-it/README.txt
URL:
http://svn.apache.org/viewcvs/maven/components/trunk/maven-core-it/README.txt?rev=280755&r1=280754&r2=280755&view=diff
==============================================================================
--- maven/components/trunk/maven-core-it/README.txt (original)
+++ maven/components/trunk/maven-core-it/README.txt Tue Sep 13 20:40:17 2005
@@ -256,7 +256,7 @@
different lifecycle phases and/or goals on multiple projects within each test
directory in order to accomplish their aims.
-NOTE: Currently, there is no verification process...
+NOTE: Currently, there is no automatic verification process for these...
-------------------------------------------------------------------------------
it2000: Test resolution of plugin by prefix from the first plugin repository
in a list. This is accomplished by creating a local "remote" repo, and
@@ -265,4 +265,11 @@
pluginGroups for the build. This second build should pickup the
plugins.xml for the aforementioned plugin from the first repository
and execute. This should resolve MNG-592.
+
+it2001: Test that repositories are accumulated as the artifact resolution
+ process traverses successive layers of transitive dependencies, such
+ that transitive dependencies can be resolved from repositories defined
+ in the top-level pom.xml. See MNG-757.
+
-------------------------------------------------------------------------------
+
Added: maven/components/trunk/maven-core-it/it0068/expected-results.txt
URL:
http://svn.apache.org/viewcvs/maven/components/trunk/maven-core-it/it0068/expected-results.txt?rev=280755&view=auto
==============================================================================
--- maven/components/trunk/maven-core-it/it0068/expected-results.txt (added)
+++ maven/components/trunk/maven-core-it/it0068/expected-results.txt Tue Sep 13
20:40:17 2005
@@ -0,0 +1 @@
+target/generated-sources/org/apache/maven/settings/Settings.java
Propchange: maven/components/trunk/maven-core-it/it0068/expected-results.txt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/components/trunk/maven-core-it/it0068/expected-results.txt
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/components/trunk/maven-core-it/it0068/goals.txt
URL:
http://svn.apache.org/viewcvs/maven/components/trunk/maven-core-it/it0068/goals.txt?rev=280755&view=auto
==============================================================================
--- maven/components/trunk/maven-core-it/it0068/goals.txt (added)
+++ maven/components/trunk/maven-core-it/it0068/goals.txt Tue Sep 13 20:40:17
2005
@@ -0,0 +1 @@
+generate-sources
Propchange: maven/components/trunk/maven-core-it/it0068/goals.txt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/components/trunk/maven-core-it/it0068/goals.txt
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/components/trunk/maven-core-it/it0068/pom.xml
URL:
http://svn.apache.org/viewcvs/maven/components/trunk/maven-core-it/it0068/pom.xml?rev=280755&view=auto
==============================================================================
--- maven/components/trunk/maven-core-it/it0068/pom.xml (added)
+++ maven/components/trunk/maven-core-it/it0068/pom.xml Tue Sep 13 20:40:17 2005
@@ -0,0 +1,29 @@
+<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/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.maven.it</groupId>
+ <artifactId>maven-it0068</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <name>Maven it0068</name>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.modello</groupId>
+ <artifactId>modello-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>xpp3-writer</goal>
+ <goal>java</goal>
+ <goal>xpp3-reader</goal>
+ </goals>
+ <configuration>
+ <version>1.0.0</version>
+ <model>test.mdo</model>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Propchange: maven/components/trunk/maven-core-it/it0068/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/components/trunk/maven-core-it/it0068/pom.xml
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/components/trunk/maven-core-it/it0068/prebuild-hook.txt
URL:
http://svn.apache.org/viewcvs/maven/components/trunk/maven-core-it/it0068/prebuild-hook.txt?rev=280755&view=auto
==============================================================================
--- maven/components/trunk/maven-core-it/it0068/prebuild-hook.txt (added)
+++ maven/components/trunk/maven-core-it/it0068/prebuild-hook.txt Tue Sep 13
20:40:17 2005
@@ -0,0 +1 @@
+rm ${artifact:org.codehaus.modello:modello-core:1.0-alpha-3:jar}
Propchange: maven/components/trunk/maven-core-it/it0068/prebuild-hook.txt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/components/trunk/maven-core-it/it0068/prebuild-hook.txt
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/components/trunk/maven-core-it/it0068/test.mdo
URL:
http://svn.apache.org/viewcvs/maven/components/trunk/maven-core-it/it0068/test.mdo?rev=280755&view=auto
==============================================================================
--- maven/components/trunk/maven-core-it/it0068/test.mdo (added)
+++ maven/components/trunk/maven-core-it/it0068/test.mdo Tue Sep 13 20:40:17
2005
@@ -0,0 +1,769 @@
+<?xml version="1.0"?>
+
+<model>
+ <id>settings</id>
+ <name>Settings</name>
+ <description><![CDATA[
+ User-specific configuration for maven. Includes things that should not
+ be distributed with the pom.xml file, such as developer identity, along
with
+ local settings, like proxy information.]]></description>
+ <defaults>
+ <default>
+ <key>package</key>
+ <value>org.apache.maven.settings</value>
+ </default>
+ </defaults>
+ <classes>
+ <class>
+ <name>TrackableBase</name>
+ <version>1.0.0</version>
+ <description>common base class that contains code to track the source
for this instance (USER|GLOBAL)</description>
+ <codeSegments>
+ <codeSegment>
+ <version>1.0.0</version>
+ <code><![CDATA[
+ public static final String USER_LEVEL = "user-level";
+ public static final String GLOBAL_LEVEL = "global-level";
+
+ private String sourceLevel = USER_LEVEL;
+ private boolean sourceLevelSet = false;
+
+ public void setSourceLevel( String sourceLevel )
+ {
+ if ( sourceLevelSet )
+ {
+ throw new IllegalStateException( "Cannot reset sourceLevel
attribute; it is already set to: " + sourceLevel );
+ }
+ else if ( !( USER_LEVEL.equals( sourceLevel ) || GLOBAL_LEVEL.equals(
sourceLevel ) ) )
+ {
+ throw new IllegalArgumentException( "sourceLevel must be one of:
{" + USER_LEVEL + "," + GLOBAL_LEVEL + "}" );
+ }
+ else
+ {
+ this.sourceLevel = sourceLevel;
+ this.sourceLevelSet = true;
+ }
+ }
+
+ public String getSourceLevel()
+ {
+ return sourceLevel;
+ }
+ ]]></code>
+ </codeSegment>
+ </codeSegments>
+ </class>
+ <class>
+ <name>IdentifiableBase</name>
+ <superClass>TrackableBase</superClass>
+ <version>1.0.0</version>
+ <fields>
+ <field>
+ <name>id</name>
+ <version>1.0.0</version>
+ <type>String</type>
+ <default>default</default>
+ <required>true</required>
+ </field>
+ </fields>
+ </class>
+ <class rootElement="true" xml.tagName="settings">
+ <name>Settings</name>
+ <version>1.0.0</version>
+ <superClass>TrackableBase</superClass>
+ <description>Root element of the user configuration file.</description>
+ <fields>
+ <field>
+ <name>localRepository</name>
+ <version>1.0.0</version>
+ <required>true</required>
+ <description><![CDATA[The local repository.]]></description>
+ <type>String</type>
+ </field>
+ <field>
+ <name>interactiveMode</name>
+ <version>1.0.0</version>
+ <description><![CDATA[Whether Maven should attempt to interact with
the user for input.]]></description>
+ <type>boolean</type>
+ <defaultValue>true</defaultValue>
+ </field>
+ <field>
+ <name>usePluginRegistry</name>
+ <version>1.0.0</version>
+ <description><![CDATA[Whether Maven should use the
plugin-registry.xml file to manage plugin versions.]]></description>
+ <type>boolean</type>
+ <defaultValue>true</defaultValue>
+ </field>
+ <!-- [JC] Not ready to use yet, so I'm making if unavailable for now.
-->
+ <!-- field>
+ <name>passwordStore</name>
+ <version>1.0.0</version>
+ <required>false</required>
+ <description><![CDATA[The keystore used to store
passwords.]]></description>
+ <type>String</type>
+ </field -->
+ <field>
+ <name>offline</name>
+ <version>1.0.0</version>
+ <required>false</required>
+ <description><![CDATA[Indicate whether maven should operate in
offline mode full-time.]]>
+ </description>
+ <type>boolean</type>
+ <defaultValue>false</defaultValue>
+ </field>
+ <!-- [JC] Not ready to use yet, so I'm making if unavailable for now.
-->
+ <!-- field>
+ <name>jdks</name>
+ <version>1.0.0</version>
+ <description><![CDATA[
+ Configuration for different java environment profiles. One good
use
+ for this might be to configure both JDK 1.4 and JDK 1.5 to work
with
+ maven. Profiles will allow switching of entire java environments
+ based on the profile id, either in the defaults section below, or
on
+ the command line.
+ ]]></description>
+ <association>
+ <type>Jdk</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ </field -->
+ <field>
+ <name>proxies</name>
+ <version>1.0.0</version>
+ <description><![CDATA[
+ Configuration for different proxy profiles. Multiple proxy
profiles
+ might come in handy for anyone working from a notebook or other
+ mobile platform, to enable easy switching of entire proxy
+ configurations by simply specifying the profile id, again either
from
+ the command line or from the defaults section below.
+ ]]></description>
+ <association>
+ <type>Proxy</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ </field>
+ <field>
+ <name>servers</name>
+ <version>1.0.0</version>
+ <description><![CDATA[
+ Configuration of server-specific settings, mainly authentication
+ method. This allows configuration of authentication on a per-server
+ basis.
+ ]]></description>
+ <association>
+ <type>Server</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ </field>
+ <field>
+ <name>mirrors</name>
+ <version>1.0.0</version>
+ <description> Configuration of download mirrors for repositories.
+ </description>
+ <association>
+ <type>Mirror</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ </field>
+ <field>
+ <name>profiles</name>
+ <version>1.0.0</version>
+ <description><![CDATA[
+ Configuration of build profiles for adjusting the build
+ according to environmental parameters
+ ]]></description>
+ <association>
+ <type>Profile</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ </field>
+ <field>
+ <name>activeProfiles</name>
+ <version>1.0.0</version>
+ <description><![CDATA[
+ List of manually-activated build profiles, specified in the order
in which
+ they should be applied.
+ ]]></description>
+ <association>
+ <type>String</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ </field>
+ <field>
+ <name>pluginGroups</name>
+ <version>1.0.0</version>
+ <description>List of groupIds to search for a plugin when that
plugin groupId is not explicitly provided.</description>
+ <association>
+ <type>String</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ </field>
+ </fields>
+ <codeSegments>
+ <codeSegment>
+ <version>1.0.0</version>
+ <code><![CDATA[
+ private Proxy activeProxy;
+
+ public void flushActiveProxy()
+ {
+ this.activeProxy = null;
+ }
+
+ public synchronized Proxy getActiveProxy()
+ {
+ if(activeProxy == null)
+ {
+ java.util.List proxies = getProxies();
+ if ( proxies != null && !proxies.isEmpty() )
+ {
+ if ( proxies.size() > 1 )
+ {
+ for ( java.util.Iterator it = proxies.iterator();
it.hasNext(); )
+ {
+ Proxy proxy = (Proxy) it.next();
+ if ( proxy.isActive() )
+ {
+ activeProxy = proxy;
+ break;
+ }
+ }
+ }
+ else
+ {
+ // If we only have one proxy, use it as the active one.
+ activeProxy = (Proxy) proxies.get( 0 );
+ }
+ }
+ }
+
+ return activeProxy;
+ }
+
+ public Server getServer( String serverId )
+ {
+ Server match = null;
+
+ java.util.List servers = getServers();
+ if ( servers != null && serverId != null )
+ {
+ for ( java.util.Iterator it = servers.iterator(); it.hasNext(); )
+ {
+ Server server = (Server) it.next();
+ if ( serverId.equals( server.getId() ) )
+ {
+ match = server;
+ break;
+ }
+ }
+ }
+
+ return match;
+ }
+
+ public Mirror getMirrorOf( String repositoryId )
+ {
+ Mirror match = null;
+
+ java.util.List mirrors = getMirrors();
+ if ( mirrors != null && repositoryId != null )
+ {
+ for ( java.util.Iterator it = mirrors.iterator(); it.hasNext(); )
+ {
+ Mirror mirror = (Mirror) it.next();
+ if ( repositoryId.equals( mirror.getMirrorOf() ) )
+ {
+ match = mirror;
+ break;
+ }
+ }
+ }
+
+ return match;
+ }
+
+ private java.util.Map profileMap;
+
+ public void flushProfileMap()
+ {
+ this.profileMap = null;
+ }
+
+ public java.util.Map getProfilesAsMap()
+ {
+ if ( profileMap == null )
+ {
+ profileMap = new java.util.HashMap();
+
+ if ( getProfiles() != null )
+ {
+ for ( java.util.Iterator it = getProfiles().iterator();
it.hasNext(); )
+ {
+ Profile profile = (Profile) it.next();
+
+ profileMap.put( profile.getId(), profile );
+ }
+ }
+ }
+
+ return profileMap;
+ }
+
+ private RuntimeInfo runtimeInfo;
+
+ public void setRuntimeInfo( RuntimeInfo runtimeInfo )
+ {
+ this.runtimeInfo = runtimeInfo;
+ }
+
+ public RuntimeInfo getRuntimeInfo()
+ {
+ return runtimeInfo;
+ }
+ ]]></code>
+ </codeSegment>
+ </codeSegments>
+ </class>
+ <!-- @todo: is any of this too CVS specific? Investigate other SCMs -->
+ <!-- [JC] Commenting out until we're ready to use it... -->
+ <!-- class>
+ <name>Jdk</name>
+ <version>1.0.0</version>
+ <superClass>TrackableBase</superClass>
+ <description><![CDATA[Describes one Java environment]]></description>
+ <fields>
+ <field>
+ <name>active</name>
+ <version>1.0.0</version>
+ <required>false</required>
+ <defaultValue>false</defaultValue>
+ <description><![CDATA[Whether this JDK is the active
one.]]></description>
+ <type>boolean</type>
+ </field>
+ <field>
+ <name>version</name>
+ <version>1.0.0</version>
+ <required>true</required>
+ <description><![CDATA[The JDK major version (eg.
'1.4').]]></description>
+ <type>String</type>
+ </field>
+ <field>
+ <name>javaHome</name>
+ <version>1.0.0</version>
+ <required>true</required>
+ <description><![CDATA[The JDK home.]]></description>
+ <type>String</type>
+ </field>
+ </fields>
+ </class -->
+ <class>
+ <name>Proxy</name>
+ <version>1.0.0</version>
+ <superClass>IdentifiableBase</superClass>
+ <fields>
+ <field>
+ <name>active</name>
+ <version>1.0.0</version>
+ <required>false</required>
+ <defaultValue>false</defaultValue>
+ <description><![CDATA[Whether this proxy configuration is the active
one.]]>
+ </description>
+ <type>boolean</type>
+ </field>
+ <field>
+ <name>protocol</name>
+ <version>1.0.0</version>
+ <description><![CDATA[The proxy protocol.]]></description>
+ <type>String</type>
+ <defaultValue>http</defaultValue>
+ </field>
+ <field>
+ <name>username</name>
+ <version>1.0.0</version>
+ <description><![CDATA[The proxy user.]]></description>
+ <type>String</type>
+ </field>
+ <field>
+ <name>password</name>
+ <version>1.0.0</version>
+ <description><![CDATA[The proxy password.]]></description>
+ <type>String</type>
+ </field>
+ <field>
+ <name>port</name>
+ <version>1.0.0</version>
+ <description><![CDATA[The proxy port.]]></description>
+ <type>int</type>
+ </field>
+ <field>
+ <name>host</name>
+ <version>1.0.0</version>
+ <description><![CDATA[The proxy host.]]></description>
+ <type>String</type>
+ </field>
+ <field>
+ <name>nonProxyHosts</name>
+ <version>1.0.0</version>
+ <description><![CDATA[
+ The list of non-proxied hosts (usually
+ comma-delimited).
+ ]]></description>
+ <type>String</type>
+ </field>
+ </fields>
+ </class>
+ <class>
+ <name>Server</name>
+ <version>1.0.0</version>
+ <superClass>IdentifiableBase</superClass>
+ <fields>
+ <field>
+ <name>username</name>
+ <version>1.0.0</version>
+ <description><![CDATA[The username used to authenticate.]]>
+ </description>
+ <type>String</type>
+ </field>
+ <field>
+ <name>password</name>
+ <version>1.0.0</version>
+ <description><![CDATA[
+ The password used in conjunction with the username to
authenticate.
+ ]]></description>
+ <type>String</type>
+ </field>
+ <field>
+ <name>privateKey</name>
+ <version>1.0.0</version>
+ <description><![CDATA[The private key location used to
authenticate.]]>
+ </description>
+ <type>String</type>
+ </field>
+ <field>
+ <name>passphrase</name>
+ <version>1.0.0</version>
+ <description><![CDATA[
+ The passphrase used in conjunction with the privateKey to
authenticate.
+ ]]></description>
+ <type>String</type>
+ </field>
+ </fields>
+ </class>
+ <class>
+ <name>Mirror</name>
+ <version>1.0.0</version>
+ <superClass>IdentifiableBase</superClass>
+ <description> A download mirror for a given repository. </description>
+ <fields>
+ <field>
+ <name>mirrorOf</name>
+ <required>true</required>
+ <version>1.0.0</version>
+ <type>String</type>
+ <description> The server ID of the repository being mirrored, eg
+ "central". This MUST NOT match the mirror id. </description>
+ </field>
+ <field>
+ <name>name</name>
+ <required>false</required>
+ <version>1.0.0</version>
+ <type>String</type>
+ <description> The optional name that describes the mirror.
+ </description>
+ </field>
+ <field>
+ <name>url</name>
+ <required>true</required>
+ <version>1.0.0</version>
+ <type>String</type>
+ <description> The URL of the mirror repository. </description>
+ </field>
+ <!--
+ <field>
+ <name>allowOriginal</name>
+ <version>1.0.0</version>
+ <type>boolean</type>
+ <defaultValue>true</defaultValue>
+ <description>
+ Whether to allow the user of the original as a fallback if an
artifact is not found on the mirror.
+ </description>
+ </field>
+-->
+ </fields>
+ </class>
+ <!-- Profile support -->
+ <class>
+ <name>Profile</name>
+ <version>1.0.0</version>
+ <superClass>IdentifiableBase</superClass>
+ <description><![CDATA[
+ Modifications to the build process which is keyed on some
+ sort of environmental parameter.
+ ]]></description>
+ <fields>
+ <field>
+ <name>activation</name>
+ <version>1.0.0</version>
+ <description><![CDATA[The conditional logic which will automatically
+ trigger the inclusion of this profile.]]></description>
+ <association>
+ <type>Activation</type>
+ </association>
+ </field>
+ <field>
+ <name>localRepository</name>
+ <version>1.0.0</version>
+ <type>String</type>
+ <description>backwards-compatible location for specifying the local
repository for use in builds</description>
+ <comment>THIS IS DEPRECATED: use localRepository under the root
element instead.</comment>
+ </field>
+ <field>
+ <name>properties</name>
+ <description>Extended configuration specific to this profile goes
+ here.</description>
+ <type>Properties</type>
+ <association xml.mapStyle="inline">
+ <type>String</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ </field>
+ <field>
+ <name>repositories</name>
+ <version>1.0.0</version>
+ <description><![CDATA[The lists of the remote repositories]]>
+ </description>
+ <association>
+ <type>Repository</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ </field>
+ <field>
+ <name>pluginRepositories</name>
+ <version>1.0.0</version>
+ <description><![CDATA[
+ The lists of the remote repositories for discovering plugins
+ ]]></description>
+ <association>
+ <type>Repository</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ <comment><![CDATA[ This may be removed or relocated in the near
+ future. It is undecided whether plugins really need a remote
+ repository set of their own. ]]></comment>
+ </field>
+ </fields>
+ </class>
+ <class>
+ <name>Activation</name>
+ <version>1.0.0</version>
+ <description><![CDATA[
+ The conditions within the build runtime environment which will trigger
+ the automatic inclusion of the parent build profile.
+ ]]></description>
+ <fields>
+ <field>
+ <name>activeByDefault</name>
+ <version>1.0.0</version>
+ <type>boolean</type>
+ <description>Flag specifying whether this profile is active as a
default.</description>
+ </field>
+ <field>
+ <name>jdk</name>
+ <version>1.0.0</version>
+ <type>String</type>
+ <description><![CDATA[
+ Specifies that this profile will be activated when a matching JDK
is detected.
+ ]]></description>
+ </field>
+ <field>
+ <name>property</name>
+ <version>1.0.0</version>
+ <description><![CDATA[
+ Specifies that this profile will be activated when this System
property is specified.
+ ]]></description>
+ <association>
+ <type>ActivationProperty</type>
+ </association>
+ </field>
+ </fields>
+ </class>
+
+ <!-- TODO: reproduced from maven-model/maven.mdo, instead should inherit
code and link to external docs -->
+ <class>
+ <name>RepositoryBase</name>
+ <version>1.0.0</version>
+ <description><![CDATA[
+ Repository contains the information needed
+ for establishing connections with remote repoistory
+ ]]></description>
+ <fields>
+ <field>
+ <name>id</name>
+ <version>1.0.0</version>
+ <description><![CDATA[
+ A unique identifier for a repository.
+ ]]></description>
+ <type>String</type>
+ </field>
+ <field>
+ <name>name</name>
+ <version>1.0.0</version>
+ <description><![CDATA[
+ Human readable name of the repository
+ ]]></description>
+ <type>String</type>
+ </field>
+ <field>
+ <name>url</name>
+ <version>1.0.0</version>
+ <description><![CDATA[
+ The url of the repository
+ ]]></description>
+ <type>String</type>
+ </field>
+ <field>
+ <name>layout</name>
+ <version>1.0.0</version>
+ <description>The type of layout this repository uses for locating
and storing artifacts - can be "legacy" or
+ "default".</description>
+ <type>String</type>
+ <defaultValue>default</defaultValue>
+ </field>
+ </fields>
+ <codeSegments>
+ <codeSegment>
+ <version>1.0.0</version>
+ <code><![CDATA[
+ public boolean equals( Object obj )
+ {
+ RepositoryBase other = (RepositoryBase) obj;
+
+ boolean retValue = false;
+
+ if ( id != null )
+ {
+ retValue = id.equals( other.id );
+ }
+
+ return retValue;
+ }
+ ]]></code>
+ </codeSegment>
+ </codeSegments>
+ </class>
+
+ <class>
+ <name>Repository</name>
+ <superClass>RepositoryBase</superClass>
+ <version>1.0.0</version>
+ <description>
+ Repository contains the information needed for establishing
connections with remote repoistory
+ </description>
+ <fields>
+ <!-- TODO: deprecated -->
+ <field>
+ <name>snapshotPolicy</name>
+ <version>1.0.0</version>
+ <description>
+ The policy for downloading snapshots - can be "always", "daily"
(default), "interval:XXX" (in minutes) or
+ "never" (repository is not checked, even if the snapshot is not
present locally).
+ </description>
+ <type>String</type>
+ </field>
+ <!-- TODO: deprecated -->
+ <field>
+ <name>checksumPolicy</name>
+ <version>1.0.0</version>
+ <description>What to do when verification of an artifact checksum
fails - warn, fail, etc. Valid values are
+ "fail" or "warn"</description>
+ <type>String</type>
+ </field>
+ <field>
+ <name>releases</name>
+ <version>1.0.0</version>
+ <description>How to handle downloading of releases from this
repository</description>
+ <association>
+ <type>RepositoryPolicy</type>
+ </association>
+ </field>
+ <field>
+ <name>snapshots</name>
+ <version>1.0.0</version>
+ <description>How to handle downloading of snapshots from this
repository</description>
+ <association>
+ <type>RepositoryPolicy</type>
+ </association>
+ </field>
+ </fields>
+ <!-- prevent modello generation of an incorrect equals method. Could be
avoided by using <identity/> tags to mark ID as the only identity field -->
+ <codeSegments>
+ <codeSegment>
+ <version>1.0.0</version>
+ <code><![CDATA[
+ public boolean equals( Object obj )
+ {
+ return super.equals( obj );
+ }
+ ]]></code>
+ </codeSegment>
+ </codeSegments>
+ </class>
+
+ <class>
+ <name>RepositoryPolicy</name>
+ <version>1.0.0</version>
+ <description>Download policy</description>
+ <fields>
+ <field>
+ <name>enabled</name>
+ <version>1.0.0</version>
+ <description>Whether to use this repository for downloading this
type of artifact</description>
+ <type>boolean</type>
+ <defaultValue>true</defaultValue>
+ </field>
+ <field>
+ <name>updatePolicy</name>
+ <version>1.0.0</version>
+ <description>
+ The frequency for downloading updates - can be "always", "daily"
(default), "interval:XXX" (in minutes) or
+ "never" (only if it doesn't exist locally).
+ </description>
+ <type>String</type>
+ </field>
+ <field>
+ <name>checksumPolicy</name>
+ <version>1.0.0</version>
+ <description>What to do when verification of an artifact checksum
fails - warn, fail, etc. Valid values are
+ "fail" or "warn"</description>
+ <type>String</type>
+ </field>
+ </fields>
+ </class>
+
+ <class>
+ <name>ActivationProperty</name>
+ <version>1.0.0</version>
+ <description><![CDATA[
+ This is the property specification used to activate a profile. If the
value field is empty,
+ then the existence of the named property will activate the profile,
otherwise it does a case-sensitive
+ match against the property value as well.
+ ]]></description>
+ <fields>
+ <field>
+ <name>name</name>
+ <version>1.0.0</version>
+ <type>String</type>
+ <required>true</required>
+ <description>The name of the property to be used to activate a
profile</description>
+ </field>
+ <field>
+ <name>value</name>
+ <version>1.0.0</version>
+ <type>String</type>
+ <description>The value of the property to be used to activate a
profile</description>
+ </field>
+ </fields>
+ </class>
+ <!-- /BuildProfile support -->
+ </classes>
+</model>
Propchange: maven/components/trunk/maven-core-it/it0068/test.mdo
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/components/trunk/maven-core-it/it0068/test.mdo
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/components/trunk/maven-core-it/it2001/a/pom.xml
URL:
http://svn.apache.org/viewcvs/maven/components/trunk/maven-core-it/it2001/a/pom.xml?rev=280755&view=auto
==============================================================================
--- maven/components/trunk/maven-core-it/it2001/a/pom.xml (added)
+++ maven/components/trunk/maven-core-it/it2001/a/pom.xml Tue Sep 13 20:40:17
2005
@@ -0,0 +1,21 @@
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.maven.it2001</groupId>
+ <artifactId>it2001-a</artifactId>
+ <version>1.0</version>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.it2001</groupId>
+ <artifactId>it2001-b</artifactId>
+ <version>1.0</version>
+ </dependency>
+ </dependencies>
+
+ <repositories>
+ <repository>
+ <id>test</id>
+ <url>file:../target/test-repo</url>
+ </repository>
+ </repositories>
+</project>
Propchange: maven/components/trunk/maven-core-it/it2001/a/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/components/trunk/maven-core-it/it2001/a/pom.xml
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added:
maven/components/trunk/maven-core-it/it2001/a/src/main/java/org/apache/maven/it2001/a/Client.java
URL:
http://svn.apache.org/viewcvs/maven/components/trunk/maven-core-it/it2001/a/src/main/java/org/apache/maven/it2001/a/Client.java?rev=280755&view=auto
==============================================================================
---
maven/components/trunk/maven-core-it/it2001/a/src/main/java/org/apache/maven/it2001/a/Client.java
(added)
+++
maven/components/trunk/maven-core-it/it2001/a/src/main/java/org/apache/maven/it2001/a/Client.java
Tue Sep 13 20:40:17 2005
@@ -0,0 +1,8 @@
+package org.apache.maven.it2001.a;
+
+import org.apache.maven.it2001.b.Layer;
+
+public class Client
+{
+ private Layer layer;
+}
Propchange:
maven/components/trunk/maven-core-it/it2001/a/src/main/java/org/apache/maven/it2001/a/Client.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/components/trunk/maven-core-it/it2001/a/src/main/java/org/apache/maven/it2001/a/Client.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/components/trunk/maven-core-it/it2001/b/pom.xml
URL:
http://svn.apache.org/viewcvs/maven/components/trunk/maven-core-it/it2001/b/pom.xml?rev=280755&view=auto
==============================================================================
--- maven/components/trunk/maven-core-it/it2001/b/pom.xml (added)
+++ maven/components/trunk/maven-core-it/it2001/b/pom.xml Tue Sep 13 20:40:17
2005
@@ -0,0 +1,15 @@
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.maven.it2001</groupId>
+ <artifactId>it2001-b</artifactId>
+ <version>1.0</version>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.it2001</groupId>
+ <artifactId>it2001-c</artifactId>
+ <version>1.0</version>
+ </dependency>
+ </dependencies>
+
+</project>
Propchange: maven/components/trunk/maven-core-it/it2001/b/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/components/trunk/maven-core-it/it2001/b/pom.xml
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added:
maven/components/trunk/maven-core-it/it2001/b/src/main/java/org/apache/maven/it2001/b/Layer.java
URL:
http://svn.apache.org/viewcvs/maven/components/trunk/maven-core-it/it2001/b/src/main/java/org/apache/maven/it2001/b/Layer.java?rev=280755&view=auto
==============================================================================
---
maven/components/trunk/maven-core-it/it2001/b/src/main/java/org/apache/maven/it2001/b/Layer.java
(added)
+++
maven/components/trunk/maven-core-it/it2001/b/src/main/java/org/apache/maven/it2001/b/Layer.java
Tue Sep 13 20:40:17 2005
@@ -0,0 +1,8 @@
+package org.apache.maven.it2001.b;
+
+import org.apache.maven.it2001.c.Core;
+
+public class Layer
+{
+ private Core core;
+}
Propchange:
maven/components/trunk/maven-core-it/it2001/b/src/main/java/org/apache/maven/it2001/b/Layer.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/components/trunk/maven-core-it/it2001/b/src/main/java/org/apache/maven/it2001/b/Layer.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/components/trunk/maven-core-it/it2001/c/pom.xml
URL:
http://svn.apache.org/viewcvs/maven/components/trunk/maven-core-it/it2001/c/pom.xml?rev=280755&view=auto
==============================================================================
--- maven/components/trunk/maven-core-it/it2001/c/pom.xml (added)
+++ maven/components/trunk/maven-core-it/it2001/c/pom.xml Tue Sep 13 20:40:17
2005
@@ -0,0 +1,13 @@
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.maven.it2001</groupId>
+ <artifactId>it2001-c</artifactId>
+ <version>1.0</version>
+
+ <distributionManagement>
+ <repository>
+ <id>test</id>
+ <url>file:../target/test-repo</url>
+ </repository>
+ </distributionManagement>
+</project>
Propchange: maven/components/trunk/maven-core-it/it2001/c/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/components/trunk/maven-core-it/it2001/c/pom.xml
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added:
maven/components/trunk/maven-core-it/it2001/c/src/main/java/org/apache/maven/it2001/c/Core.java
URL:
http://svn.apache.org/viewcvs/maven/components/trunk/maven-core-it/it2001/c/src/main/java/org/apache/maven/it2001/c/Core.java?rev=280755&view=auto
==============================================================================
---
maven/components/trunk/maven-core-it/it2001/c/src/main/java/org/apache/maven/it2001/c/Core.java
(added)
+++
maven/components/trunk/maven-core-it/it2001/c/src/main/java/org/apache/maven/it2001/c/Core.java
Tue Sep 13 20:40:17 2005
@@ -0,0 +1,8 @@
+package org.apache.maven.it2001.c;
+
+public class Core
+{
+
+ private String version;
+
+}
Propchange:
maven/components/trunk/maven-core-it/it2001/c/src/main/java/org/apache/maven/it2001/c/Core.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/components/trunk/maven-core-it/it2001/c/src/main/java/org/apache/maven/it2001/c/Core.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/components/trunk/maven-core-it/it2001/settings.xml
URL:
http://svn.apache.org/viewcvs/maven/components/trunk/maven-core-it/it2001/settings.xml?rev=280755&view=auto
==============================================================================
--- maven/components/trunk/maven-core-it/it2001/settings.xml (added)
+++ maven/components/trunk/maven-core-it/it2001/settings.xml Tue Sep 13
20:40:17 2005
@@ -0,0 +1,18 @@
+<settings>
+ <localRepository>file:../target/local-repo</localRepository>
+ <usePluginRegistry>false</usePluginRegistry>
+ <profiles>
+ <profile>
+ <id>test-settings</id>
+ <repositories>
+ <repository>
+ <id>test</id>
+ <url>file:../target/test-repo</url>
+ </repository>
+ </repositories>
+ </profile>
+ </profiles>
+ <activeProfiles>
+ <activeProfile>test-settings</activeProfile>
+ </activeProfiles>
+</settings>
Propchange: maven/components/trunk/maven-core-it/it2001/settings.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/components/trunk/maven-core-it/it2001/settings.xml
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/components/trunk/maven-core-it/it2001/test.sh
URL:
http://svn.apache.org/viewcvs/maven/components/trunk/maven-core-it/it2001/test.sh?rev=280755&view=auto
==============================================================================
--- maven/components/trunk/maven-core-it/it2001/test.sh (added)
+++ maven/components/trunk/maven-core-it/it2001/test.sh Tue Sep 13 20:40:17 2005
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+echo "Clearing out residual working directories"
+rm -Rf `find . -type d -name target`
+
+echo "Deploying 'c'"
+(cd c && m2 --settings ../settings.xml deploy)
+
+echo "Installing 'b'"
+(cd b && m2 --settings ../settings.xml install)
+
+echo "Installing 'a'"
+(cd a && m2 --settings ../settings.xml install)
+
+echo "Removing 'c' from local repository"
+rm -Rf target/local-repository/org/apache/maven/it2001/c
+
+echo "Re-running 'a' install"
+(cd a && m2 --settings ../settings.xml install)
+
+echo "Cleaning up."
+rm -Rf `find . -type d -name target`
+
Propchange: maven/components/trunk/maven-core-it/it2001/test.sh
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/components/trunk/maven-core-it/it2001/test.sh
------------------------------------------------------------------------------
svn:executable = *
Propchange: maven/components/trunk/maven-core-it/it2001/test.sh
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Modified:
maven/components/trunk/maven-core/src/main/java/org/apache/maven/cli/MavenCli.java
URL:
http://svn.apache.org/viewcvs/maven/components/trunk/maven-core/src/main/java/org/apache/maven/cli/MavenCli.java?rev=280755&r1=280754&r2=280755&view=diff
==============================================================================
---
maven/components/trunk/maven-core/src/main/java/org/apache/maven/cli/MavenCli.java
(original)
+++
maven/components/trunk/maven-core/src/main/java/org/apache/maven/cli/MavenCli.java
Tue Sep 13 20:40:17 2005
@@ -427,7 +427,13 @@
ArtifactRepositoryFactory artifactRepositoryFactory =
(ArtifactRepositoryFactory) embedder.lookup(
ArtifactRepositoryFactory.ROLE );
- String url = "file://" + settings.getLocalRepository();
+ String url = settings.getLocalRepository();
+
+ if ( !url.startsWith( "file:" ) )
+ {
+ url = "file://" + url;
+ }
+
ArtifactRepository localRepository = new DefaultArtifactRepository(
"local", url, repositoryLayout );
boolean snapshotPolicySet = false;
Modified:
maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java
URL:
http://svn.apache.org/viewcvs/maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java?rev=280755&r1=280754&r2=280755&view=diff
==============================================================================
---
maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java
(original)
+++
maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java
Tue Sep 13 20:40:17 2005
@@ -76,6 +76,9 @@
private ArtifactFactory artifactFactory;
private RepositoryMetadataManager repositoryMetadataManager;
+
+ // lazily instantiated and cached.
+ private MavenProject superProject;
/**
* Retrieve the metadata for the project from the repository.
@@ -177,7 +180,13 @@
{
// if the project is null, we encountered an invalid model
(read: m1 POM)
// we'll just return an empty resolution group.
- result = new ResolutionGroup( pomArtifact,
Collections.EMPTY_SET, Collections.EMPTY_LIST );
+ // or used the inherited scope (should that be passed to the
buildFromRepository method above?)
+ Set artifacts = project.createArtifacts( artifactFactory,
artifact.getScope(),
+
artifact.getDependencyFilter() );
+
+ List repositories = aggregateRepositoryLists(
remoteRepositories, project.getRemoteArtifactRepositories() );
+
+ result = new ResolutionGroup( pomArtifact, artifacts,
repositories );
}
else
{
@@ -195,6 +204,56 @@
{
throw new ArtifactMetadataRetrievalException( "Unable to read the
metadata file", e );
}
+ catch ( ProjectBuildingException e )
+ {
+ throw new ArtifactMetadataRetrievalException( "Unable to read the
metadata file", e );
+ }
+ }
+
+ private List aggregateRepositoryLists( List remoteRepositories, List
remoteArtifactRepositories )
+ throws ProjectBuildingException
+ {
+ if ( superProject == null )
+ {
+ superProject = mavenProjectBuilder.buildStandaloneSuperProject(
null );
+ }
+
+ List repositories = new ArrayList();
+
+ repositories.addAll( remoteRepositories );
+
+ // ensure that these are defined
+ for ( Iterator it =
superProject.getRemoteArtifactRepositories().iterator(); it.hasNext(); )
+ {
+ ArtifactRepository superRepo = (ArtifactRepository) it.next();
+
+ for ( Iterator aggregatedIterator = repositories.iterator();
aggregatedIterator.hasNext(); )
+ {
+ ArtifactRepository repo = (ArtifactRepository)
aggregatedIterator.next();
+
+ // if the repository exists in the list and was introduced by
another POM's super-pom,
+ // remove it...the repository definitions from the super-POM
should only be at the end of
+ // the list.
+ // if the repository has been redefined, leave it.
+ if ( repo.getId().equals( superRepo.getId() ) &&
repo.getUrl().equals( superRepo.getUrl() ) )
+ {
+ aggregatedIterator.remove();
+ }
+ }
+ }
+
+ // this list should contain the super-POM repositories, so we don't
have to explicitly add them back.
+ for ( Iterator it = remoteArtifactRepositories.iterator();
it.hasNext(); )
+ {
+ ArtifactRepository repository = (ArtifactRepository) it.next();
+
+ if ( !repositories.contains( repository ) )
+ {
+ repositories.add( repository );
+ }
+ }
+
+ return repositories;
}
public static Set createArtifacts( ArtifactFactory artifactFactory, List
dependencies, String inheritedScope,
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]