ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maart...@apache.org
Subject svn commit: r706788 - in /ant/ivy/core/branches/2.0.x: ./ doc/ doc/dev/ doc/settings/ src/java/org/apache/ivy/ant/ src/java/org/apache/ivy/core/event/ src/java/org/apache/ivy/core/event/resolve/ src/java/org/apache/ivy/core/settings/ src/java/org/apach...
Date Tue, 21 Oct 2008 21:50:13 GMT
Author: maartenc
Date: Tue Oct 21 14:50:11 2008
New Revision: 706788

URL: http://svn.apache.org/viewvc?rev=706788&view=rev
Log:
Merged all changes from trunk into 2.0.x branch.

Added:
    ant/ivy/core/branches/2.0.x/doc/settings/credentials.html
      - copied unchanged from r706770, ant/ivy/core/trunk/doc/settings/credentials.html
    ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/plugins/parser/m2/m2-entities.ent
      - copied unchanged from r706770, ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/m2-entities.ent
    ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/ant/IvyAntSettingsBuildFileStackOverflow.xml
      - copied unchanged from r706770, ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyAntSettingsBuildFileStackOverflow.xml
    ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/plugins/parser/m2/test-entity.pom
      - copied unchanged from r706770, ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-entity.pom
    ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/plugins/parser/m2/test-model.pom
      - copied unchanged from r706770, ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-model.pom
    ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/plugins/parser/m2/test-parent-not-found.pom
      - copied unchanged from r706770, ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-parent-not-found.pom
Modified:
    ant/ivy/core/branches/2.0.x/   (props changed)
    ant/ivy/core/branches/2.0.x/CHANGES.txt
    ant/ivy/core/branches/2.0.x/build.xml
    ant/ivy/core/branches/2.0.x/doc/dev/updatesite.html
    ant/ivy/core/branches/2.0.x/doc/settings.html
    ant/ivy/core/branches/2.0.x/doc/toc.json
    ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/ant/AntBuildTrigger.java
    ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/ant/IvyAntSettings.java
    ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/ant/IvyCacheFileset.java
    ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/ant/IvyResolve.java
    ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/core/event/IvyEvent.java
    ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/core/event/resolve/ResolveDependencyEvent.java
    ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/core/settings/XmlSettingsParser.java
    ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/core/settings/ivy.properties
    ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java
    ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
    ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java
    ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorWriter.java
    ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/plugins/resolver/AbstractPatternsBasedResolver.java
    ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/plugins/resolver/BasicResolver.java
    ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/plugins/resolver/IBiblioResolver.java
    ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/util/XMLHelper.java
    ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/util/cli/CommandLineParser.java
    ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/util/url/AbstractURLHandler.java
    ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/util/url/BasicURLHandler.java
    ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/util/url/HttpClientHandler.java
    ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/util/url/URLHandlerDispatcher.java
    ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/MainTest.java
    ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/ant/IvyAntSettingsBuildFile.xml
    ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/ant/IvyAntSettingsBuildFileTest.java
    ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/ant/IvyResolveTest.java
    ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/core/resolve/ResolveTest.java
    ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java
    ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/plugins/parser/m2/test-optional.pom
    ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/plugins/parser/m2/test-write-dependencies-optional.xml
    ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/plugins/parser/xml/test-write-full.xml
    ant/ivy/core/branches/2.0.x/test/repositories/extra-attributes/mymodule/task1/1854/ivy.xml

Propchange: ant/ivy/core/branches/2.0.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Oct 21 14:50:11 2008
@@ -1 +1 @@
-/ant/ivy/core/trunk:695737,696014-696031,698324,698345,698354,698364
+/ant/ivy/core/trunk:695737,696014-696031,696442,698318-706770

Modified: ant/ivy/core/branches/2.0.x/CHANGES.txt
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.0.x/CHANGES.txt?rev=706788&r1=706787&r2=706788&view=diff
==============================================================================
--- ant/ivy/core/branches/2.0.x/CHANGES.txt (original)
+++ ant/ivy/core/branches/2.0.x/CHANGES.txt Tue Oct 21 14:50:11 2008
@@ -31,9 +31,11 @@
 	Jacob Grydholt Jensen
 	Scott Goldstein
 	Pierre H├Ągnestrand
+	Scott Hebert
 	Tobias Himstedt
 	Ben Hale
 	Peter Hayes
+	Scott Hebert
 	Matt Inger
 	Anders Janmyr
 	Christer Jonsson
@@ -53,7 +55,9 @@
 	Bernard Niset
 	David Maplesden
 	Glen Marchesani
+	Phil Messenger
 	Mathias Muller
+	Randy Nott
 	Peter Oxenham
 	Emmanuel Pellereau
 	Roshan Punnoose
@@ -73,6 +77,7 @@
 	James P. White
 	Tom Widmer
 	John Williams
+    Chris Wood
 	Patrick Woodworth
 	Jaroslaw Wypychowski
 	
@@ -80,14 +85,37 @@
 =====================================
 - DOCUMENTATION: Filesystem resolver: talks about "patterns" but does not mention these must become absolute file paths (IVY-910)
 
+- NEW: Allow authentication credentials to be specified in settings file (IVY-943) (thanks to Randy Nott)
+
 - IMPROVEMENT: Error messages on use of relative paths can be cyrptic (IVY-909)
+- IMPROVEMENT: Maven accepts illegal XML for its pom's, Ivy not (IVY-921)
 
+- FIX: NullPointerException in AbstractPatternsBasedResolver when organization is null (IVY-928)
+- FIX: NullPointerException when Ivy cannot locate pom parent (IVY-927)
 - FIX: Cannot configure items with java.io.File attributes (IVY-905)
 - FIX: Environment properties in ivy settings are no longer resolved (IVY-907)
 - FIX: Resolve failed on certain proxy environment (IVY-911)
 - FIX: Ivy can't handle bare POM ${groupId} property (IVY-913) (thanks to Tom Widmer)
 - FIX: Properties needed to parse version in POM (IVY-914) (thanks to Tom Widmer)
-
+- FIX: build.xml: checkstyle + checkstyle-report dont work together (IVY-919)
+- FIX: Maven packaging of "pom" should add a "jar" artifact if present (IVY-920)
+- FIX: StackOverflow when using ivy:settings with "ivy.instance" as id (IVY-924)
+- FIX: Maven Pom reader doesn't handle optional dependencies correctly in some instances (IVY-926) (thanks to Phil Messenger)
+- FIX: ivy:settings doesn't work if id is a property (IVY-925)
+- FIX: HttpClientHandler hanging in certain cases (IVY-930) (thanks to Scott Hebert)
+- FIX: Can't download files containing space or + in their names by HTTP (IVY-923)
+- FIX: Maven2 parser doesn't support POMs with <model> as root (IVY-932)
+- FIX: Default retrieve, publish and deliver patterns doesn't include the [classifier] token (IVY-935)
+- FIX: Can't use latest.release for pom dependencies (IVY-936)
+- FIX: Unable to resolve snapshot versions depending on xml elements order (IVY-940)
+- FIX: pre-resolve-dependency event doesn't export branch information (IVY-941) (thanks to Jaroslaw Wypychowski)
+- FIX: cachefileset produces an empty fileset when the cache refers to libs in directories that only have the root directory in common (IVY-948) (thanks to Chris Wood)
+- FIX: Extra Attributes specified in the Dependency's Module Descriptor are not available to resolvers (IVY-929) (thanks to Scott Hebert)
+- FIX: Support for passing arbitrary arguments to the -main invoked class when using the standalone mode is severely limited (IVY-952) (thanks to Patrick Woodworth)
+- FIX: Correctly set ivy.resolved.configurations property when the conf string includes a negation operator (IVY-951) (thanks to Patrick Woodworth)
+- FIX: Maven pom license url can contain xml entities (IVY-950)
+- FIX: Maven pom license has name as optional element (IVY-949)
+- FIX: Ivy doesn't throw an error when the parent POM cannot be loaded (IVY-931)
 
    2.0.0-rc1
 =====================================

Modified: ant/ivy/core/branches/2.0.x/build.xml
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.0.x/build.xml?rev=706788&r1=706787&r2=706788&view=diff
==============================================================================
--- ant/ivy/core/branches/2.0.x/build.xml (original)
+++ ant/ivy/core/branches/2.0.x/build.xml Tue Oct 21 14:50:11 2008
@@ -46,7 +46,7 @@
             </classpath>
         </taskdef>
     	
-        <ivy:configure id="ivy.instance" override="true" />
+        <ivy:configure override="true" />
     </target>
     
     <target name="install" depends="init-ivy-home, jar" 
@@ -540,7 +540,7 @@
         </apply>
     </target>
     
-    <target name="checkstyle" depends="jar" description="checks Ivy codebase according to ${checkstyle.src.dir}/checkstyle-config">
+    <target name="checkstyle-internal" depends="jar" description="checks Ivy codebase according to ${checkstyle.src.dir}/checkstyle-config">
         <ivy:cachepath organisation="checkstyle" module="checkstyle" revision="4.3"
                 inline="true" conf="default" pathid="checkstyle.classpath" transitive="true" 
         		log="download-only"/>
@@ -560,11 +560,14 @@
                 <include name="**/*.java" />
             </fileset>
         </checkstyle>
+  	</target>
+	
+    <target name="checkstyle" depends="checkstyle-internal" description="checks Ivy codebase according to ${checkstyle.src.dir}/checkstyle-config">
     	<fail if="checkstyle.failed"
     		message="Checkstyle has errors. See report in ${checkstyle.report.dir}" />
     </target>
 
-    <target name="checkstyle-report" depends="checkstyle">
+    <target name="checkstyle-report" depends="checkstyle-internal">
         <property name="checkstyle.basedir" location="${src.dir}" />
         <xslt in="${checkstyle.report.dir}/checkstyle.xml"
                 style="${checkstyle.src.dir}/checkstyle-frames.xsl"

Modified: ant/ivy/core/branches/2.0.x/doc/dev/updatesite.html
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.0.x/doc/dev/updatesite.html?rev=706788&r1=706787&r2=706788&view=diff
==============================================================================
--- ant/ivy/core/branches/2.0.x/doc/dev/updatesite.html (original)
+++ ant/ivy/core/branches/2.0.x/doc/dev/updatesite.html Tue Oct 21 14:50:11 2008
@@ -25,60 +25,121 @@
 </head>
 <body>
 	<textarea id="xooki-source">
-Once a release have been build for Ivy or IvyDE, they should be push to the Eclipse updatesite so that Eclipse users will be able to update automatically their installed version of Ivy or IvyDE.
+Once a release have been build for Ivy or IvyDE, they should be pushed to the Eclipse updatesite so that Eclipse users will be able to update automatically their installed version of Ivy or IvyDE.
 
-<h1>Push the new version</h1>
+This doc is in two parts, the <a href="#setup">setup</a> of the updatesite which will be the candidate for the vote of the Ivy or IvyDE release, and the <a href="#deployment">final deployment</a> once the release is accepted.
 
-The update site svn location is there: https://svn.apache.org/repos/asf/ant/ivy/site/ivyde/updatesite/
+<u>Important note:</u> in this doc, the released version is denoted as $VERSION (and have to be replaced accordingly in every commands), but this is the OSGi one, not the usually shown one, in particular for release candidate versions. For instance an Ivy version can be <tt>2.0.0-RC1</tt> but the OSGi one, and the one to use here is <tt>2.0.0.cr1</tt>.
 
-<ul>
-<li>For an <u>Ivy release</u>:
-the new ivy bundle have to be placed in the plugins directory of the updatesite. The convention is to name the bundle org.apache.ivy_${BUNDLE-VERSION}.jar.
-Eclipse needs a feature, it can be generated at the right place with an ant target. From the <a href="https://svn.apache.org/repos/asf/ant/ivy/site/build.xml">build file of the site</a>, run: <pre>ant updatesite:generate-ivy-feature -Divy.version=${BUNDLE-VERSION}</pre>
+<h1><a name="setup"></a>Build the updatesite</h1>
+
+<h2>Push the new version</h2>
+
+The update site svn location is there: https://svn.apache.org/repos/asf/ant/ivy/updatesite/trunk . You will update it so it will contain the new artifacts.
+
+<ul><li>For an <u>Ivy</u> release:
+The new ivy bundle have to be placed in the plugins directory of the updatesite. So you should do something like:
+<code>cp ..../ivy.jar dist/plugins/org.apache.ivy_$VERSION.jar</code>
+
+Then Eclipse needs a feature, which will be generated at the right place with an ant target:
+<pre>
+ant generate-ivy-feature -Divy.version=$VERSION</pre>
+</li><li>
+For an <u>IvyDE</u> release:
+The zip distribution needs to be unpacked into the updatesite directory:
+<pre>
+cd dist
+unzip ..../org.apache.ivyde.feature-$VERSION.zip
+</pre>
 </li>
-<li>For an <u>IvyDE release</u>:
-it contains a plugin and a feature, so they have to be place respectivly in the plugins directory and in the features directory. </li>
 </ul>
 
 Then the deprecated versions of the plugins and the features should be removed.
 
-And the site.xml file should be edited. The version number should be updated accordingly to the release.
+<h2>Update the site.xml</h2>
+
+The <tt>site.xml</tt> file in the <tt>dist</tt> directory should be edited so it will reference the new artifacts. You should just change the version number accordingly to the release.
 
-<h1>Prepare the update site</h1>
+<h2>Prepare the update site</h2>
 
 The update site is optimized: the metadata of the features are aggregated into the digest.zip, and the jar of the plugins are compressed with a better algorithm.
 
-To accomplish this task, from the <a href="https://svn.apache.org/repos/asf/ant/ivy/site/build.xml">build file of the site</a>, run:
-<pre>ant updatesite:optimize</pre>
+To accomplish this task, just run at the root of your working copy of the updatesite:
+<ul>
+<li>For an <u>Ivy</u> release:
+<pre>
+ant optimize-ivy
+</pre></li>
+<li>
+For an <u>IvyDE</u> release:
+<pre>
+ant optimize-ivyde
+</pre></li>
+</ul>
 
 The binary files then need to be signed and their checksum computed. For the checksums, run:
-<pre>ant updatesite:checksum</pre>
-To sign the binaries, you can use the signArtifacts.sh scripts which is in the updatesite directory.
+<pre>ant checksum</pre>
+And sign the binaries:
 
-<h1>Test the updatesite</h1>
-
-The updatesite is ready to be tested. In order to test the new artifacts, as they are not yet deployed on Apache mirrors, the updatesite mirroring have to be disable. Basically it is just about not deploying the eclipse-update--xml files.
-
-If you are willing to just test yourself, you can setup in Eclipse a local updatesite. Wherever you want on your local filesystem, make a clone of you working copy of the updatesite directory, but <u>without</u> the eclipse-update--xml files.
-
-To let the developper community test the updatesite, you can copy the new local updatesite <u>without</u> the eclipse-update--xml files to your public_html directory on people.apache.org:
-<pre>scp -r digest.zip features plugins site.xml LOGIN@people.apache.org:/home/LOGIN/public_html/updatesite</pre>
+<ul>
+<li>For an <u>Ivy</u> release:
+<pre>./signIvyArtifacts.sh</pre>
+</li>
+<li>
+For an <u>IvyDE</u> release:
+<pre>./signIvyDEArtifacts.sh</pre>
+</li>
+</ul>
 
-<h1>Deployment</h1>
+<b>Note:</b> these previous targets may optimize, checksum and sign already released artifacts. Just so a <tt>svn status</tt> to check the modified artifacts; the only modified files should be the digest.zip (with its signature and checksum) and the site.xml; then there should be the added files of the release. Then do some <tt>svn revert <i>file</i></tt> to revert the unexpected changes.
 
-Two deployments are needed. One will be part of the website deployment, it will deploy the main updatesite, where there are only the metadata. The second is about pushing the binaries in the Apache dist directory.
+And finally commit your changes.
 
-To deploy the main updatesite, juste regenerate the IvyDE site:
-<pre>ant generate-site-ivyde</pre>
-and commit the changes of the "target" directory.
+<h2>Test the updatesite</h2>
 
-For the mirrors udpate site which contains the actual binaries, every binaries have to be copied, with their signatures and checksums, and the site.xml. So on people.apache.org, first do a backup of the current updatesite
-<pre>mv /www/www.apache.org/dist/ant/ivyde/updatesite /www/www.apache.org/dist/ant/ivyde/updatesite.bak</pre>
-Then we recreate the updatesite:
-<pre>mkdir /www/www.apache.org/dist/ant/ivyde/updatesite</pre>
-And publish the new updatesite:
-<pre>cd site/ivyde/updatesite
-scp -r digest* plugins features site.xml LOGIN@people.apache.org:/www/www.apache.org/dist/ant/ivyde/updatesite</pre>
+The updatesite is ready to be tested. You can deploy it where ever you want with the command:
+<pre>svn export https://svn.apache.org/repos/asf/ant/ivy/updatesite/trunk/dist updatesite
+</pre>
+
+For both local and remote testing, as the new jars are not yet deployed on Apache mirrors, the updatesite mirroring have to be disable.
+Basically it is just about modifying the site.xml and remove the reference to the eclipse-update--xml files: remove the attribute <tt>mirrorsURL</tt>.
+
+To let the developper community test the updatesite, you can setup a staging updatesite in your public_html directory on people.apache.org. So if you deploy it on people.apache.org, in the directory ~/public_html/staging, then the developpers should setup the updatesite with the URL http://people.apache.org/~LOGIN/staging/updatesite .
+
+<h1><a name="deployment"></a>Deployment of a release</h1>
+
+The release is accepted, so we can tag the updatesite:
+<pre>
+svn cp https://svn.apache.org/repos/asf/ant/ivy/updatesite/trunk https://svn.apache.org/repos/asf/ant/ivy/updatesite/tags/$TAGNAME
+</pre>
+with <tt>$TAGNAME</tt> the name of the release, so it would be either <tt>ivy-$VERSION</tt> or <tt>ivyde-$VERSION</tt>.
+
+Then backup and deploy. On people.apache.org:
+<pre>
+cd /www/www.apache.org/dist/ant/ivyde/
+mv updatesite ~/updatesite.backup
+svn export https://svn.apache.org/repos/asf/ant/ivy/updatesite/tags/$TAGNAME/dist updatesite
+</pre>
+
+<h2>Deprecated updatesite</h2>
+
+The updatesite needs to be also deployed in its deprecated location, in the IvyDE website.
+
+In your local svn working copy do:
+<pre>
+cp updatesite/trunk/dist/digest.zip* site/ivyde/updatesite
+cp updatesite/trunk/dist/site.xml site/ivyde/updatesite
+</pre>
+And commit the changes of the website.
+Next is the usual IvyDE website deployment:
+<pre>
+ant generate-site-ivyde
+svn ci target/ivyde/updatesite
+</pre>
+And on people.apache.org:
+<pre>
+svn up /www/ant.apache.org/ivy/ivyde/updatesite
+</pre>
 </textarea>
 <script type="text/javascript">xooki.postProcess();</script>
 </body>

Modified: ant/ivy/core/branches/2.0.x/doc/settings.html
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.0.x/doc/settings.html?rev=706788&r1=706787&r2=706788&view=diff
==============================================================================
--- ant/ivy/core/branches/2.0.x/doc/settings.html (original)
+++ ant/ivy/core/branches/2.0.x/doc/settings.html Tue Oct 21 14:50:11 2008
@@ -72,6 +72,7 @@
     <a href="settings/include.html">include</a>
     <a href="settings/classpath.html">classpath</a>
     <a href="settings/typedef.html">typedef</a>
+    <a href="settings/credentials.html">credentials</a>
     <a href="settings/lock-strategies.html">lock-strategies</a>
     <a href="settings/caches.html">caches</a>
         <a href="settings/caches/cache.html">cache</a>

Modified: ant/ivy/core/branches/2.0.x/doc/toc.json
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.0.x/doc/toc.json?rev=706788&r1=706787&r2=706788&view=diff
==============================================================================
--- ant/ivy/core/branches/2.0.x/doc/toc.json (original)
+++ ant/ivy/core/branches/2.0.x/doc/toc.json Tue Oct 21 14:50:11 2008
@@ -186,6 +186,13 @@
                             ]
                         },
                         {
+                          "id":"settings/credentials",
+                          "title":"credentials",
+                          "children": [
+
+                            ]
+                        },
+                        {
                           "id":"settings/lock-strategies",
                           "title":"lock-strategies",
                           "children": [

Modified: ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/ant/AntBuildTrigger.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/ant/AntBuildTrigger.java?rev=706788&r1=706787&r2=706788&view=diff
==============================================================================
--- ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/ant/AntBuildTrigger.java (original)
+++ ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/ant/AntBuildTrigger.java Tue Oct 21 14:50:11 2008
@@ -95,9 +95,11 @@
                 for (Iterator iter = atts.keySet().iterator(); iter.hasNext();) {
                     String key = (String) iter.next();
                     String value = (String) atts.get(key);
-                    Property p = ant.createProperty();
-                    p.setName(prefix == null ? key : prefix + key);
-                    p.setValue(value);
+                    if (value != null) {
+                        Property p = ant.createProperty();
+                        p.setName(prefix == null ? key : prefix + key);
+                        p.setValue(value);
+                    }
                 }
 
                 Message.verbose("triggering build: " + f + " target=" + target + " for " + event);

Modified: ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/ant/IvyAntSettings.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/ant/IvyAntSettings.java?rev=706788&r1=706787&r2=706788&view=diff
==============================================================================
--- ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/ant/IvyAntSettings.java (original)
+++ ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/ant/IvyAntSettings.java Tue Oct 21 14:50:11 2008
@@ -134,7 +134,7 @@
             return (IvyAntSettings) defaultInstanceObj;
         }
     }
-
+    
     public File getFile() {
         return file;
     }
@@ -178,7 +178,7 @@
     public void setProject(Project p) {
         super.setProject(p);
         
-        if ("ivy.instance".equals(id) && getProject().getReference(id) == null) {
+        if ("ivy.instance".equals(id) && !getProject().getReferences().containsKey(id)) {
             // register ourselfs as default settings, just in case the id attribute is not set
             getProject().addReference("ivy.instance", this);
             autoRegistered = true;
@@ -216,6 +216,10 @@
             autoRegistered = false;
         }
         this.id = id;
+        
+        if (getProject() != null) {
+            getProject().addReference(this.id, this);
+        }
     }
     
     public String getId() {

Modified: ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/ant/IvyCacheFileset.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/ant/IvyCacheFileset.java?rev=706788&r1=706787&r2=706788&view=diff
==============================================================================
--- ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/ant/IvyCacheFileset.java (original)
+++ ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/ant/IvyCacheFileset.java Tue Oct 21 14:50:11 2008
@@ -93,10 +93,20 @@
      * 
      * @param base the parent directory to which the file must be evaluated.
      * @param file the file for which the path should be returned
-     * @returnthe path of the file relative to the given base directory.
+     * @return the path of the file relative to the given base directory.
      */
     private String getPath(File base, File file) {
-        return file.getAbsolutePath().substring(base.getAbsolutePath().length() + 1);
+        String absoluteBasePath = base.getAbsolutePath();
+        
+        int beginIndex = absoluteBasePath.length();
+        
+        // checks if the basePath ends with the file separator (which can for instance
+        // happen if the basePath is the root on unix)
+        if (!absoluteBasePath.endsWith(File.separator)) {
+            beginIndex++; // skip the seperator char as well
+        }
+        
+        return file.getAbsolutePath().substring(beginIndex);
     }
 
     /**

Modified: ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/ant/IvyResolve.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/ant/IvyResolve.java?rev=706788&r1=706787&r2=706788&view=diff
==============================================================================
--- ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/ant/IvyResolve.java (original)
+++ ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/ant/IvyResolve.java Tue Oct 21 14:50:11 2008
@@ -242,6 +242,7 @@
                 }
             }
             setResolved(report, resolveId, isKeep());
+            confs = report.getConfigurations();
 
             if (isKeep()) {
                 ModuleDescriptor md = report.getModuleDescriptor();
@@ -264,15 +265,8 @@
                     getProject().setProperty("ivy.deps.changed", hasChanged.toString());
                     settings.setVariable("ivy.deps.changed", hasChanged.toString());
                 }
-                if (conf.trim().equals("*")) {
-                    getProject().setProperty("ivy.resolved.configurations",
-                        mergeConfs(md.getConfigurationsNames()));
-                    settings.setVariable("ivy.resolved.configurations", mergeConfs(md
-                            .getConfigurationsNames()));
-                } else {
-                    getProject().setProperty("ivy.resolved.configurations", conf);
-                    settings.setVariable("ivy.resolved.configurations", conf);
-                }
+                getProject().setProperty("ivy.resolved.configurations", mergeConfs(confs));
+                settings.setVariable("ivy.resolved.configurations", mergeConfs(confs));
                 if (file != null) {
                     getProject().setProperty("ivy.resolved.file", file.getAbsolutePath());
                     settings.setVariable("ivy.resolved.file", file.getAbsolutePath());
@@ -297,16 +291,10 @@
                         settings.setVariable("ivy.deps.changed." + resolveId, 
                             hasChanged.toString());
                     }
-                    if (conf.trim().equals("*")) {
-                        getProject().setProperty("ivy.resolved.configurations." + resolveId,
-                            mergeConfs(md.getConfigurationsNames()));
-                        settings.setVariable("ivy.resolved.configurations." + resolveId,
-                            mergeConfs(md.getConfigurationsNames()));
-                    } else {
-                        getProject()
-                                .setProperty("ivy.resolved.configurations." + resolveId, conf);
-                        settings.setVariable("ivy.resolved.configurations." + resolveId, conf);
-                    }
+                    getProject().setProperty("ivy.resolved.configurations." + resolveId,
+                        mergeConfs(confs));
+                    settings.setVariable("ivy.resolved.configurations." + resolveId,
+                        mergeConfs(confs));
                     if (file != null) {
                         getProject().setProperty("ivy.resolved.file." + resolveId,
                             file.getAbsolutePath());

Modified: ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/core/event/IvyEvent.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/core/event/IvyEvent.java?rev=706788&r1=706787&r2=706788&view=diff
==============================================================================
--- ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/core/event/IvyEvent.java (original)
+++ ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/core/event/IvyEvent.java Tue Oct 21 14:50:11 2008
@@ -66,6 +66,7 @@
     protected void addMridAttributes(ModuleRevisionId mrid) {
         addModuleIdAttributes(mrid.getModuleId());
         addAttribute("revision", mrid.getRevision());
+        addAttribute("branch",mrid.getBranch());
         addAttributes(mrid.getQualifiedExtraAttributes());
         addAttributes(mrid.getExtraAttributes());
     }

Modified: ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/core/event/resolve/ResolveDependencyEvent.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/core/event/resolve/ResolveDependencyEvent.java?rev=706788&r1=706787&r2=706788&view=diff
==============================================================================
--- ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/core/event/resolve/ResolveDependencyEvent.java (original)
+++ ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/core/event/resolve/ResolveDependencyEvent.java Tue Oct 21 14:50:11 2008
@@ -41,6 +41,8 @@
             dd.getDependencyRevisionId().getRevision());
         addAttribute("req-revision-dynamic", 
             dd.getDynamicConstraintDependencyRevisionId().getRevision());
+        addAttribute("req-branch", requestedRevisionId.getBranch());
+        addAttribute("req-branch-default", dd.getDependencyRevisionId().getBranch());
     }
 
     public DependencyDescriptor getDependencyDescriptor() {

Modified: ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/core/settings/XmlSettingsParser.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/core/settings/XmlSettingsParser.java?rev=706788&r1=706787&r2=706788&view=diff
==============================================================================
--- ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/core/settings/XmlSettingsParser.java (original)
+++ ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/core/settings/XmlSettingsParser.java Tue Oct 21 14:50:11 2008
@@ -46,6 +46,7 @@
 import org.apache.ivy.util.Configurator;
 import org.apache.ivy.util.FileResolver;
 import org.apache.ivy.util.Message;
+import org.apache.ivy.util.url.CredentialsStore;
 import org.apache.ivy.util.url.URLHandler;
 import org.apache.ivy.util.url.URLHandlerRegistry;
 import org.xml.sax.Attributes;
@@ -221,6 +222,8 @@
                 macrodefStarted(qName, attributes);
             } else if ("module".equals(qName)) {
                 moduleStarted(attributes);
+            } else if ("credentials".equals(qName)) {
+                credentialsStarted(attributes);
             }
         } catch (ParseException ex) {
             SAXException sax = new SAXException("problem in config file: " + ex.getMessage(), ex);
@@ -234,6 +237,14 @@
         }
     }
 
+    private void credentialsStarted(Map attributes) {
+        String realm = (String) attributes.remove("realm");
+        String host = (String) attributes.remove("host");
+        String userName = (String) attributes.remove("username");
+        String passwd = (String) attributes.remove("passwd");
+        CredentialsStore.INSTANCE.addCredentials(realm, host, userName, passwd);
+    }
+
     private void moduleStarted(Map attributes) {
         attributes.put(IvyPatternHelper.MODULE_KEY, attributes.remove("name"));
         String resolver = (String) attributes.remove("resolver");
@@ -372,8 +383,8 @@
         } else if ("get".equalsIgnoreCase(requestMethod)) {
             URLHandlerRegistry.getHttp().setRequestMethod(URLHandler.REQUEST_METHOD_GET);
         } else if ((requestMethod != null) && (requestMethod.trim().length() > 0)) {
-            throw new IllegalArgumentException("Invalid httpRequestMethod specified, must be " +
-            		"one of {'HEAD', 'GET'}");
+            throw new IllegalArgumentException("Invalid httpRequestMethod specified, must be " 
+                + "one of {'HEAD', 'GET'}");
         }
     }
 

Modified: ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/core/settings/ivy.properties
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/core/settings/ivy.properties?rev=706788&r1=706787&r2=706788&view=diff
==============================================================================
--- ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/core/settings/ivy.properties (original)
+++ ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/core/settings/ivy.properties Tue Oct 21 14:50:11 2008
@@ -29,9 +29,9 @@
 ivy.status = integration
 ivy.dep.file = ivy.xml
 ivy.settings.file = ivysettings.xml
-ivy.retrieve.pattern = ${ivy.lib.dir}/[artifact]-[revision].[ext]
-ivy.deliver.ivy.pattern = ${ivy.distrib.dir}/[type]s/[artifact]-[revision].[ext]
-ivy.publish.src.artifacts.pattern = ${ivy.distrib.dir}/[type]s/[artifact]-[revision].[ext]
+ivy.retrieve.pattern = ${ivy.lib.dir}/[artifact]-[revision](-[classifier]).[ext]
+ivy.deliver.ivy.pattern = ${ivy.distrib.dir}/[type]s/[artifact]-[revision](-[classifier]).[ext]
+ivy.publish.src.artifacts.pattern = ${ivy.distrib.dir}/[type]s/[artifact]-[revision](-[classifier]).[ext]
 ivy.cache.ttl.default = 10s
 
 ivy.report.output.pattern = [organisation]-[module]-[conf].[ext]

Modified: ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java?rev=706788&r1=706787&r2=706788&view=diff
==============================================================================
--- ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java (original)
+++ ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java Tue Oct 21 14:50:11 2008
@@ -31,6 +31,7 @@
 import java.util.Map.Entry;
 
 import org.apache.ivy.Ivy;
+import org.apache.ivy.core.cache.ArtifactOrigin;
 import org.apache.ivy.core.module.descriptor.Artifact;
 import org.apache.ivy.core.module.descriptor.Configuration;
 import org.apache.ivy.core.module.descriptor.DefaultArtifact;
@@ -50,8 +51,10 @@
 import org.apache.ivy.plugins.matcher.ExactPatternMatcher;
 import org.apache.ivy.plugins.matcher.PatternMatcher;
 import org.apache.ivy.plugins.parser.ModuleDescriptorParser;
+import org.apache.ivy.plugins.parser.ParserSettings;
 import org.apache.ivy.plugins.parser.m2.PomReader.PomDependencyData;
 import org.apache.ivy.plugins.repository.Resource;
+import org.apache.ivy.plugins.resolver.DependencyResolver;
 import org.apache.ivy.util.Message;
 
 
@@ -187,9 +190,12 @@
     private ModuleRevisionId mrid;
 
     private DefaultArtifact mainArtifact;
+    
+    private ParserSettings parserSettings;
 
     
-    public PomModuleDescriptorBuilder(ModuleDescriptorParser parser, Resource res) {
+    public PomModuleDescriptorBuilder(
+            ModuleDescriptorParser parser, Resource res, ParserSettings ivySettings) {
         ivyModuleDescriptor = new DefaultModuleDescriptor(parser, res);
         ivyModuleDescriptor.setResolvedPublicationDate(new Date(res.getLastModified()));
         for (int i = 0; i < MAVEN2_CONFIGURATIONS.length; i++) {
@@ -197,6 +203,7 @@
         }
         ivyModuleDescriptor.setMappingOverride(true);
         ivyModuleDescriptor.addExtraAttributeNamespace("m", Ivy.getIvyHomeURL() + "maven");
+        parserSettings = ivySettings;
     }
 
 
@@ -208,6 +215,12 @@
     public void setModuleRevId(String groupId, String artifactId, String version) {
         mrid = ModuleRevisionId.newInstance(groupId, artifactId, version);
         ivyModuleDescriptor.setModuleRevisionId(mrid);
+        
+        if ((version == null) || version.endsWith("SNAPSHOT")) {
+            ivyModuleDescriptor.setStatus("integration");
+        } else {
+            ivyModuleDescriptor.setStatus("release");
+        }
      }
     
     public void setHomePage(String homePage) {
@@ -232,7 +245,20 @@
          * cover all cases.
          */
         if ("pom".equals(packaging)) {
-            // no artifact defined!
+            // no artifact defined! Add the default artifact if it exist.
+            DependencyResolver resolver = parserSettings.getResolver(mrid);
+            
+            if (resolver != null) {
+                DefaultArtifact artifact = new DefaultArtifact(
+                                    mrid, new Date(), artifactId, "jar", "jar");
+                ArtifactOrigin artifactOrigin = resolver.locate(artifact);
+                
+                if (!ArtifactOrigin.isUnknown(artifactOrigin)) {
+                    mainArtifact = artifact;
+                    ivyModuleDescriptor.addArtifact("master", mainArtifact);
+                }
+            }
+
             return;
         } else if (JAR_PACKAGINGS.contains(packaging)) {
             ext = "jar";

Modified: ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java?rev=706788&r1=706787&r2=706788&view=diff
==============================================================================
--- ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java (original)
+++ ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java Tue Oct 21 14:50:11 2008
@@ -108,7 +108,8 @@
     public ModuleDescriptor parseDescriptor(ParserSettings ivySettings, URL descriptorURL, 
             Resource res, boolean validate) throws ParseException, IOException {
         
-        PomModuleDescriptorBuilder mdBuilder = new PomModuleDescriptorBuilder(this, res);
+        PomModuleDescriptorBuilder mdBuilder = new PomModuleDescriptorBuilder(
+                                                                    this, res, ivySettings);
         
         try {           
             PomReader domReader = new PomReader(descriptorURL, res);            
@@ -134,16 +135,17 @@
                 if (parentModule != null) {
                     parentDescr = parentModule.getDescriptor();
                 } else {
-                   Message.warn("impossible to load parent for " + descriptorURL + "."
-                       + " Parent=" + parentModRevID); 
+                    throw new IOException("Impossible to load parent for " + descriptorURL + "."
+                       + " Parent=" + parentModRevID);
+                }
+                if (parentDescr != null) {
+                    Map parentPomProps = PomModuleDescriptorBuilder.extractPomProperties(
+                        parentDescr.getExtraInfo());
+                    for (Iterator iter = parentPomProps.entrySet().iterator(); iter.hasNext();) {
+                        Map.Entry prop = (Map.Entry) iter.next();
+                        domReader.setProperty((String) prop.getKey(), (String) prop.getValue());
+                    }                    
                 }
-                
-                Map parentPomProps = PomModuleDescriptorBuilder.extractPomProperties(
-                                                                parentDescr.getExtraInfo());
-                for (Iterator iter = parentPomProps.entrySet().iterator(); iter.hasNext();) {
-                    Map.Entry prop = (Map.Entry) iter.next();
-                    domReader.setProperty((String) prop.getKey(), (String) prop.getValue());
-                }                    
             }
                             
             String groupId = domReader.getGroupId();

Modified: ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java?rev=706788&r1=706787&r2=706788&view=diff
==============================================================================
--- ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java (original)
+++ ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java Tue Oct 21 14:50:11 2008
@@ -17,7 +17,11 @@
  */
 package org.apache.ivy.plugins.parser.m2;
 
+import java.io.FilterInputStream;
 import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.LineNumberReader;
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -36,6 +40,8 @@
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
 import org.xml.sax.SAXParseException;
 
@@ -52,6 +58,7 @@
     private static final String DEPENDENCIES = "dependencies";
     private static final String DEPENDENCY_MGT = "dependencyManagement";
     private static final String PROJECT = "project";
+    private static final String MODEL = "model";
     private static final String GROUP_ID = "groupId";
     private static final String ARTIFACT_ID = "artifactId";
     private static final String VERSION = "version";
@@ -80,14 +87,33 @@
     private final Element parentElement;
     
     public PomReader(URL descriptorURL, Resource res) throws IOException, SAXException {
-        Document pomDomDoc = XMLHelper.parseToDom(descriptorURL, res);
-        projectElement = pomDomDoc.getDocumentElement();
-        if (!PROJECT.equals(projectElement.getNodeName())) {
-            throw new SAXParseException("project must be the root tag" , res.getName() , 
-                                        res.getName(), 0, 0);
+        InputStream stream = new AddDTDFilterInputStream(descriptorURL.openStream());
+        try {
+            Document pomDomDoc = XMLHelper.parseToDom(stream, res, new EntityResolver() {
+                public InputSource resolveEntity(String publicId, String systemId) 
+                                throws SAXException, IOException {
+                    if ((systemId != null) && systemId.endsWith("m2-entities.ent")) {
+                        return new InputSource(
+                                        PomReader.class.getResourceAsStream("m2-entities.ent"));
+                    }
+                    return null;
+                }
+            });
+            projectElement = pomDomDoc.getDocumentElement();
+            if (!PROJECT.equals(projectElement.getNodeName()) && !MODEL.equals(projectElement.getNodeName())) {
+                throw new SAXParseException("project must be the root tag" , res.getName() , 
+                                            res.getName(), 0, 0);
+            }
+            parentElement = getFirstChildElement(projectElement , PARENT);
+        } finally {
+            if (stream != null) {
+                try {
+                    stream.close();
+                } catch (IOException e) {
+                    // ignore
+                }
+            }
         }
-        parentElement = getFirstChildElement(projectElement , PARENT);
-        //TODO read the properties because it must be used to interpret every other field
     }
 
 
@@ -196,9 +222,18 @@
             if (LICENSE.equals(license.getNodeName())) {
                 String name = getFirstChildText(license, LICENSE_NAME);
                 String url = getFirstChildText(license, LICENSE_URL);
-                if (name != null || url != null) {
-                    lics.add(new License(name, url));
+                
+                if ((name == null) && (url == null)) {
+                    // move to next license
+                    continue;
+                }
+                
+                if (name == null) {
+                    // The license name is required in Ivy but not in a POM!
+                    name = "Unknown License";
                 }
+                
+                lics.add(new License(name, url));
             }
         }
         return (License[]) lics.toArray(new License[lics.size()]);
@@ -364,7 +399,8 @@
         }
 
         public boolean isOptional() {
-            return getFirstChildElement(depElement, OPTIONAL) != null;
+            Element e = getFirstChildElement(depElement, OPTIONAL); 
+            return (e != null) && "true".equalsIgnoreCase(getTextContent(e));
         }
         
         public List /*<ModuleId>*/ getExcludedModules() {
@@ -470,8 +506,75 @@
         return r;
     }
 
+    private static final class AddDTDFilterInputStream extends FilterInputStream {
+        private static final int MARK = 10000;
+        private static final String DOCTYPE = "<!DOCTYPE project SYSTEM \"m2-entities.ent\">\n";
 
+        private int count;
+        private byte[] prefix = DOCTYPE.getBytes();
+        
+        private AddDTDFilterInputStream(InputStream in) throws IOException {
+            super(in);
+            
+            if (!in.markSupported()) {
+                throw new IllegalArgumentException("The inputstream doesn't support mark");
+            }
+            
+            in.mark(MARK);
+            
+            int bytesToSkip = 0;
+            LineNumberReader reader = new LineNumberReader(new InputStreamReader(in, "UTF-8"));
+            String firstLine = reader.readLine();
+            if (firstLine != null) {
+                String trimmed = firstLine.trim();
+                if (trimmed.startsWith("<?xml ")) {
+                    int endIndex = trimmed.indexOf("?>");
+                    String xmlDecl = trimmed.substring(0, endIndex + 2);
+                    prefix = (xmlDecl + "\n" + DOCTYPE).getBytes();
+                    bytesToSkip = xmlDecl.getBytes().length;
+                }
+            }
+            
+            in.reset();
+            for (int i = 0; i < bytesToSkip; i++) {
+                in.read();
+            }
+        }
 
+        public int read() throws IOException {
+            if (count < prefix.length) {
+                return prefix[count++];
+            }
+            
+            int result = super.read();
+            return result;
+        }
+        
+        public int read(byte[] b, int off, int len) throws IOException {
+            if (b == null) {
+                throw new NullPointerException();
+            } else if ((off < 0) || (off > b.length) || (len < 0) 
+                    || ((off + len) > b.length) || ((off + len) < 0)) {
+                throw new IndexOutOfBoundsException();
+            } else if (len == 0) {
+                return 0;
+            }
 
+            int nbrBytesCopied = 0;
+            
+            if (count < prefix.length) {
+                int nbrBytesFromPrefix = Math.min(prefix.length - count, len);
+                System.arraycopy(prefix, count, b, off, nbrBytesFromPrefix);
+                nbrBytesCopied = nbrBytesFromPrefix;
+            }
+            
+            if (nbrBytesCopied < len) {
+                nbrBytesCopied += in.read(b, off + nbrBytesCopied, len - nbrBytesCopied);
+            }
+            
+            count += nbrBytesCopied;
+            return nbrBytesCopied;
+        }
+    }
 
 }

Modified: ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorWriter.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorWriter.java?rev=706788&r1=706787&r2=706788&view=diff
==============================================================================
--- ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorWriter.java (original)
+++ ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorWriter.java Tue Oct 21 14:50:11 2008
@@ -447,21 +447,21 @@
                 License license = licenses[i];
                 out.print("\t\t<license ");
                 if (license.getName() != null) {
-                    out.print("name=\"" + license.getName() + "\" ");
+                    out.print("name=\"" + XMLHelper.escape(license.getName()) + "\" ");
                 }
                 if (license.getUrl() != null) {
-                    out.print("url=\"" + license.getUrl() + "\" ");
+                    out.print("url=\"" + XMLHelper.escape(license.getUrl()) + "\" ");
                 }
                 out.println("/>");
             }
             if (md.getHomePage() != null || md.getDescription() != null) {
                 out.print("\t\t<description");
                 if (md.getHomePage() != null) {
-                    out.print(" homepage=\"" + md.getHomePage() + "\"");
+                    out.print(" homepage=\"" + XMLHelper.escape(md.getHomePage()) + "\"");
                 }
                 if (md.getDescription() != null && md.getDescription().trim().length() > 0) {
                     out.println(">");
-                    out.println("\t\t" + md.getDescription());
+                    out.println("\t\t" + XMLHelper.escape(md.getDescription()));
                     out.println("\t\t</description>");
                 } else {
                     out.println(" />");

Modified: ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/plugins/resolver/AbstractPatternsBasedResolver.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/plugins/resolver/AbstractPatternsBasedResolver.java?rev=706788&r1=706787&r2=706788&view=diff
==============================================================================
--- ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/plugins/resolver/AbstractPatternsBasedResolver.java (original)
+++ ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/plugins/resolver/AbstractPatternsBasedResolver.java Tue Oct 21 14:50:11 2008
@@ -438,7 +438,7 @@
     }
 
     protected ModuleRevisionId convertM2IdForResourceSearch(ModuleRevisionId mrid) {
-        if (mrid.getOrganisation().indexOf('.') == -1) {
+        if (mrid.getOrganisation() == null || mrid.getOrganisation().indexOf('.') == -1) {
             return mrid;
         }
         return ModuleRevisionId.newInstance(mrid.getOrganisation().replace('.', '/'), 

Modified: ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/plugins/resolver/BasicResolver.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/plugins/resolver/BasicResolver.java?rev=706788&r1=706787&r2=706788&view=diff
==============================================================================
--- ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/plugins/resolver/BasicResolver.java (original)
+++ ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/plugins/resolver/BasicResolver.java Tue Oct 21 14:50:11 2008
@@ -472,23 +472,28 @@
 
     private ModuleRevisionId getRevision(ResolvedResource ivyRef, ModuleRevisionId askedMrid,
             ModuleDescriptor md) throws ParseException {
+        Map allAttributes = new HashMap();
+        allAttributes.putAll(md.getQualifiedExtraAttributes());
+        allAttributes.putAll(askedMrid.getQualifiedExtraAttributes());
+        
         String revision = ivyRef.getRevision();
         if (revision == null) {
             Message.debug("no revision found in reference for " + askedMrid);
             if (getSettings().getVersionMatcher().isDynamic(askedMrid)) {
                 if (md.getModuleRevisionId().getRevision() == null) {
-                    return ModuleRevisionId.newInstance(askedMrid, "working@" + getName());
+                    revision = "working@" + getName();
                 } else {
-                    Message.debug("using  " + askedMrid);
-                    return askedMrid;
+                    Message.debug("using " + askedMrid);
+                    revision = askedMrid.getRevision();
                 }
             } else {
-                Message.debug("using  " + askedMrid);
-                return askedMrid;
+                Message.debug("using " + askedMrid);
+                revision = askedMrid.getRevision();
             }
-        } else {
-            return ModuleRevisionId.newInstance(askedMrid, revision);
         }
+        
+        return ModuleRevisionId.newInstance(askedMrid.getOrganisation(), askedMrid.getName(),
+                    askedMrid.getBranch(), revision, allAttributes);
     }
 
     public ResolvedModuleRevision parse(final ResolvedResource mdRef, DependencyDescriptor dd,

Modified: ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/plugins/resolver/IBiblioResolver.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/plugins/resolver/IBiblioResolver.java?rev=706788&r1=706787&r2=706788&view=diff
==============================================================================
--- ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/plugins/resolver/IBiblioResolver.java (original)
+++ ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/plugins/resolver/IBiblioResolver.java Tue Oct 21 14:50:11 2008
@@ -167,25 +167,26 @@
                 Resource metadata = getRepository().getResource(metadataLocation);
                 if (metadata.exists()) {
                     metadataStream = metadata.openStream();
-                    final StringBuffer snapshotRev = new StringBuffer();
+                    final StringBuffer timestamp = new StringBuffer();
+                    final StringBuffer buildNumer = new StringBuffer();
                     XMLHelper.parse(metadataStream, null, new ContextualSAXHandler() {
                         public void endElement(String uri, String localName, String qName) 
                                 throws SAXException {
                             if ("metadata/versioning/snapshot/timestamp".equals(getContext())) {
-                                snapshotRev.append(getText()).append("-");
+                                timestamp.append(getText());
                             }
                             if ("metadata/versioning/snapshot/buildNumber"
                                     .equals(getContext())) {
-                                snapshotRev.append(getText());
+                                buildNumer.append(getText());
                             }
                             super.endElement(uri, localName, qName);
                         }
                     }, null);
-                    if (snapshotRev.indexOf("-") != -1) {
+                    if (timestamp.length() > 0) {
                         // we have found a timestamp, so this is a snapshot unique version
                         String rev = mrid.getRevision();
                         rev = rev.substring(0, rev.length() - "SNAPSHOT".length());
-                        rev += snapshotRev;
+                        rev = rev + timestamp.toString() + "-" + buildNumer.toString();
                         
                         return rev;
                     }

Modified: ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/util/XMLHelper.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/util/XMLHelper.java?rev=706788&r1=706787&r2=706788&view=diff
==============================================================================
--- ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/util/XMLHelper.java (original)
+++ ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/util/XMLHelper.java Tue Oct 21 14:50:11 2008
@@ -30,13 +30,15 @@
 import org.apache.ivy.plugins.repository.Resource;
 import org.apache.ivy.util.url.URLHandlerRegistry;
 import org.w3c.dom.Document;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
 import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.InputSource;
 import org.xml.sax.ext.LexicalHandler;
 import org.xml.sax.helpers.DefaultHandler;
 
 public abstract class XMLHelper {
+
     private static final SAXParserFactory VALIDATING_FACTORY = SAXParserFactory.newInstance();
 
     private static final SAXParserFactory FACTORY = SAXParserFactory.newInstance();
@@ -193,23 +195,31 @@
     }
 
     
-    public static Document parseToDom(URL descriptorURL, Resource res) throws IOException,
-            SAXException {
-        DocumentBuilder docBuilder = getDocBuilder();
-        InputStream pomStream = res.openStream();
+    public static Document parseToDom(
+            InputStream stream, Resource res, EntityResolver entityResolver) 
+                throws IOException, SAXException {
+        DocumentBuilder docBuilder = getDocBuilder(entityResolver);
         Document pomDomDoc;
         try {
-            pomDomDoc = docBuilder.parse(pomStream, res.getName());
+            pomDomDoc = docBuilder.parse(stream, res.getName());
+        } catch (SAXException e) {
+            e.printStackTrace();
+            throw e;
         } finally {
-            pomStream.close();
+            stream.close();
         } 
         return pomDomDoc;
     }
 
-    public static DocumentBuilder getDocBuilder() {
+    public static DocumentBuilder getDocBuilder(EntityResolver entityResolver) {
         if (docBuilder == null) {
             try {
-                docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+                DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+                factory.setValidating(false);
+                docBuilder = factory.newDocumentBuilder();
+                if (entityResolver != null) {
+                    docBuilder.setEntityResolver(entityResolver);
+                }
             } catch (ParserConfigurationException e) {
                 throw new RuntimeException(e);
             }        

Modified: ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/util/cli/CommandLineParser.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/util/cli/CommandLineParser.java?rev=706788&r1=706787&r2=706788&view=diff
==============================================================================
--- ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/util/cli/CommandLineParser.java (original)
+++ ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/util/cli/CommandLineParser.java Tue Oct 21 14:50:11 2008
@@ -54,22 +54,34 @@
     
     public CommandLine parse(String[] args) throws ParseException {
         CommandLine line = new CommandLine();
-        for (ListIterator iterator = Arrays.asList(args).listIterator(); iterator.hasNext();) {
+        
+        int index = args.length;
+        ListIterator iterator = Arrays.asList(args).listIterator();
+        while (iterator.hasNext()) {
             String arg = (String) iterator.next();
-            if (arg.startsWith("-")) {
-                Option option = (Option) options.get(arg.substring(1));
-                if (option == null) {
-                    throw new ParseException("Unrecognized option: " + arg);
-                }
-                line.addOptionValues(arg.substring(1), option.parse(iterator));
-            } else {
-                // left over args
-                int index = iterator.previousIndex() + 1;
-                String[] leftOverArgs = new String[args.length - index];
-                System.arraycopy(args, index, leftOverArgs, 0, leftOverArgs.length);
-                line.setLeftOverArgs(leftOverArgs);
+            if ("--".equals(arg)) {
+                // skip this argument and stop looping
+                index = iterator.nextIndex();
+                break;
+            }
+
+            if (!arg.startsWith("-")) {
+                index = iterator.previousIndex();
+                break;
             }
+            
+            Option option = (Option) options.get(arg.substring(1));
+            if (option == null) {
+                throw new ParseException("Unrecognized option: " + arg);
+            }
+            line.addOptionValues(arg.substring(1), option.parse(iterator));
         }
+        
+        // left over args
+        String[] leftOverArgs = new String[args.length - index];
+        System.arraycopy(args, index, leftOverArgs, 0, leftOverArgs.length);
+        line.setLeftOverArgs(leftOverArgs);
+
         return line;
     }
 

Modified: ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/util/url/AbstractURLHandler.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/util/url/AbstractURLHandler.java?rev=706788&r1=706787&r2=706788&view=diff
==============================================================================
--- ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/util/url/AbstractURLHandler.java (original)
+++ ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/util/url/AbstractURLHandler.java Tue Oct 21 14:50:11 2008
@@ -17,12 +17,18 @@
  */
 package org.apache.ivy.util.url;
 
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
 import java.net.URL;
 import java.net.HttpURLConnection;
+import java.util.regex.Pattern;
 import java.io.IOException;
 
 public abstract class AbstractURLHandler implements URLHandler {
     
+    private static final Pattern ESCAPE_PATTERN = Pattern.compile("%25([0-9a-fA-F][0-9a-fA-F])");
+
     // the request method to use. TODO: don't use a static here
     private static int requestMethod = REQUEST_METHOD_HEAD;
 
@@ -79,4 +85,38 @@
     public int getRequestMethod() {
         return requestMethod;
     }
+    
+    protected String normalizeToString(URL url) throws IOException {
+        if (!"http".equals(url.getProtocol()) && !"https".equals(url.getProtocol())) {
+            return url.toExternalForm();
+        }
+        
+        try {
+            URI uri = new URI(url.getProtocol(), url.getUserInfo(), url.getHost(), 
+                    url.getPort(), url.getPath(), url.getQuery(), url.getRef());
+            
+            // it is possible that the original url was already (partial) escaped,
+            // so we must unescape all '%' followed by 2 hexadecimals...
+            String uriString = uri.toString();
+            
+            // manually escape the '+' character
+            uriString = uriString.replaceAll("\\+", "%2B");
+            
+            return ESCAPE_PATTERN.matcher(uriString).replaceAll("%$1");
+        } catch (URISyntaxException e) {
+            IOException ioe = new MalformedURLException("Couldn't convert '" 
+                + url.toString() + "' to a valid URI"); 
+            ioe.initCause(e); 
+            throw ioe;
+        }
+    }
+    
+    protected URL normalizeToURL(URL url) throws IOException {
+        if (!"http".equals(url.getProtocol()) && !"https".equals(url.getProtocol())) {
+            return url;
+        }
+        
+        return new URL(normalizeToString(url));
+    }
+
 }

Modified: ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/util/url/BasicURLHandler.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/util/url/BasicURLHandler.java?rev=706788&r1=706787&r2=706788&view=diff
==============================================================================
--- ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/util/url/BasicURLHandler.java (original)
+++ ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/util/url/BasicURLHandler.java Tue Oct 21 14:50:11 2008
@@ -25,13 +25,9 @@
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.net.HttpURLConnection;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URISyntaxException;
 import java.net.URL;
 import java.net.URLConnection;
 import java.net.UnknownHostException;
-import java.util.regex.Pattern;
 
 import org.apache.ivy.Ivy;
 import org.apache.ivy.util.CopyProgressListener;
@@ -42,8 +38,6 @@
  * 
  */
 public class BasicURLHandler extends AbstractURLHandler {
-    
-    private static final Pattern ESCAPE_PATTERN = Pattern.compile("%25([0-9a-fA-F][0-9a-fA-F])");
 
     private static final int BUFFER_SIZE = 64 * 1024;
 
@@ -70,7 +64,7 @@
     public URLInfo getURLInfo(URL url, int timeout) {
         URLConnection con = null;
         try {
-            url = normalize(url);
+            url = normalizeToURL(url);
             con = url.openConnection();
             con.setRequestProperty("User-Agent", "Apache Ivy/" + Ivy.getIvyVersion());
             if (con instanceof HttpURLConnection) {
@@ -101,26 +95,6 @@
         return UNAVAILABLE;
     }
 
-    private URL normalize(URL url) throws IOException {
-        if ("http".equals(url.getProtocol()) || "https".equals(url.getProtocol())) {
-            try { 
-                URI uri = new URI(url.getProtocol(), url.getUserInfo(), url.getHost(), 
-                        url.getPort(), url.getPath(), url.getQuery(), url.getRef());
-                
-                // it is possible that the original url was already (partial) escaped,
-                // so we must unescape all '%' followed by 2 hexadecimals...
-                String uriString = uri.toString();
-                url = new URL(ESCAPE_PATTERN.matcher(uriString).replaceAll("%$1"));
-            } catch (URISyntaxException e) {
-                IOException ioe = new MalformedURLException("Couldn't convert '" 
-                    + url.toString() + "' to a valid URI"); 
-                ioe.initCause(e); 
-                throw ioe;
-            }
-        }
-        return url;
-    }
-
     private boolean checkStatusCode(URL url, HttpURLConnection con) throws IOException {
         int status = con.getResponseCode();
         if (status == HttpStatus.SC_OK) {
@@ -143,7 +117,7 @@
         URLConnection conn = null;
         InputStream inStream = null;
         try {
-            url = normalize(url);
+            url = normalizeToURL(url);
             conn = url.openConnection();
             conn.setRequestProperty("User-Agent", "Apache Ivy/" + Ivy.getIvyVersion());
             if (conn instanceof HttpURLConnection) {
@@ -175,7 +149,7 @@
     public void download(URL src, File dest, CopyProgressListener l) throws IOException {
         URLConnection srcConn = null;
         try {
-            src = normalize(src);
+            src = normalizeToURL(src);
             srcConn = src.openConnection();
             srcConn.setRequestProperty("User-Agent", "Apache Ivy/" + Ivy.getIvyVersion());
             if (srcConn instanceof HttpURLConnection) {
@@ -211,7 +185,7 @@
 
         HttpURLConnection conn = null;
         try {
-            dest = normalize(dest);
+            dest = normalizeToURL(dest);
             conn = (HttpURLConnection) dest.openConnection();
             conn.setDoOutput(true);
             conn.setRequestMethod("PUT");

Modified: ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/util/url/HttpClientHandler.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/util/url/HttpClientHandler.java?rev=706788&r1=706787&r2=706788&view=diff
==============================================================================
--- ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/util/url/HttpClientHandler.java (original)
+++ ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/util/url/HttpClientHandler.java Tue Oct 21 14:50:11 2008
@@ -94,6 +94,7 @@
     public InputStream openStream(URL url) throws IOException {
         GetMethod get = doGet(url, 0);
         if (!checkStatusCode(url, get)) {
+            get.releaseConnection();
             throw new IOException(
                     "The HTTP response code for " + url + " did not indicate a success."
                             + " See log for more detail.");
@@ -103,21 +104,24 @@
 
     public void download(URL src, File dest, CopyProgressListener l) throws IOException {
         GetMethod get = doGet(src, 0);
-        // We can only figure the content we got is want we want if the status is success.
-        if (!checkStatusCode(src, get)) {
-            throw new IOException(
-                    "The HTTP response code for " + src + " did not indicate a success."
-                            + " See log for more detail.");
+        try {
+            // We can only figure the content we got is want we want if the status is success.
+            if (!checkStatusCode(src, get)) {
+                throw new IOException(
+                        "The HTTP response code for " + src + " did not indicate a success."
+                                + " See log for more detail.");
+            }
+            FileUtil.copy(get.getResponseBodyAsStream(), dest, l);
+            dest.setLastModified(getLastModified(get));
+        } finally {
+            get.releaseConnection();
         }
-        FileUtil.copy(get.getResponseBodyAsStream(), dest, l);
-        dest.setLastModified(getLastModified(get));
-        get.releaseConnection();
     }
 
     public void upload(File src, URL dest, CopyProgressListener l) throws IOException {
         HttpClient client = getClient(dest);
 
-        PutMethod put = new PutMethod(dest.toExternalForm());
+        PutMethod put = new PutMethod(normalizeToString(dest));
         put.setDoAuthentication(useAuthentication(dest) || useProxyAuthentication());
         FileInputStream fileStream = null;
         try {
@@ -133,6 +137,7 @@
                     /* ignored */
                 }
             }
+            put.releaseConnection();
         }
     }
 
@@ -238,7 +243,7 @@
         HttpClient client = getClient(url);
         client.setTimeout(timeout);
 
-        GetMethod get = new GetMethod(url.toExternalForm());
+        GetMethod get = new GetMethod(normalizeToString(url));
         get.setDoAuthentication(useAuthentication(url) || useProxyAuthentication());
         client.executeMethod(get);
         return get;
@@ -248,7 +253,7 @@
         HttpClient client = getClient(url);
         client.setTimeout(timeout);
 
-        HeadMethod head = new HeadMethod(url.toExternalForm());
+        HeadMethod head = new HeadMethod(normalizeToString(url));
         head.setDoAuthentication(useAuthentication(url) || useProxyAuthentication());
         client.executeMethod(head);
         return head;

Modified: ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/util/url/URLHandlerDispatcher.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/util/url/URLHandlerDispatcher.java?rev=706788&r1=706787&r2=706788&view=diff
==============================================================================
--- ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/util/url/URLHandlerDispatcher.java (original)
+++ ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/util/url/URLHandlerDispatcher.java Tue Oct 21 14:50:11 2008
@@ -84,7 +84,7 @@
     
     public void setRequestMethod(int requestMethod) {
         defaultHandler.setRequestMethod(requestMethod);
-        for (Iterator it = handlers.values().iterator(); it.hasNext(); ) {
+        for (Iterator it = handlers.values().iterator(); it.hasNext();) {
             URLHandler handler = (URLHandler) it.next();
             handler.setRequestMethod(requestMethod);
         }

Modified: ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/MainTest.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/MainTest.java?rev=706788&r1=706787&r2=706788&view=diff
==============================================================================
--- ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/MainTest.java (original)
+++ ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/MainTest.java Tue Oct 21 14:50:11 2008
@@ -20,6 +20,7 @@
 import java.io.File;
 
 import org.apache.ivy.util.CacheCleaner;
+import org.apache.ivy.util.cli.CommandLine;
 import org.apache.ivy.util.cli.ParseException;
 
 import junit.framework.TestCase;
@@ -84,6 +85,48 @@
         });
         assertTrue(new File("build/cache/org1/mod1.2/ivy-2.0.xml").exists());
     }
+    
+    public void testExtraParams1() throws Exception {
+        String[] params = new String[] {
+                "-settings", "test/repositories/ivysettings.xml",
+                "-confs", "default",
+                "-ivy", "test/repositories/1/org1/mod1.1/ivys/ivy-1.0.xml",
+                "foo1", "foo2"
+        };
+        CommandLine line = Main.getParser().parse(params);
+        String[] leftOver = line.getLeftOverArgs();
+        assertNotNull(leftOver);
+        assertEquals(2, leftOver.length);
+        assertEquals("foo1", leftOver[0]);
+        assertEquals("foo2", leftOver[1]);
+    }
+
+    public void testExtraParams2() throws Exception {
+        String[] params = new String[] {
+                "-settings", "test/repositories/ivysettings.xml",
+                "-confs", "default",
+                "-ivy", "test/repositories/1/org1/mod1.1/ivys/ivy-1.0.xml",
+                "--", "foo1", "foo2"
+        };
+        CommandLine line = Main.getParser().parse(params);
+        String[] leftOver = line.getLeftOverArgs();
+        assertNotNull(leftOver);
+        assertEquals(2, leftOver.length);
+        assertEquals("foo1", leftOver[0]);
+        assertEquals("foo2", leftOver[1]);
+    }
+
+    public void testExtraParams3() throws Exception {
+        String[] params = new String[] {
+                "-settings", "test/repositories/ivysettings.xml",
+                "-confs", "default",
+                "-ivy", "test/repositories/1/org1/mod1.1/ivys/ivy-1.0.xml"
+        };
+        CommandLine line = Main.getParser().parse(params);
+        String[] leftOver = line.getLeftOverArgs();
+        assertNotNull(leftOver);
+        assertEquals(0, leftOver.length);
+    }
 
     private void run(String[] args) throws Exception {
         Main.run(Main.getParser(), args);

Modified: ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/ant/IvyAntSettingsBuildFile.xml
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/ant/IvyAntSettingsBuildFile.xml?rev=706788&r1=706787&r2=706788&view=diff
==============================================================================
--- ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/ant/IvyAntSettingsBuildFile.xml (original)
+++ ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/ant/IvyAntSettingsBuildFile.xml Tue Oct 21 14:50:11 2008
@@ -39,4 +39,10 @@
 	  	<ivy:configure settingsId="testUnnecessaryDefaultIvyInstance" file="test/repositories/ivysettings.xml" override="true" />
 	  	<ivy:cachepath settingsRef="testUnnecessaryDefaultIvyInstance" file="test/java/org/apache/ivy/ant/ivy-simple.xml" pathid="ptest" />
 	  </target>
+	
+  <target name="testSettingsWithPropertyAsId">
+  	<property name="my.property" value="whatever" />
+  	<ivy:settings id="${my.property}" file="test/repositories/ivysettings.xml" />
+  	<ivy:resolve settingsRef="${my.property}" file="test/java/org/apache/ivy/ant/ivy-simple.xml" />
+  </target>
 </project>
\ No newline at end of file

Modified: ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/ant/IvyAntSettingsBuildFileTest.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/ant/IvyAntSettingsBuildFileTest.java?rev=706788&r1=706787&r2=706788&view=diff
==============================================================================
--- ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/ant/IvyAntSettingsBuildFileTest.java (original)
+++ ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/ant/IvyAntSettingsBuildFileTest.java Tue Oct 21 14:50:11 2008
@@ -47,4 +47,23 @@
         assertNull("Default ivy.instance settings shouldn't have been loaded", 
                 getProject().getReference("ivy.instance"));
     }
+    
+    public void testSettingsWithIdIvyInstance() {
+        // IVY-925
+        executeTarget("testSettingsWithPropertyAsId");
+        ResolveReport report = (ResolveReport) getProject().getReference("ivy.resolved.report");
+        assertNotNull(report);
+        assertFalse(report.hasError());
+        assertEquals(1, report.getDependencies().size());
+    }
+    
+    public void testStackOverflow() {
+        // IVY-924
+        configureProject("test/java/org/apache/ivy/ant/IvyAntSettingsBuildFileStackOverflow.xml");
+        executeTarget("testStackOverflow");
+        ResolveReport report = (ResolveReport) getProject().getReference("ivy.resolved.report");
+        assertNotNull(report);
+        assertFalse(report.hasError());
+        assertEquals(1, report.getDependencies().size());
+    }
 }

Modified: ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/ant/IvyResolveTest.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/ant/IvyResolveTest.java?rev=706788&r1=706787&r2=706788&view=diff
==============================================================================
--- ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/ant/IvyResolveTest.java (original)
+++ ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/ant/IvyResolveTest.java Tue Oct 21 14:50:11 2008
@@ -397,6 +397,10 @@
             ModuleRevisionId.newInstance("org1", "mod1.1", "2.0")).exists());
         assertFalse(getIvyFileInCache(
             ModuleRevisionId.newInstance("org1", "mod1.2", "2.0")).exists());
+
+        // test the properties
+        Project project = resolve.getProject();
+        assertFalse(project.getProperty("ivy.resolved.configurations").indexOf("default") > -1);
     }
 
     public void testResolveWithAbsoluteFile() {

Modified: ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/core/resolve/ResolveTest.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/core/resolve/ResolveTest.java?rev=706788&r1=706787&r2=706788&view=diff
==============================================================================
--- ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/core/resolve/ResolveTest.java (original)
+++ ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/core/resolve/ResolveTest.java Tue Oct 21 14:50:11 2008
@@ -27,6 +27,7 @@
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 import javax.xml.parsers.SAXParser;
 import javax.xml.parsers.SAXParserFactory;
@@ -4148,6 +4149,9 @@
         Ivy ivy = new Ivy();
         ivy.configure(new File("test/repositories/extra-attributes/ivysettings.xml"));
         ivy.getSettings().setDefaultCache(cache);
+        
+        FileSystemResolver fResolver = (FileSystemResolver) ivy.getSettings().getDefaultResolver();
+        fResolver.setCheckconsistency(false); // important for testing IVY-929
 
         ResolveReport report = ivy.resolve(ResolveTest.class.getResource("ivy-extra-att.xml"),
             getResolveOptions(ivy.getSettings(), new String[] {"*"}).setValidate(false));
@@ -4156,6 +4160,15 @@
         assertTrue(new File(cache, "apache/mymodule/task1/1854/ivy.xml").exists());
         assertTrue(new File(cache, "apache/mymodule/task1/1854/mymodule-windows.jar").exists());
         assertTrue(new File(cache, "apache/mymodule/task1/1854/mymodule-linux.jar").exists());
+        
+        Set moduleRevisions = report.getConfigurationReport("default").getModuleRevisionIds();
+        assertEquals(1, moduleRevisions.size());
+        ModuleRevisionId resolveModRevId = (ModuleRevisionId) moduleRevisions.iterator().next();
+        assertEquals("apache", resolveModRevId.getOrganisation());
+        assertEquals("mymodule", resolveModRevId.getName());
+        assertEquals("1854", resolveModRevId.getRevision());
+        assertEquals("task1", resolveModRevId.getExtraAttribute("eatt"));
+        assertEquals("another", resolveModRevId.getExtraAttribute("eatt2"));
     }
 
     public void testExtraAttributes2() throws Exception {

Modified: ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java?rev=706788&r1=706787&r2=706788&view=diff
==============================================================================
--- ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java (original)
+++ ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java Tue Oct 21 14:50:11 2008
@@ -138,7 +138,6 @@
         assertEquals("ejb", artifact[0].getType());
     }
 
-    
     public void testParent() throws Exception {
         ModuleDescriptor md = PomModuleDescriptorParser.getInstance().parseDescriptor(
             settings, getClass().getResource("test-parent.pom"), false);
@@ -152,7 +151,17 @@
         assertEquals(mrid, artifact[0].getModuleRevisionId());
         assertEquals("test", artifact[0].getName());
     }
-
+    
+    public void testParentNotFound() throws Exception {
+        try {
+            PomModuleDescriptorParser.getInstance().parseDescriptor(
+                new IvySettings(), getClass().getResource("test-parent-not-found.pom"), false);
+            fail("IOException should have been thrown!");
+        } catch (IOException e) {
+            assertTrue(e.getMessage().indexOf("Impossible to load parent") != -1);
+        }
+    }
+    
     public void testParent2() throws Exception {
         ModuleDescriptor md = PomModuleDescriptorParser.getInstance().parseDescriptor(
             settings, getClass().getResource("test-parent2.pom"), false);
@@ -384,7 +393,7 @@
 
         DependencyDescriptor[] dds = md.getDependencies();
         assertNotNull(dds);
-        assertEquals(2, dds.length);
+        assertEquals(3, dds.length);
         assertEquals(ModuleRevisionId.newInstance("commons-logging", "commons-logging", "1.0.4"),
             dds[0].getDependencyRevisionId());
         assertEquals(new HashSet(Arrays.asList(new String[] {"optional"})), new HashSet(Arrays
@@ -402,6 +411,15 @@
             new HashSet(Arrays.asList(dds[1].getDependencyConfigurations("compile"))));
         assertEquals(new HashSet(Arrays.asList(new String[] {"runtime(*)"})), new HashSet(Arrays
                 .asList(dds[1].getDependencyConfigurations("runtime"))));
+
+        assertEquals(ModuleRevisionId.newInstance("cglib", "cglib-extra", "2.0.2"), dds[2]
+                .getDependencyRevisionId());
+        assertEquals(new HashSet(Arrays.asList(new String[] {"compile", "runtime"})), new HashSet(
+                Arrays.asList(dds[2].getModuleConfigurations())));
+        assertEquals(new HashSet(Arrays.asList(new String[] {"master(*)", "compile(*)"})),
+            new HashSet(Arrays.asList(dds[2].getDependencyConfigurations("compile"))));
+        assertEquals(new HashSet(Arrays.asList(new String[] {"runtime(*)"})), new HashSet(Arrays
+                .asList(dds[2].getDependencyConfigurations("runtime"))));
     }
 
     public void testDependenciesWithScope() throws Exception {
@@ -615,10 +633,32 @@
         
         assertEquals(ModuleRevisionId.newInstance("org.apache", "test-version-other", "5.76"), dds[0]
                 .getDependencyRevisionId());//present in the pom using a property defined in the parent
-
-        
     }
     
+    public void testPomWithEntity() throws Exception {
+        ModuleDescriptor md = PomModuleDescriptorParser.getInstance().parseDescriptor(
+            settings, getClass().getResource("test-entity.pom"), true);
+        assertNotNull(md);        
+    }
+    
+    public void testModel() throws Exception {
+        ModuleDescriptor md = PomModuleDescriptorParser.getInstance().parseDescriptor(
+            settings, getClass().getResource("test-model.pom"), false);
+        assertNotNull(md);
+
+        ModuleRevisionId mrid = ModuleRevisionId.newInstance("org.apache", "test", "1.0");
+        assertEquals(mrid, md.getModuleRevisionId());
 
+        assertNotNull(md.getConfigurations());
+        assertEquals(Arrays.asList(PomModuleDescriptorBuilder.MAVEN2_CONFIGURATIONS), Arrays
+                .asList(md.getConfigurations()));
+
+        Artifact[] artifact = md.getArtifacts("master");
+        assertEquals(1, artifact.length);
+        assertEquals(mrid, artifact[0].getModuleRevisionId());
+        assertEquals("test", artifact[0].getName());
+        assertEquals("jar", artifact[0].getExt());
+        assertEquals("jar", artifact[0].getType());
+    }
 
 }

Modified: ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/plugins/parser/m2/test-optional.pom
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/plugins/parser/m2/test-optional.pom?rev=706788&r1=706787&r2=706788&view=diff
==============================================================================
--- ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/plugins/parser/m2/test-optional.pom (original)
+++ ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/plugins/parser/m2/test-optional.pom Tue Oct 21 14:50:11 2008
@@ -33,12 +33,18 @@
       <groupId>commons-logging</groupId>
       <artifactId>commons-logging</artifactId>
       <version>1.0.4</version>
-      <optional/>
+      <optional>true</optional>
     </dependency>
     <dependency>
       <groupId>cglib</groupId>
       <artifactId>cglib</artifactId>
       <version>2.0.2</version>
     </dependency>
+    <dependency>
+      <groupId>cglib</groupId>
+      <artifactId>cglib-extra</artifactId>
+      <version>2.0.2</version>
+      <optional>false</optional>
+    </dependency>
   </dependencies>
 </project>

Modified: ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/plugins/parser/m2/test-write-dependencies-optional.xml
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/plugins/parser/m2/test-write-dependencies-optional.xml?rev=706788&r1=706787&r2=706788&view=diff
==============================================================================
--- ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/plugins/parser/m2/test-write-dependencies-optional.xml (original)
+++ ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/plugins/parser/m2/test-write-dependencies-optional.xml Tue Oct 21 14:50:11 2008
@@ -43,5 +43,11 @@
       <version>2.0.2</version>
       <scope>compile</scope>
     </dependency>
+    <dependency>
+      <groupId>cglib</groupId>
+      <artifactId>cglib-extra</artifactId>
+      <version>2.0.2</version>
+      <scope>compile</scope>
+    </dependency>
   </dependencies>
 </project>

Modified: ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/plugins/parser/xml/test-write-full.xml
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/plugins/parser/xml/test-write-full.xml?rev=706788&r1=706787&r2=706788&view=diff
==============================================================================
--- ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/plugins/parser/xml/test-write-full.xml (original)
+++ ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/plugins/parser/xml/test-write-full.xml Tue Oct 21 14:50:11 2008
@@ -27,7 +27,7 @@
 	>
 		<license name="MyLicense" url="http://www.my.org/mymodule/mylicense.html" />
 		<description homepage="http://www.my.org/mymodule/">
-		This module is <b>great</b> !<br/>
+		This module is &lt;b>great&lt;/b> !&lt;br/>
 	You can use it especially with myconf1 and myconf2, and myconf4 is not too bad too.
 		</description>
 		<e:someExtra>56576</e:someExtra>

Modified: ant/ivy/core/branches/2.0.x/test/repositories/extra-attributes/mymodule/task1/1854/ivy.xml
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.0.x/test/repositories/extra-attributes/mymodule/task1/1854/ivy.xml?rev=706788&r1=706787&r2=706788&view=diff
==============================================================================
--- ant/ivy/core/branches/2.0.x/test/repositories/extra-attributes/mymodule/task1/1854/ivy.xml (original)
+++ ant/ivy/core/branches/2.0.x/test/repositories/extra-attributes/mymodule/task1/1854/ivy.xml Tue Oct 21 14:50:11 2008
@@ -22,6 +22,7 @@
         organisation="apache"
         module="mymodule"
         eatt="task1"
+        eatt2="another"
         revision="1854"
         status="integration">
 	</info>



Mime
View raw message