svn commit: r602223 - /ant/ivy/core/trunk/doc/ivyfile/dependency-artifact.html

2007-12-07 Thread maartenc
Author: maartenc
Date: Fri Dec  7 13:05:12 2007
New Revision: 602223

URL: http://svn.apache.org/viewvc?rev=602223view=rev
Log:
The dependency artifact element is extensible as well

Modified:
ant/ivy/core/trunk/doc/ivyfile/dependency-artifact.html

Modified: ant/ivy/core/trunk/doc/ivyfile/dependency-artifact.html
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/doc/ivyfile/dependency-artifact.html?rev=602223r1=60r2=602223view=diff
==
--- ant/ivy/core/trunk/doc/ivyfile/dependency-artifact.html (original)
+++ ant/ivy/core/trunk/doc/ivyfile/dependency-artifact.html Fri Dec  7 13:05:12 
2007
@@ -46,6 +46,8 @@
 
 span class=sincesince 1.4/span It's possible to indicate the url at 
which the artifact can be found. This is not mandatory, and even not 
recommended with an enterprise repository. Note that Ivy will always look at 
the location where the artifact should be and only use the url if it cannot be 
found at the standard location in the repository.
 
+span class=sincesince 1.4/span This tag supports a 
href=../concept.html#extraextra attributes/a.
+
 span class=sincesince 2.0/span This feature can also be used for modules 
having their own module descriptor, but which doesn't declare an artifact you 
know that is published. Note that in this case artifacts declared to be 
published by the dependency will be ignored, so do not forget to include all 
artifacts you want.
 
 h1Attributes/h1




svn commit: r605039 - /ant/ivy/core/trunk/ivy.xml

2007-12-17 Thread maartenc
Author: maartenc
Date: Mon Dec 17 15:16:31 2007
New Revision: 605039

URL: http://svn.apache.org/viewvc?rev=605039view=rev
Log:
Fixed a NPE when running the junit tests with JDK 1.4.

Modified:
ant/ivy/core/trunk/ivy.xml

Modified: ant/ivy/core/trunk/ivy.xml
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/ivy.xml?rev=605039r1=605038r2=605039view=diff
==
--- ant/ivy/core/trunk/ivy.xml (original)
+++ ant/ivy/core/trunk/ivy.xml Mon Dec 17 15:16:31 2007
@@ -52,6 +52,7 @@

!-- This dependency is necessary for having validation in 
junit tests when running with JDK1.4 --
dependency org=xerces name=xercesImpl rev=2.6.2 
conf=test-default /
+   dependency org=xerces name=xmlParserAPIs rev=2.6.2 
conf=test-default /

!-- Global exclude for junit --
exclude org=junit module=junit conf=core,default /




svn commit: r605343 - in /ant/ivy/core/trunk: CHANGES.txt src/java/org/apache/ivy/plugins/resolver/AbstractResourceResolver.java test/java/org/apache/ivy/plugins/resolver/FileSystemResolverTest.java

2007-12-18 Thread maartenc
Author: maartenc
Date: Tue Dec 18 14:20:56 2007
New Revision: 605343

URL: http://svn.apache.org/viewvc?rev=605343view=rev
Log:
FIX: Ivy doesn't respect the order of the ivy patterns as defined in the 
settings (IVY-676)

Modified:
ant/ivy/core/trunk/CHANGES.txt

ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractResourceResolver.java

ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/FileSystemResolverTest.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=605343r1=605342r2=605343view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Tue Dec 18 14:20:56 2007
@@ -61,6 +61,7 @@
 
 - IMPROVEMENT: Decrease memory footprint (IVY-662)
 
+- FIX: Ivy doesn't respect the order of the ivy patterns as defined in the 
settings (IVY-676)
 - FIX: XmlModuleDescriptorWriter doesn't write the deprecated attribute of the 
ivy-module/configurations/conf element (IVY-664)
 - FIX: XMLModuleDescriptorWriter does not write extra attributes (IVY-471) 
(with contribution from Mikkel Bjerg)
 - FIX: latest compatible conflict manager fails with circular dependencies and 
dynamic revision (IVY-663)

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractResourceResolver.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractResourceResolver.java?rev=605343r1=605342r2=605343view=diff
==
--- 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractResourceResolver.java
 (original)
+++ 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractResourceResolver.java
 Tue Dec 18 14:20:56 2007
@@ -27,6 +27,7 @@
 import java.util.List;
 import java.util.ListIterator;
 import java.util.Map;
+import java.util.Set;
 
 import org.apache.ivy.core.IvyContext;
 import org.apache.ivy.core.IvyPatternHelper;
@@ -88,13 +89,16 @@
 protected ResolvedResource findResourceUsingPatterns(ModuleRevisionId 
moduleRevision,
 List patternList, Artifact artifact, ResourceMDParser rmdparser, 
Date date) {
 List resolvedResources = new ArrayList();
+Set foundRevisions = new HashSet();
 boolean dynamic = 
getSettings().getVersionMatcher().isDynamic(moduleRevision);
 boolean stop = false;
 for (Iterator iter = patternList.iterator(); iter.hasNext()  !stop;) 
{
 String pattern = (String) iter.next();
 ResolvedResource rres = findResourceUsingPattern(
 moduleRevision, pattern, artifact, rmdparser, date);
-if (rres != null) {
+if ((rres != null)  
!foundRevisions.contains(rres.getRevision())) {
+// only add the first found ResolvedResource for each revision
+foundRevisions.add(rres.getRevision());
 resolvedResources.add(rres);
 stop = !dynamic; // stop iterating if we are not searching a 
dynamic revision
 }

Modified: 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/FileSystemResolverTest.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/FileSystemResolverTest.java?rev=605343r1=605342r2=605343view=diff
==
--- 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/FileSystemResolverTest.java
 (original)
+++ 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/FileSystemResolverTest.java
 Tue Dec 18 14:20:56 2007
@@ -46,6 +46,7 @@
 import org.apache.ivy.core.sort.SortEngine;
 import org.apache.ivy.plugins.latest.LatestRevisionStrategy;
 import org.apache.ivy.plugins.latest.LatestTimeStrategy;
+import org.apache.ivy.plugins.resolver.util.ResolvedResource;
 import org.apache.ivy.util.CacheCleaner;
 import org.apache.ivy.util.FileUtil;
 
@@ -147,6 +148,23 @@
 
 assertEquals(artifact, ar.getArtifact());
 assertEquals(DownloadStatus.NO, ar.getDownloadStatus());
+}
+
+public void testFindIvyFileRefWithMultipleIvyPatterns() throws Exception {
+// cfr IVY-676
+FileSystemResolver resolver = new FileSystemResolver();
+resolver.setName(test);
+resolver.setSettings(settings);
+
resolver.addIvyPattern(test/repositories/multi-ivypattern/ivy1/ivy-[revision].xml);
+
resolver.addIvyPattern(test/repositories/multi-ivypattern/ivy2/ivy-[revision].xml);
+
+ModuleRevisionId mrid = ModuleRevisionId.newInstance(org1, mod1.1, 
1.0+);
+ResolvedResource ivyRef = resolver.findIvyFileRef(
+new DefaultDependencyDescriptor(mrid, false), data);
+
+// check that the found ivy file is the one from the first pattern!
+assertEquals(test

svn commit: r607335 - in /ant/ivy/core/trunk/src/java/org/apache/ivy/core: cache/DefaultResolutionCacheManager.java check/CheckEngine.java

2007-12-28 Thread maartenc
Author: maartenc
Date: Fri Dec 28 13:20:18 2007
New Revision: 607335

URL: http://svn.apache.org/viewvc?rev=607335view=rev
Log:
Removed unused imports

Modified:

ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/DefaultResolutionCacheManager.java
ant/ivy/core/trunk/src/java/org/apache/ivy/core/check/CheckEngine.java

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/DefaultResolutionCacheManager.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/DefaultResolutionCacheManager.java?rev=607335r1=607334r2=607335view=diff
==
--- 
ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/DefaultResolutionCacheManager.java
 (original)
+++ 
ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/DefaultResolutionCacheManager.java
 Fri Dec 28 13:20:18 2007
@@ -22,7 +22,6 @@
 
 import org.apache.ivy.core.IvyPatternHelper;
 import org.apache.ivy.core.module.id.ModuleRevisionId;
-import org.apache.ivy.core.settings.IvySettings;
 
 public class DefaultResolutionCacheManager implements ResolutionCacheManager {
 private static final String DEFAULT_CACHE_RESOLVED_IVY_PATTERN = 

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/check/CheckEngine.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/check/CheckEngine.java?rev=607335r1=607334r2=607335view=diff
==
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/check/CheckEngine.java 
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/check/CheckEngine.java Fri 
Dec 28 13:20:18 2007
@@ -25,7 +25,6 @@
 import java.util.Iterator;
 import java.util.Set;
 
-import org.apache.ivy.core.cache.DefaultResolutionCacheManager;
 import org.apache.ivy.core.module.descriptor.Artifact;
 import org.apache.ivy.core.module.descriptor.DependencyDescriptor;
 import org.apache.ivy.core.module.descriptor.ModuleDescriptor;




svn commit: r609034 - /ant/ivy/core/trunk/CHANGES.txt

2008-01-04 Thread maartenc
Author: maartenc
Date: Fri Jan  4 14:35:55 2008
New Revision: 609034

URL: http://svn.apache.org/viewvc?rev=609034view=rev
Log:
Fixed JIRA issue number

Modified:
ant/ivy/core/trunk/CHANGES.txt

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=609034r1=609033r2=609034view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Fri Jan  4 14:35:55 2008
@@ -60,7 +60,7 @@
 =
 - NEW: Introduce RepositoryManagementEngine (IVY-665 - not completed yet)
 
-- IMPROVEMENT: use ModuleRevisionId instead of ModuleId in 
IvySettings#getResolver (IVY-591)
+- IMPROVEMENT: use ModuleRevisionId instead of ModuleId in 
IvySettings#getResolver (IVY-691)
 - IMPROVEMENT: Flexible cache management (IVY-399 - not completed yet)
 - IMPROVEMENT: Decrease memory footprint (IVY-662)
 - IMPROVEMENT: Downgrade Ant version requirement to 1.6 to build Ivy (IVY-687)




svn commit: r610562 - in /ant/ivy/core/trunk: ./ src/java/org/apache/ivy/ant/ src/java/org/apache/ivy/core/ src/java/org/apache/ivy/core/retrieve/ src/java/org/apache/ivy/core/settings/ test/java/org/

2008-01-09 Thread maartenc
Author: maartenc
Date: Wed Jan  9 13:02:58 2008
New Revision: 610562

URL: http://svn.apache.org/viewvc?rev=610562view=rev
Log:
NEW: Add support for importing environment variables (IVY-608)

Modified:
ant/ivy/core/trunk/CHANGES.txt
ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyAntVariableContainer.java
ant/ivy/core/trunk/src/java/org/apache/ivy/core/IvyPatternHelper.java

ant/ivy/core/trunk/src/java/org/apache/ivy/core/retrieve/RetrieveEngineSettings.java
ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java

ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvyVariableContainer.java

ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvyVariableContainerImpl.java

ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/XmlSettingsParser.java
ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyConfigureTest.java
ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyTaskTest.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=610562r1=610561r2=610562view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Wed Jan  9 13:02:58 2008
@@ -59,6 +59,7 @@
version in SVN
 =
 - NEW: Introduce RepositoryManagementEngine (IVY-665 - not completed yet)
+- NEW: Add support for importing environment variables (IVY-608)
 
 - IMPROVEMENT: Make IBiblio resolver compatible with maven proxy (IVY-466)
 - IMPROVEMENT: Use namespace aware validation (IVY-553)

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyAntVariableContainer.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyAntVariableContainer.java?rev=610562r1=610561r2=610562view=diff
==
--- ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyAntVariableContainer.java 
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyAntVariableContainer.java 
Wed Jan  9 13:02:58 2008
@@ -26,6 +26,7 @@
 import org.apache.ivy.core.settings.IvyVariableContainerImpl;
 import org.apache.ivy.util.Message;
 import org.apache.tools.ant.Project;
+import org.apache.tools.ant.taskdefs.Property;
 
 class IvyAntVariableContainer extends IvyVariableContainerImpl implements 
IvyVariableContainer {
 
@@ -48,13 +49,6 @@
 return r;
 }
 
-public Map getVariables() {
-Map r = new HashMap(super.getVariables());
-r.putAll(project.getProperties());
-r.putAll(overwrittenProperties);
-return r;
-}
-
 public void setVariable(String varName, String value, boolean overwrite) {
 if (overwrite) {
 Message.debug(setting ' + varName + ' to ' + value + ');
@@ -88,6 +82,14 @@
 if (id != null) {
 setPropertyIfNotSet((String) entry.getKey() + . + id, 
(String) entry.getValue());
 }
+}
+
+if (getEnvironmentPrefix() != null) {
+Property propTask = new Property();
+propTask.setProject(project);
+propTask.setEnvironment(getEnvironmentPrefix());
+propTask.init();
+propTask.execute();
 }
 }
 

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/IvyPatternHelper.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/IvyPatternHelper.java?rev=610562r1=610561r2=610562view=diff
==
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/IvyPatternHelper.java 
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/IvyPatternHelper.java Wed 
Jan  9 13:02:58 2008
@@ -31,7 +31,8 @@
 import org.apache.ivy.core.module.descriptor.Artifact;
 import org.apache.ivy.core.module.descriptor.DefaultArtifact;
 import org.apache.ivy.core.module.id.ModuleRevisionId;
-import org.apache.ivy.plugins.resolver.DependencyResolver;
+import org.apache.ivy.core.settings.IvyVariableContainer;
+import org.apache.ivy.core.settings.IvyVariableContainerImpl;
 import org.apache.ivy.util.Message;
 
 /**
@@ -151,15 +152,15 @@
 return substituteTokens(pattern, tokens);
 }
 
-public static String substitute(String pattern, Map variables, Map tokens) 
{
-return substituteTokens(substituteVariables(pattern, variables), 
tokens);
+public static String substituteVariables(String pattern, Map variables) {
+return substituteVariables(pattern, new 
IvyVariableContainerImpl(variables), new Stack());
 }
 
-public static String substituteVariables(String pattern, Map variables) {
+public static String substituteVariables(String pattern, 
IvyVariableContainer variables) {
 return substituteVariables(pattern, variables, new Stack());
 }
 
-private static String

svn commit: r618445 - in /ant/ivy/core/trunk: CHANGES.txt src/java/org/apache/ivy/core/resolve/ResolveEngine.java test/java/org/apache/ivy/ant/IvyResolveTest.java test/java/org/apache/ivy/core/resolve

2008-02-04 Thread maartenc
Author: maartenc
Date: Mon Feb  4 13:24:17 2008
New Revision: 618445

URL: http://svn.apache.org/viewvc?rev=618445view=rev
Log:
FIX: NullPointerException reported instead of error in ivy:cachepath (IVY-690)

Added:

ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveEngineTest.java
Modified:
ant/ivy/core/trunk/CHANGES.txt
ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveEngine.java
ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyResolveTest.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=618445r1=618444r2=618445view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Mon Feb  4 13:24:17 2008
@@ -77,6 +77,7 @@
 - IMPROVEMENT: Downgrade Ant version requirement to 1.6 to build Ivy (IVY-687)
 - IMPROVEMENT: In the ResolveReport class, add the possibility to filter the 
evicted module while getting the list of DownloadArtifact (IVY-704) (thanks to 
Nicolas Lalevée)
 
+- FIX: NullPointerException reported instead of error in ivy:cachepath 
(IVY-690)
 - FIX: NPE when calling retrieve if some artifacts are not available locally 
(IVY-712)
 - FIX: When in ssh plugin we does not set username in scheme, Ivy always try 
to connect with guest username, even if we change one in panel. (IVY-710) 
(thanks to Ruslan Shevchenko)
 - FIX: NPE in SshCache during publish with ssh resolver without passFile 
(IVY-709) (thanks to Ruslan Shevchenko)

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveEngine.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveEngine.java?rev=618445r1=618444r2=618445view=diff
==
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveEngine.java 
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveEngine.java 
Mon Feb  4 13:24:17 2008
@@ -36,6 +36,7 @@
 
 import org.apache.ivy.Ivy;
 import org.apache.ivy.core.IvyContext;
+import org.apache.ivy.core.LogOptions;
 import org.apache.ivy.core.cache.ResolutionCacheManager;
 import org.apache.ivy.core.event.EventManager;
 import org.apache.ivy.core.event.download.PrepareDownloadEvent;
@@ -142,6 +143,7 @@
 public ResolveReport resolve(final ModuleRevisionId mrid, ResolveOptions 
options,
 boolean changing) throws ParseException, IOException {
 DefaultModuleDescriptor md;
+ResolveOptions optionsToUse = new ResolveOptions(options);
 
 if (options.useSpecialConfs()) {
 // create new resolve options because this is a different resolve 
than the real resolve
@@ -149,17 +151,12 @@
 ResolvedModuleRevision rmr = findModule(mrid, new 
ResolveOptions(options));
 if (rmr == null) {
 Message.verbose(module not found  + mrid);
+
+// we will continue the resolve anyway to get a nice error 
message back
+// to the user, however reduce the amount of logging in this 
case
+optionsToUse.setLog(LogOptions.LOG_DOWNLOAD_ONLY);
 md = DefaultModuleDescriptor.newCallerInstance(mrid, 
-options.getConfs(rmr.getDescriptor()), 
options.isTransitive(), changing);
-return new ResolveReport(md, options.getResolveId()) {
-public boolean hasError() {
-return true;
-}
-
-public List getProblemMessages() {
-return Arrays.asList(new String[] {module not found: 
 + mrid});
-}
-};
+new String[] {default}, options.isTransitive(), 
changing);
 } else {
 String[] confs = options.getConfs(rmr.getDescriptor());
 md = 
DefaultModuleDescriptor.newCallerInstance(ModuleRevisionId.newInstance(mrid,
@@ -170,7 +167,7 @@
 , options.isTransitive(), changing);
 }
 
-return resolve(md, options);
+return resolve(md, optionsToUse);
 }
 
 /**

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyResolveTest.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyResolveTest.java?rev=618445r1=618444r2=618445view=diff
==
--- ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyResolveTest.java 
(original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyResolveTest.java Mon Feb 
 4 13:24:17 2008
@@ -116,6 +116,20 @@
 assertTrue(getArchiveFileInCache(org1, mod1.2, 2.0, mod1.2, 
jar, jar).exists());
 }
 
+public void testInlineForNonExistingModule() throws Exception {
+resolve.setOrganisation(org1XX

svn commit: r629603 - /ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java

2008-02-20 Thread maartenc
Author: maartenc
Date: Wed Feb 20 12:31:13 2008
New Revision: 629603

URL: http://svn.apache.org/viewvc?rev=629603view=rev
Log:
Made this class JDK 1.4 compatible

Modified:
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java?rev=629603r1=629602r2=629603view=diff
==
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java 
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java 
Wed Feb 20 12:31:13 2008
@@ -177,7 +177,7 @@
 }
 }
 
-public Iterable/* PomDependencyData */ getDependencies() {
+public List /* PomDependencyData */ getDependencies() {
 Element dependenciesElement = getFirstChildElement(projectElement, 
DEPENDENCIES);
 LinkedList dependencies = new LinkedList();
 if (dependenciesElement != null) {
@@ -193,7 +193,7 @@
 }
 
 
-public Iterable/* PomDependencyMgt */ getDependencyMgt() {
+public List /* PomDependencyMgt */ getDependencyMgt() {
 Element dependenciesElement = getFirstChildElement(projectElement, 
DEPENDENCY_MGT);
 dependenciesElement = getFirstChildElement(dependenciesElement, 
DEPENDENCIES);
 LinkedList dependencies = new LinkedList();
@@ -260,7 +260,7 @@
 return getFirstChildElement(depElement, OPTIONAL) != null;
 }
 
-public Iterable/*ModuleId*/ getExcludedModules() {
+public List /*ModuleId*/ getExcludedModules() {
 Element exclusionsElement = getFirstChildElement(depElement, 
EXCLUSIONS);
 LinkedList exclusions = new LinkedList();
 if (exclusionsElement != null) {
@@ -290,7 +290,7 @@
 }
 for (Iterator it = getAllChilds(propsEl).iterator(); it.hasNext();) {
 Element prop = (Element) it.next();
-pomProperties.put(prop.getNodeName(), prop.getTextContent());
+pomProperties.put(prop.getNodeName(), getTextContent(prop));
 }
 return pomProperties;
 }
@@ -304,18 +304,32 @@
 }
 }
 
-
+private static String getTextContent(Element element) {
+StringBuffer result = new StringBuffer();
+
+NodeList childNodes = element.getChildNodes();
+for (int i = 0; i  childNodes.getLength(); i++) {
+Node child = childNodes.item(i);
+
+switch (child.getNodeType()) {
+case Node.CDATA_SECTION_NODE:
+case Node.TEXT_NODE:
+result.append(child.getNodeValue());
+break;
+}
+}
+
+return result.toString();
+}
 
 private static String getFirstChildText(Element parentElem, String name) {
 Element node = getFirstChildElement(parentElem, name);
 if (node != null) {
-node.normalize();
-return node.getTextContent();
+return getTextContent(node);
 } else {
 return null;
 }
 }
-
 
 private static Element getFirstChildElement(Element parentElem, String 
name) {
 if (parentElem == null) {




svn commit: r631384 - /ant/ivy/core/trunk/CHANGES.txt

2008-02-26 Thread maartenc
Author: maartenc
Date: Tue Feb 26 13:19:01 2008
New Revision: 631384

URL: http://svn.apache.org/viewvc?rev=631384view=rev
Log:
Corrected the typo in my name

Modified:
ant/ivy/core/trunk/CHANGES.txt

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=631384r1=631383r2=631384view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Tue Feb 26 13:19:01 2008
@@ -6,7 +6,7 @@
 for detailed view of each issue, please consult 
http://issues.apache.org/jira/browse/IVY
 
  Committers
-   Maarteen Coene
+   Maarten Coene
Xavier Hanin
Gilles Scokart
   




svn commit: r633315 - /ant/ivy/core/trunk/build.xml

2008-03-03 Thread maartenc
Author: maartenc
Date: Mon Mar  3 14:50:58 2008
New Revision: 633315

URL: http://svn.apache.org/viewvc?rev=633315view=rev
Log:
Specify the directory to run the junit tests from (this will allow NetBeans 
users to run the junit tests)

Modified:
ant/ivy/core/trunk/build.xml

Modified: ant/ivy/core/trunk/build.xml
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/build.xml?rev=633315r1=633314r2=633315view=diff
==
--- ant/ivy/core/trunk/build.xml (original)
+++ ant/ivy/core/trunk/build.xml Mon Mar  3 14:50:58 2008
@@ -437,6 +437,7 @@
showoutput=no
printsummary=yes
includeantruntime=yes
+   dir=${basedir}
fork=true
 classpath
 path refid=test.classpath /




svn commit: r638096 - in /ant/ivy/core/trunk: ./ src/java/org/apache/ivy/plugins/matcher/ test/java/org/apache/ivy/plugins/matcher/

2008-03-17 Thread maartenc
Author: maartenc
Date: Mon Mar 17 15:12:58 2008
New Revision: 638096

URL: http://svn.apache.org/viewvc?rev=638096view=rev
Log:
IMPROVEMENT: Smarter determination if an expression is exact or not for 
RegexpPatternMatcher and GlobPatternMatcher

Modified:
ant/ivy/core/trunk/CHANGES.txt

ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/matcher/ExactOrRegexpPatternMatcher.java

ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/matcher/GlobPatternMatcher.java

ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/matcher/RegexpPatternMatcher.java

ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/matcher/AbstractPatternMatcherTest.java

ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/matcher/ExactOrRegexpPatternMatcherTest.java

ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/matcher/ExactPatternMatcherTest.java

ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/matcher/GlobPatternMatcherTest.java

ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/matcher/RegexpPatternMatcherTest.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=638096r1=638095r2=638096view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Mon Mar 17 15:12:58 2008
@@ -71,6 +71,7 @@
 - IMPROVEMENT: add branch attribute in ivy:install task (IVY-727)
 - IMPROVEMENT: Parse description information in ivy files (IVY-766)
 - IMPROVEMENT: Parse description and home page from poms (IVY-767)
+- IMPROVEMENT: Smarter determination if an expression is exact or not for 
RegexpPatternMatcher and GlobPatternMatcher
 
 - FIX: Ivy reports a conflict when the same file is supposed to be retrieved 
at the same location twice (or more) (IVY-743)
 - FIX: StackOverflowError when configuration extends itself (IVY-696)

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/matcher/ExactOrRegexpPatternMatcher.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/matcher/ExactOrRegexpPatternMatcher.java?rev=638096r1=638095r2=638096view=diff
==
--- 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/matcher/ExactOrRegexpPatternMatcher.java
 (original)
+++ 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/matcher/ExactOrRegexpPatternMatcher.java
 Mon Mar 17 15:12:58 2008
@@ -56,7 +56,7 @@
 }
 
 public boolean isExact() {
-return false;
+return regexp.isExact(); //  exact.isExact();
 }
 }
 }

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/matcher/GlobPatternMatcher.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/matcher/GlobPatternMatcher.java?rev=638096r1=638095r2=638096view=diff
==
--- 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/matcher/GlobPatternMatcher.java
 (original)
+++ 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/matcher/GlobPatternMatcher.java
 Mon Mar 17 15:12:58 2008
@@ -56,8 +56,12 @@
 
 private static class GlobMatcher implements Matcher {
 private Pattern pattern;
+private String expression;
 
+private Boolean exact;
+
 public GlobMatcher(String expression) throws PatternSyntaxException {
+this.expression = expression;
 try {
 pattern = new GlobCompiler().compile(expression);
 } catch (MalformedPatternException e) {
@@ -73,7 +77,25 @@
 }
 
 public boolean isExact() {
-return false;
+if (exact == null) {
+exact = calculateExact();
+}
+return exact.booleanValue();
+}
+
+private Boolean calculateExact() {
+Boolean result = Boolean.TRUE;
+
+char[] expressionChars = expression.toCharArray();
+for (int i = 0; i  expressionChars.length; i++) {
+char ch = expressionChars[i];
+if (ch == '*' || ch == '?' || ch == '[' || ch == ']') {
+result = Boolean.FALSE;
+break;
+}
+}
+
+return result;
 }
 }
 

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/matcher/RegexpPatternMatcher.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/matcher/RegexpPatternMatcher.java?rev=638096r1=638095r2=638096view=diff
==
--- 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/matcher/RegexpPatternMatcher.java
 (original)
+++ 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/matcher/RegexpPatternMatcher.java
 Mon Mar 17 15:12:58 2008

svn commit: r638606 - in /ant/ivy/core/trunk: ./ src/java/org/apache/ivy/ant/ src/java/org/apache/ivy/core/ src/java/org/apache/ivy/core/install/ src/java/org/apache/ivy/core/search/ src/java/org/apac

2008-03-18 Thread maartenc
Author: maartenc
Date: Tue Mar 18 15:13:04 2008
New Revision: 638606

URL: http://svn.apache.org/viewvc?rev=638606view=rev
Log:
FIX: repreport task not working against a repository structured by branches 
(IVY-716)

Added:
ant/ivy/core/trunk/test/repositories/IVY-716/
ant/ivy/core/trunk/test/repositories/IVY-716/ivysettings.xml
ant/ivy/core/trunk/test/repositories/IVY-716/org1/
ant/ivy/core/trunk/test/repositories/IVY-716/org1/branch1/
ant/ivy/core/trunk/test/repositories/IVY-716/org1/branch1/mod1.1/
ant/ivy/core/trunk/test/repositories/IVY-716/org1/branch1/mod1.1/1.0/

ant/ivy/core/trunk/test/repositories/IVY-716/org1/branch1/mod1.1/1.0/ivy.xml.txt

ant/ivy/core/trunk/test/repositories/IVY-716/org1/branch1/mod1.1/1.0/mod1.1.jar
ant/ivy/core/trunk/test/repositories/IVY-716/org1/branch2/
ant/ivy/core/trunk/test/repositories/IVY-716/org1/branch2/mod1.1/
ant/ivy/core/trunk/test/repositories/IVY-716/org1/branch2/mod1.1/1.0/

ant/ivy/core/trunk/test/repositories/IVY-716/org1/branch2/mod1.1/1.0/ivy.xml.txt

ant/ivy/core/trunk/test/repositories/IVY-716/org1/branch2/mod1.1/1.0/mod1.1.jar
Modified:
ant/ivy/core/trunk/CHANGES.txt
ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyRepositoryReport.java
ant/ivy/core/trunk/src/java/org/apache/ivy/core/IvyPatternHelper.java
ant/ivy/core/trunk/src/java/org/apache/ivy/core/install/InstallEngine.java
ant/ivy/core/trunk/src/java/org/apache/ivy/core/search/SearchEngine.java

ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractResolver.java

ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractResourceResolver.java

ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/DependencyResolver.java

ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/RepositoryResolver.java
ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyRepositoryReportTest.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=638606r1=638605r2=638606view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Tue Mar 18 15:13:04 2008
@@ -73,6 +73,7 @@
 - IMPROVEMENT: Parse description and home page from poms (IVY-767)
 - IMPROVEMENT: Smarter determination if an expression is exact or not for 
RegexpPatternMatcher and GlobPatternMatcher
 
+- FIX: repreport task not working against a repository structured by branches 
(IVY-716)
 - FIX: Ivy reports a conflict when the same file is supposed to be retrieved 
at the same location twice (or more) (IVY-743)
 - FIX: StackOverflowError when configuration extends itself (IVY-696)
 - FIX: XML schema ambiguity (IVY-750)

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyRepositoryReport.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyRepositoryReport.java?rev=638606r1=638605r2=638606view=diff
==
--- ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyRepositoryReport.java 
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyRepositoryReport.java Tue 
Mar 18 15:13:04 2008
@@ -20,12 +20,15 @@
 import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Set;
 
 import org.apache.ivy.Ivy;
 import org.apache.ivy.core.cache.ResolutionCacheManager;
 import org.apache.ivy.core.module.descriptor.DefaultModuleDescriptor;
+import org.apache.ivy.core.module.descriptor.ModuleDescriptor;
 import org.apache.ivy.core.module.id.ModuleId;
 import org.apache.ivy.core.module.id.ModuleRevisionId;
 import org.apache.ivy.core.report.ResolveReport;
@@ -87,18 +90,24 @@
 ModuleRevisionId mrid = ModuleRevisionId.newInstance(organisation, 
module, revision);
 
 try {
-ModuleId[] mids = ivy.listModules(new ModuleId(organisation, 
module), settings
-.getMatcher(matcher));
-ModuleRevisionId[] mrids = new ModuleRevisionId[mids.length];
+ModuleRevisionId criteria = null;
+
+if ((revision == null) || 
settings.getVersionMatcher().isDynamic(mrid)) {
+criteria = new ModuleRevisionId(new ModuleId(organisation, 
module), branch, *);
+} else {
+criteria = new ModuleRevisionId(new ModuleId(organisation, 
module), branch, revision);
+}
+
+ModuleRevisionId[] mrids = ivy.listModules(criteria, 
settings.getMatcher(matcher));
+
+// replace all found revisions with the original requested revision
+Set modules = new HashSet();
 for (int i = 0; i  mrids.length; i++) {
-if (branch != null) {
-mrids[i] = new

svn commit: r638632 - in /ant/ivy/core/trunk/src/java/org/apache/ivy: Ivy.java core/install/InstallEngine.java

2008-03-18 Thread maartenc
Author: maartenc
Date: Tue Mar 18 16:03:10 2008
New Revision: 638632

URL: http://svn.apache.org/viewvc?rev=638632view=rev
Log:
Removed some unused code.

Modified:
ant/ivy/core/trunk/src/java/org/apache/ivy/Ivy.java
ant/ivy/core/trunk/src/java/org/apache/ivy/core/install/InstallEngine.java

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/Ivy.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/Ivy.java?rev=638632r1=638631r2=638632view=diff
==
--- ant/ivy/core/trunk/src/java/org/apache/ivy/Ivy.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/Ivy.java Tue Mar 18 16:03:10 2008
@@ -295,7 +295,7 @@
 }
 if (installEngine == null) {
 installEngine = new InstallEngine(
-settings, searchEngine, resolveEngine, publishEngine);
+settings, searchEngine, resolveEngine);
 }
 if (repositoryEngine == null) {
 repositoryEngine = new RepositoryManagementEngine(

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/core/install/InstallEngine.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/install/InstallEngine.java?rev=638632r1=638631r2=638632view=diff
==
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/install/InstallEngine.java 
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/install/InstallEngine.java 
Tue Mar 18 16:03:10 2008
@@ -20,9 +20,7 @@
 import java.io.File;
 import java.io.IOException;
 import java.util.Arrays;
-import java.util.Collection;
 import java.util.Date;
-import java.util.Iterator;
 
 import org.apache.ivy.core.module.descriptor.Configuration;
 import org.apache.ivy.core.module.descriptor.DefaultDependencyDescriptor;
@@ -30,7 +28,6 @@
 import org.apache.ivy.core.module.descriptor.ModuleDescriptor;
 import org.apache.ivy.core.module.id.ModuleId;
 import org.apache.ivy.core.module.id.ModuleRevisionId;
-import org.apache.ivy.core.publish.PublishEngine;
 import org.apache.ivy.core.report.ArtifactDownloadReport;
 import org.apache.ivy.core.report.ResolveReport;
 import org.apache.ivy.core.resolve.DownloadOptions;
@@ -50,16 +47,13 @@
 
 private ResolveEngine resolveEngine;
 
-private PublishEngine publishEngine;
-
 private SearchEngine searchEngine;
 
 public InstallEngine(InstallEngineSettings settings, SearchEngine 
searchEngine,
-ResolveEngine resolveEngine, PublishEngine publishEngine) {
+ResolveEngine resolveEngine) {
 this.settings = settings;
 this.searchEngine = searchEngine;
 this.resolveEngine = resolveEngine;
-this.publishEngine = publishEngine;
 }
 
 public ResolveReport install(ModuleRevisionId mrid, String from, String 
to, 




svn commit: r639439 - in /ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser: AbstractModuleDescriptorParserTester.java m2/PomModuleDescriptorParserTest.java xml/XmlModuleDescriptorParserTest.

2008-03-20 Thread maartenc
Author: maartenc
Date: Thu Mar 20 13:26:32 2008
New Revision: 639439

URL: http://svn.apache.org/viewvc?rev=639439view=rev
Log:
JUnit tests didn't compile anymore on JDK1.4

Modified:

ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParserTester.java

ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java

ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParserTest.java

Modified: 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParserTester.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParserTester.java?rev=639439r1=639438r2=639439view=diff
==
--- 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParserTester.java
 (original)
+++ 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParserTester.java
 Thu Mar 20 13:26:32 2008
@@ -57,6 +57,30 @@
 assertTrue(artifact not found:  + artifactsNames[i], found);
 }
 }
+
+
+protected static String convertEOL(String str) {
+StringBuffer buffer = new StringBuffer();
+
+char[] chars = str.toCharArray();
+char last = ' ';
+for (int i = 0; i  chars.length; i++) {
+if ((chars[i] == '\r')  (last == '\n')) {
+last = '\r';
+continue; 
+}
+if (chars[i] == '\r') {
+buffer.append('\n');
+} else {
+buffer.append(chars[i]);
+}
+last = chars[i];
+}
+
+return buffer.toString();
+}
+
+
 
 protected void assertDependencyArtifacts(DependencyDescriptor dd, String[] 
confs,
 String[] artifactsNames) {

Modified: 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java?rev=639439r1=639438r2=639439view=diff
==
--- 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java
 (original)
+++ 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java
 Thu Mar 20 13:26:32 2008
@@ -478,9 +478,8 @@
+ framework. It is designed\nas a 
light-weight, event-driven component  
+ technology that handles communication with disparate 
systems\n 
+ transparently providing a simple component 
interface., 
-   md.getDescription().replace(\n\r, \n).replace(\r, 
\n));
+   convertEOL(md.getDescription()));
 }
-
 
 public void testDependencyManagment() throws ParseException, IOException {
 ModuleDescriptor md = 
PomModuleDescriptorParser.getInstance().parseDescriptor(

Modified: 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParserTest.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParserTest.java?rev=639439r1=639438r2=639439view=diff
==
--- 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParserTest.java
 (original)
+++ 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParserTest.java
 Thu Mar 20 13:26:32 2008
@@ -207,7 +207,7 @@
 assertEquals(This module is bgreat/b !br/\n\t
+ You can use it especially with myconf1 and myconf2, 
+ and myconf4 is not too bad too., 
-   md.getDescription().replace(\n\r, \n).replace(\r, 
\n));
+   convertEOL(md.getDescription()));
 
 assertEquals(1, md.getExtraInfo().size());
 assertEquals(56576, md.getExtraInfo().get(e:someExtra));




svn commit: r639445 - in /ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser: AbstractModuleDescriptorParserTester.java m2/PomModuleDescriptorParserTest.java xml/XmlModuleDescriptorParserTest.

2008-03-20 Thread maartenc
Author: maartenc
Date: Thu Mar 20 13:37:28 2008
New Revision: 639445

URL: http://svn.apache.org/viewvc?rev=639445view=rev
Log:
Reverted last commit and modified the code so it will compile with JDK1.4 and 
is more consistent with the EOL checks in other tests.

Modified:

ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParserTester.java

ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java

ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParserTest.java

Modified: 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParserTester.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParserTester.java?rev=639445r1=639444r2=639445view=diff
==
--- 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParserTester.java
 (original)
+++ 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParserTester.java
 Thu Mar 20 13:37:28 2008
@@ -57,30 +57,6 @@
 assertTrue(artifact not found:  + artifactsNames[i], found);
 }
 }
-
-
-protected static String convertEOL(String str) {
-StringBuffer buffer = new StringBuffer();
-
-char[] chars = str.toCharArray();
-char last = ' ';
-for (int i = 0; i  chars.length; i++) {
-if ((chars[i] == '\r')  (last == '\n')) {
-last = '\r';
-continue; 
-}
-if (chars[i] == '\r') {
-buffer.append('\n');
-} else {
-buffer.append(chars[i]);
-}
-last = chars[i];
-}
-
-return buffer.toString();
-}
-
-
 
 protected void assertDependencyArtifacts(DependencyDescriptor dd, String[] 
confs,
 String[] artifactsNames) {

Modified: 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java?rev=639445r1=639444r2=639445view=diff
==
--- 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java
 (original)
+++ 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java
 Thu Mar 20 13:37:28 2008
@@ -478,7 +478,7 @@
+ framework. It is designed\nas a 
light-weight, event-driven component  
+ technology that handles communication with disparate 
systems\n 
+ transparently providing a simple component 
interface., 
-   convertEOL(md.getDescription()));
+   md.getDescription().replaceAll(\r\n, 
\n).replace('\r', '\n'));
 }
 
 public void testDependencyManagment() throws ParseException, IOException {

Modified: 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParserTest.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParserTest.java?rev=639445r1=639444r2=639445view=diff
==
--- 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParserTest.java
 (original)
+++ 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParserTest.java
 Thu Mar 20 13:37:28 2008
@@ -207,7 +207,7 @@
 assertEquals(This module is bgreat/b !br/\n\t
+ You can use it especially with myconf1 and myconf2, 
+ and myconf4 is not too bad too., 
-   convertEOL(md.getDescription()));
+   md.getDescription().replaceAll(\r\n, 
\n).replace('\r', '\n'));
 
 assertEquals(1, md.getExtraInfo().size());
 assertEquals(56576, md.getExtraInfo().get(e:someExtra));




svn commit: r641617 - in /ant/ivy/core/trunk: ivy.xml test/java/org/apache/ivy/ant/IvyAntSettingsBuildFile.xml test/java/org/apache/ivy/ant/IvyAntSettingsBuildFileTest.java

2008-03-26 Thread maartenc
Author: maartenc
Date: Wed Mar 26 15:44:06 2008
New Revision: 641617

URL: http://svn.apache.org/viewvc?rev=641617view=rev
Log:
Added junit tests for IVY-771.

Added:
ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyAntSettingsBuildFile.xml

ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyAntSettingsBuildFileTest.java
Modified:
ant/ivy/core/trunk/ivy.xml

Modified: ant/ivy/core/trunk/ivy.xml
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/ivy.xml?rev=641617r1=641616r2=641617view=diff
==
--- ant/ivy/core/trunk/ivy.xml (original)
+++ ant/ivy/core/trunk/ivy.xml Wed Mar 26 15:44:06 2008
@@ -50,6 +50,8 @@
!-- Test dependencies --
dependency org=junit name=junit rev=3.8.2 
conf=test-default /
dependency org=commons-lang name=commons-lang 
rev=[1.0,3.0[ conf=test-default /
+   dependency org=org.apache.ant name=ant-testutil 
rev=1.7.0 conf=test-default transitive=false /
+   dependency org=ant name=ant-launcher rev=1.6 
conf=test-default transitive=false/

!-- This dependency is necessary for having validation in 
junit tests when running with JDK1.4 --
dependency org=xerces name=xercesImpl rev=2.6.2 
conf=test-default /

Added: 
ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyAntSettingsBuildFile.xml
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyAntSettingsBuildFile.xml?rev=641617view=auto
==
--- ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyAntSettingsBuildFile.xml 
(added)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyAntSettingsBuildFile.xml 
Wed Mar 26 15:44:06 2008
@@ -0,0 +1,37 @@
+!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   License); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+--
+project xmlns:ivy=antlib:org.apache.ivy.ant basedir=../../../../../..
+  target name=setUp
+property name=ivy.cache.repository value=build/cache /
+  /target
+
+  target name=tearDown
+   delete dir=build/cache /
+  /target
+
+  target name=testOverrideNotSpecified
+   ivy:settings id=test1 file=test/repositories/ivysettings.xml /
+   ivy:resolve settingsRef=test1 
file=test/java/org/apache/ivy/ant/ivy-simple.xml /
+  /target
+
+  target name=testOverrideSetToFalse
+   ivy:settings id=test2 file=test/repositories/ivysettings.xml 
override=false /
+   ivy:resolve settingsRef=test2 
file=test/java/org/apache/ivy/ant/ivy-simple.xml /
+  /target
+/project
\ No newline at end of file

Added: 
ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyAntSettingsBuildFileTest.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyAntSettingsBuildFileTest.java?rev=641617view=auto
==
--- 
ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyAntSettingsBuildFileTest.java
 (added)
+++ 
ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyAntSettingsBuildFileTest.java
 Wed Mar 26 15:44:06 2008
@@ -0,0 +1,45 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the License); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an AS IS BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+package org.apache.ivy.ant;
+
+import org.apache.ivy.core.report.ResolveReport;
+import org.apache.tools.ant.BuildFileTest;
+
+public class IvyAntSettingsBuildFileTest extends BuildFileTest {
+
+protected void setUp() throws Exception

svn commit: r642405 - in /ant/ivy/core/trunk: CHANGES.txt src/java/org/apache/ivy/ant/IvyBuildList.java test/buildlist/E2/ test/buildlist/E2/build.xml test/buildlist/E2/ivy.xml test/java/org/apache/iv

2008-03-28 Thread maartenc
Author: maartenc
Date: Fri Mar 28 15:10:53 2008
New Revision: 642405

URL: http://svn.apache.org/viewvc?rev=642405view=rev
Log:
FIX: buildlist evicts modules with the same name, but different organisation 
(IVY-731)

Added:
ant/ivy/core/trunk/test/buildlist/E2/
ant/ivy/core/trunk/test/buildlist/E2/build.xml
ant/ivy/core/trunk/test/buildlist/E2/ivy.xml
Modified:
ant/ivy/core/trunk/CHANGES.txt
ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyBuildList.java
ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyBuildListTest.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=642405r1=642404r2=642405view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Fri Mar 28 15:10:53 2008
@@ -75,6 +75,7 @@
 - IMPROVEMENT: Parse description and home page from poms (IVY-767)
 - IMPROVEMENT: Smarter determination if an expression is exact or not for 
RegexpPatternMatcher and GlobPatternMatcher
 
+- FIX: buildlist evicts modules with the same name, but different organisation 
(IVY-731)
 - FIX: Out of memory/Stack overflow for new highly coupled project (IVY-595)
 - FIX: Compatibility with maven's dependencyMangement (IVY-753) (not completed 
yet)
 - FIX: ivy:settings fails when override is not set to 'true' (IVY-771)

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyBuildList.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyBuildList.java?rev=642405r1=642404r2=642405view=diff
==
--- ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyBuildList.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyBuildList.java Fri Mar 28 
15:10:53 2008
@@ -22,8 +22,8 @@
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Iterator;
-import java.util.LinkedHashMap;
 import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.ListIterator;
@@ -153,8 +153,8 @@
 Path path = new Path(getProject());
 
 Map buildFiles = new HashMap(); // Map (ModuleDescriptor - File 
buildFile)
-Map mdsMap = new LinkedHashMap(); // Map (String moduleName - 
ModuleDescriptor)
 List independent = new ArrayList();
+Collection mds = new ArrayList();
 
 Set rootModuleNames = new LinkedHashSet();
 if (!*.equals(root)) {
@@ -202,7 +202,7 @@
 ModuleDescriptor md = 
ModuleDescriptorParserRegistry.getInstance()
 .parseDescriptor(settings, ivyFile.toURL(), 
doValidate(settings));
 buildFiles.put(md, buildFile);
-
mdsMap.put(md.getModuleRevisionId().getModuleId().getName(), md);
+mds.add(md);
 Message.debug(Add  + 
md.getModuleRevisionId().getModuleId());
 } catch (Exception ex) {
 if (haltOnError) {
@@ -220,13 +220,12 @@
 }
 
 List leafModuleDescriptors = 
-convertModuleNamesToModuleDescriptors(mdsMap, leafModuleNames, 
leaf);
+convertModuleNamesToModuleDescriptors(mds, leafModuleNames, 
leaf);
 List rootModuleDescriptors = 
-convertModuleNamesToModuleDescriptors(mdsMap, rootModuleNames, 
root);
+convertModuleNamesToModuleDescriptors(mds, rootModuleNames, 
root);
 List restartFromModuleDescriptors = 
-convertModuleNamesToModuleDescriptors(mdsMap, 
restartFromModuleNames, restartFrom);
+convertModuleNamesToModuleDescriptors(mds, restartFromModuleNames, 
restartFrom);
 
-Collection mds = new ArrayList(mdsMap.values());
 if (!rootModuleDescriptors.isEmpty()) {
 Message.info(Filtering modules based on roots  + 
rootModuleNames);
 mds = filterModulesFromRoot(mds, rootModuleDescriptors);
@@ -248,7 +247,7 @@
 Collections.reverse(sortedModules);
 }
 // Remove modules that are before the restartFrom point
-// Independant modules (without valid ivy file) can not be addressed
+// Independent modules (without valid ivy file) can not be addressed
 // so they are not removed from build path.
 if (!restartFromModuleDescriptors.isEmpty()) {
 boolean foundRestartFrom = false;
@@ -280,19 +279,37 @@
 getProject().addReference(getReference(), path);
 getProject().setProperty(ivy.sorted.modules, order.toString());
 }
+
+private List convertModuleNamesToModuleDescriptors(Collection mds, Set 
moduleNames, String kind) {
+List result = new ArrayList();
+Set foundModuleNames = new HashSet();
+
+for (Iterator it = mds.iterator(); it.hasNext

svn commit: r642406 - /ant/ivy/core/trunk/src/java/org/apache/ivy/Main.java

2008-03-28 Thread maartenc
Author: maartenc
Date: Fri Mar 28 15:16:34 2008
New Revision: 642406

URL: http://svn.apache.org/viewvc?rev=642406view=rev
Log:
Removed unused field.

Modified:
ant/ivy/core/trunk/src/java/org/apache/ivy/Main.java

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/Main.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/Main.java?rev=642406r1=642405r2=642406view=diff
==
--- ant/ivy/core/trunk/src/java/org/apache/ivy/Main.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/Main.java Fri Mar 28 15:16:34 
2008
@@ -67,7 +67,6 @@
  */
 public final class Main {
 private static final int HELP_WIDTH = 80;
-private static PrintWriter out = new PrintWriter(System.out);
 
 static CommandLineParser getParser() {
 return new CommandLineParser()




svn commit: r642425 - in /ant/ivy/core/trunk: CHANGES.txt src/java/org/apache/ivy/ant/IvyPostResolveTask.java test/java/org/apache/ivy/ant/IvyRetrieveBuildFile.xml test/java/org/apache/ivy/ant/IvyRetr

2008-03-28 Thread maartenc
Author: maartenc
Date: Fri Mar 28 16:24:38 2008
New Revision: 642425

URL: http://svn.apache.org/viewvc?rev=642425view=rev
Log:
FIX: multiple cleancache and inline retrieve error (IVY-778)

Added:
ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyRetrieveBuildFile.xml

ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyRetrieveBuildFileTest.java
Modified:
ant/ivy/core/trunk/CHANGES.txt
ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyPostResolveTask.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=642425r1=642424r2=642425view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Fri Mar 28 16:24:38 2008
@@ -75,6 +75,7 @@
 - IMPROVEMENT: Parse description and home page from poms (IVY-767)
 - IMPROVEMENT: Smarter determination if an expression is exact or not for 
RegexpPatternMatcher and GlobPatternMatcher
 
+- FIX: multiple cleancache and inline retrieve error (IVY-778)
 - FIX: buildlist evicts modules with the same name, but different organisation 
(IVY-731)
 - FIX: Out of memory/Stack overflow for new highly coupled project (IVY-595)
 - FIX: Compatibility with maven's dependencyMangement (IVY-753) (not completed 
yet)

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyPostResolveTask.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyPostResolveTask.java?rev=642425r1=642424r2=642425view=diff
==
--- ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyPostResolveTask.java 
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyPostResolveTask.java Fri 
Mar 28 16:24:38 2008
@@ -20,8 +20,10 @@
 import java.io.File;
 import java.util.Arrays;
 import java.util.HashSet;
+import java.util.Iterator;
 
 import org.apache.ivy.Ivy;
+import org.apache.ivy.core.cache.ResolutionCacheManager;
 import org.apache.ivy.core.module.descriptor.ModuleDescriptor;
 import org.apache.ivy.core.module.id.ModuleId;
 import org.apache.ivy.core.module.id.ModuleRevisionId;
@@ -245,7 +247,24 @@
 } else {
 confs = splitConfs(conf);
 }
+
 HashSet rconfsSet = new HashSet(Arrays.asList(rconfs));
+
+// for each resolved configuration, check if the report still 
exists
+ResolutionCacheManager cache = 
getSettings().getResolutionCacheManager();
+for (Iterator it = rconfsSet.iterator(); it.hasNext(); ) {
+String resolvedConf = (String) it.next();
+String resolveId = getResolveId();
+if (resolveId == null) {
+resolveId = ResolveOptions.getDefaultResolveId(reference);
+}
+File report = 
cache.getConfigurationResolveReportInCache(resolveId, resolvedConf);
+if (!report.exists()) {
+// the report doesn't exist any longer, we have to 
recreate it...
+it.remove();
+}
+}
+
 HashSet confsSet = new HashSet(Arrays.asList(confs));
 Message.debug(resolved configurations:+ rconfsSet);
 Message.debug(asked configurations:   + confsSet);

Added: ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyRetrieveBuildFile.xml
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyRetrieveBuildFile.xml?rev=642425view=auto
==
--- ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyRetrieveBuildFile.xml 
(added)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyRetrieveBuildFile.xml 
Fri Mar 28 16:24:38 2008
@@ -0,0 +1,35 @@
+!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   License); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+--
+project xmlns:ivy=antlib:org.apache.ivy.ant basedir=../../../../../..
+  target name=setUp
+property name=ivy.cache.repository value=build/cache /
+  /target
+
+  target name=tearDown
+   delete dir=build/cache /
+  /target
+
+  target name

svn commit: r643112 - /ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyBuildListTest.java

2008-03-31 Thread maartenc
Author: maartenc
Date: Mon Mar 31 12:33:10 2008
New Revision: 643112

URL: http://svn.apache.org/viewvc?rev=643112view=rev
Log:
Attempt to fix the failing test on gump.

Modified:
ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyBuildListTest.java

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyBuildListTest.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyBuildListTest.java?rev=643112r1=643111r2=643112view=diff
==
--- ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyBuildListTest.java 
(original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyBuildListTest.java Mon 
Mar 31 12:33:10 2008
@@ -18,6 +18,9 @@
 package org.apache.ivy.ant;
 
 import java.io.File;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
 
 import junit.framework.TestCase;
 
@@ -521,10 +524,15 @@
 .getAbsolutePath());
 assertEquals(new File(test/buildlist/D/build.xml).getAbsolutePath(), 
new File(files[3])
 .getAbsolutePath());
-assertEquals(new 
File(test/buildlist/E2/build.xml).getAbsolutePath(), new File(files[4])
-.getAbsolutePath());
-assertEquals(new File(test/buildlist/E/build.xml).getAbsolutePath(), 
new File(files[5])
-.getAbsolutePath());
+
+// the order of E and E2 is undefined
+List other = new ArrayList();
+other.add(new File(files[4]).getAbsoluteFile().toURI());
+other.add(new File(files[5]).getAbsoluteFile().toURI());
+Collections.sort(other);
+
+assertEquals(new 
File(test/buildlist/E/build.xml).getAbsoluteFile().toURI(), other.get(0));
+assertEquals(new 
File(test/buildlist/E2/build.xml).getAbsoluteFile().toURI(), other.get(1));
 }
 
 }




svn commit: r643139 - in /ant/ivy/core/trunk/test/java/org/apache/ivy: IvyTest.java MainTest.java

2008-03-31 Thread maartenc
Author: maartenc
Date: Mon Mar 31 13:38:07 2008
New Revision: 643139

URL: http://svn.apache.org/viewvc?rev=643139view=rev
Log:
A little code cleanup

Modified:
ant/ivy/core/trunk/test/java/org/apache/ivy/IvyTest.java
ant/ivy/core/trunk/test/java/org/apache/ivy/MainTest.java

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/IvyTest.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/IvyTest.java?rev=643139r1=643138r2=643139view=diff
==
--- ant/ivy/core/trunk/test/java/org/apache/ivy/IvyTest.java (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/IvyTest.java Mon Mar 31 
13:38:07 2008
@@ -20,12 +20,9 @@
 import java.io.File;
 
 import org.apache.ivy.core.IvyContext;
-import org.apache.ivy.core.cache.DefaultResolutionCacheManager;
 import org.apache.ivy.core.report.ResolveReport;
 import org.apache.ivy.core.resolve.ResolveOptions;
-import org.apache.ivy.core.resolve.ResolveTest;
 import org.apache.ivy.core.settings.IvySettings;
-import org.apache.ivy.util.Message;
 import org.apache.ivy.util.MockMessageLogger;
 
 import junit.framework.TestCase;
@@ -43,7 +40,6 @@
 assertFalse(IvyContext should be cleared and return a default Ivy 
instance, 
 IvyContext.getContext().getIvy() == ivy);
 
-File cache = new File(build/cache);
 ResolveReport report = ivy.resolve(new File(
 test/repositories/1/org1/mod1.1/ivys/ivy-1.0.xml).toURL(),
 getResolveOptions(ivy, new String[] {*}));

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/MainTest.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/MainTest.java?rev=643139r1=643138r2=643139view=diff
==
--- ant/ivy/core/trunk/test/java/org/apache/ivy/MainTest.java (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/MainTest.java Mon Mar 31 
13:38:07 2008
@@ -19,8 +19,6 @@
 
 import java.io.File;
 
-import org.apache.ivy.core.cache.DefaultRepositoryCacheManager;
-import org.apache.ivy.core.module.id.ModuleRevisionId;
 import org.apache.ivy.util.CacheCleaner;
 import org.apache.ivy.util.cli.ParseException;
 




svn commit: r643180 - in /ant/ivy/core/trunk: CHANGES.txt src/java/org/apache/ivy/plugins/resolver/RepositoryResolver.java test/java/org/apache/ivy/ant/IvyResolveTest.java test/repositories/norev/ivy.

2008-03-31 Thread maartenc
Author: maartenc
Date: Mon Mar 31 15:15:41 2008
New Revision: 643180

URL: http://svn.apache.org/viewvc?rev=643180view=rev
Log:
FIX: resolve fails to put metadata in cache (IVY-779)

Modified:
ant/ivy/core/trunk/CHANGES.txt

ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/RepositoryResolver.java
ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyResolveTest.java
ant/ivy/core/trunk/test/repositories/norev/ivy.xml

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=643180r1=643179r2=643180view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Mon Mar 31 15:15:41 2008
@@ -75,6 +75,7 @@
 - IMPROVEMENT: Parse description and home page from poms (IVY-767)
 - IMPROVEMENT: Smarter determination if an expression is exact or not for 
RegexpPatternMatcher and GlobPatternMatcher
 
+- FIX: resolve fails to put metadata in cache (IVY-779)
 - FIX: multiple cleancache and inline retrieve error (IVY-778)
 - FIX: buildlist evicts modules with the same name, but different organisation 
(IVY-731)
 - FIX: Out of memory/Stack overflow for new highly coupled project (IVY-595)

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/RepositoryResolver.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/RepositoryResolver.java?rev=643180r1=643179r2=643180view=diff
==
--- 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/RepositoryResolver.java
 (original)
+++ 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/RepositoryResolver.java
 Mon Mar 31 15:15:41 2008
@@ -20,6 +20,7 @@
 import java.io.ByteArrayInputStream;
 import java.io.File;
 import java.io.IOException;
+import java.text.ParseException;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -32,9 +33,12 @@
 import org.apache.ivy.core.event.EventManager;
 import org.apache.ivy.core.module.descriptor.Artifact;
 import org.apache.ivy.core.module.descriptor.DefaultArtifact;
+import org.apache.ivy.core.module.descriptor.ModuleDescriptor;
 import org.apache.ivy.core.module.id.ModuleRevisionId;
 import org.apache.ivy.core.report.DownloadReport;
 import org.apache.ivy.core.resolve.DownloadOptions;
+import org.apache.ivy.plugins.parser.ModuleDescriptorParser;
+import org.apache.ivy.plugins.parser.ModuleDescriptorParserRegistry;
 import org.apache.ivy.plugins.repository.AbstractRepository;
 import org.apache.ivy.plugins.repository.Repository;
 import org.apache.ivy.plugins.repository.Resource;
@@ -85,8 +89,26 @@
 Resource res = repository.getResource(resourceName);
 boolean reachable = res.exists();
 if (reachable) {
-String revision = 
pattern.indexOf(IvyPatternHelper.REVISION_KEY) == -1 
-? working@ + name : mrid.getRevision();
+String revision;
+if (pattern.indexOf(IvyPatternHelper.REVISION_KEY) == -1) {
+if (ivy.equals(artifact.getType()) || 
pom.equals(artifact.getType())) {
+// we can't determine the revision from the 
pattern, get it
+// from the moduledescriptor itself
+File temp = File.createTempFile(ivy, 
artifact.getExt());
+temp.deleteOnExit();
+repository.get(res.getName(), temp);
+ModuleDescriptorParser parser = 
ModuleDescriptorParserRegistry.getInstance().getParser(res);
+ModuleDescriptor md = 
parser.parseDescriptor(getSettings(), temp.toURL(), res, false);
+revision = md.getRevision();
+if ((revision == null) || (revision.length() == 
0)) {
+revision = working@ + name;
+}
+} else {
+revision = working@ + name;
+}
+} else {
+revision = mrid.getRevision();
+}
 return new ResolvedResource(res, revision);
 } else if (versionMatcher.isDynamic(mrid)) {
 return findDynamicResourceUsingPattern(
@@ -100,6 +122,9 @@
 return findDynamicResourceUsingPattern(rmdparser, mrid, 
pattern, artifact, date);
 }
 } catch (IOException ex) {
+throw new RuntimeException(name + : unable to get resource for  
+ mrid + : res=
++ IvyPatternHelper.substitute(pattern, mrid, artifact) + 
:  + ex, ex);
+} catch (ParseException ex) {
 throw new RuntimeException(name

svn commit: r643599 - in /ant/ivy/core/trunk: CHANGES.txt doc/ivyfile/info.html

2008-04-01 Thread maartenc
Author: maartenc
Date: Tue Apr  1 14:42:47 2008
New Revision: 643599

URL: http://svn.apache.org/viewvc?rev=643599view=rev
Log:
DOCUMENTATION: Broken link in documentation in Ivy files section, info element 
page (IVY-788)

Modified:
ant/ivy/core/trunk/CHANGES.txt
ant/ivy/core/trunk/doc/ivyfile/info.html

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=643599r1=643598r2=643599view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Tue Apr  1 14:42:47 2008
@@ -93,6 +93,7 @@
 - FIX: SFTP should verify input parameter for hostname (IVY-734)
 - FIX: Classpath issues with vfs ftp while being used as a bundle (IVY-785)
 
+- DOCUMENTATION: Broken link in documentation in Ivy files section, info 
element page (IVY-788)
 - DOCUMENTATION: Add new cache information to resolver doc (IVY-772) (thanks 
to Carlton Brown)
 
2.0.0-beta2

Modified: ant/ivy/core/trunk/doc/ivyfile/info.html
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/doc/ivyfile/info.html?rev=643599r1=643598r2=643599view=diff
==
--- ant/ivy/core/trunk/doc/ivyfile/info.html (original)
+++ ant/ivy/core/trunk/doc/ivyfile/info.html Tue Apr  1 14:42:47 2008
@@ -63,7 +63,7 @@
 td0..n/td/tr
 trtda 
href=../ivyfile/repository.htmlrepository/a/tdtddescribes on which 
public repositories this module can be found/td
 td0..n/td/tr
-trtda href=../ivyfile.htmldescription/a/tdtddescribes how to 
use the module/td
+trtda 
href=../ivyfile/description.htmldescription/a/tdtddescribes how to use 
the module/td
 td0..1/td/tr
 /tbody
 /table




svn commit: r644054 - /ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java

2008-04-02 Thread maartenc
Author: maartenc
Date: Wed Apr  2 13:59:51 2008
New Revision: 644054

URL: http://svn.apache.org/viewvc?rev=644054view=rev
Log:
Removed unused method.

Modified:
ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java?rev=644054r1=644053r2=644054view=diff
==
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java 
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java 
Wed Apr  2 13:59:51 2008
@@ -1055,16 +1055,6 @@
 }
 
 /**
- * Returns true if the name should be ignored in listing
- * 
- * @param name
- * @return
- */
-public boolean listingIgnore(String name) {
-return listingIgnore.contains(name);
-}
-
-/**
  * Filters the names list by removing all names that should be ignored as 
defined by the listing
  * ignore list
  * 




svn commit: r644532 - in /ant/ivy/core/trunk: ./ src/java/org/apache/ivy/core/retrieve/ src/java/org/apache/ivy/core/settings/ src/java/org/apache/ivy/util/ test/java/org/apache/ivy/ant/

2008-04-03 Thread maartenc
Author: maartenc
Date: Thu Apr  3 15:19:46 2008
New Revision: 644532

URL: http://svn.apache.org/viewvc?rev=644532view=rev
Log:
FIX: ivy:retrieve with sync=true removes the .svn directory (IVY-763)

Modified:
ant/ivy/core/trunk/CHANGES.txt
ant/ivy/core/trunk/src/java/org/apache/ivy/core/retrieve/RetrieveEngine.java

ant/ivy/core/trunk/src/java/org/apache/ivy/core/retrieve/RetrieveEngineSettings.java
ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java
ant/ivy/core/trunk/src/java/org/apache/ivy/util/FileUtil.java
ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyRetrieveTest.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=644532r1=644531r2=644532view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Thu Apr  3 15:19:46 2008
@@ -77,6 +77,7 @@
 - IMPROVEMENT: Change allownomd and skipbuildwithoutivy into a more 
semantically correct name (IVY-297)
 - IMPROVEMENT: Smarter determination if an expression is exact or not for 
RegexpPatternMatcher and GlobPatternMatcher
 
+- FIX: ivy:retrieve with sync=true removes the .svn directory (IVY-763)
 - FIX: Ivy silently fails XML errors in ivyrep (IVY-579)
 - FIX: Extra Attributes are not available to resolver after resolve if cache 
was empty (IVY-773)
 - FIX: NullPointerException during ResovleEngine.downloadArtifacts. (IVY-592)

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/core/retrieve/RetrieveEngine.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/retrieve/RetrieveEngine.java?rev=644532r1=644531r2=644532view=diff
==
--- 
ant/ivy/core/trunk/src/java/org/apache/ivy/core/retrieve/RetrieveEngine.java 
(original)
+++ 
ant/ivy/core/trunk/src/java/org/apache/ivy/core/retrieve/RetrieveEngine.java 
Thu Apr  3 15:19:46 2008
@@ -150,9 +150,13 @@
 
 if (options.isSync()) {
 Message.verbose(\tsyncing...);
-Collection existingArtifacts = 
FileUtil.listAll(fileRetrieveRoot);
+
+String[] ignorableFilenames = settings.getIgnorableFilenames();
+Collection ignoreList = Arrays.asList(ignorableFilenames);
+
+Collection existingArtifacts = 
FileUtil.listAll(fileRetrieveRoot, ignoreList);
 Collection existingIvys = ivyRetrieveRoot == null ? null : 
FileUtil
-.listAll(ivyRetrieveRoot);
+.listAll(ivyRetrieveRoot, ignoreList);
 
 if (fileRetrieveRoot.equals(ivyRetrieveRoot)) {
 Collection target = targetArtifactsStructure;

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/core/retrieve/RetrieveEngineSettings.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/retrieve/RetrieveEngineSettings.java?rev=644532r1=644531r2=644532view=diff
==
--- 
ant/ivy/core/trunk/src/java/org/apache/ivy/core/retrieve/RetrieveEngineSettings.java
 (original)
+++ 
ant/ivy/core/trunk/src/java/org/apache/ivy/core/retrieve/RetrieveEngineSettings.java
 Thu Apr  3 15:19:46 2008
@@ -25,5 +25,7 @@
 boolean isCheckUpToDate();
 
 IvyVariableContainer getVariables();
+
+String[] getIgnorableFilenames();
 
 }

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java?rev=644532r1=644531r2=644532view=diff
==
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java 
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java 
Thu Apr  3 15:19:46 2008
@@ -1073,6 +1073,14 @@
 }
 
 /**
+ * Returns the file names of the files that should be ignored when 
+ * creating a file listing.
+ */
+public String[] getIgnorableFilenames() {
+return (String[]) listingIgnore.toArray(new 
String[listingIgnore.size()]);
+}
+
+/**
  * Filters the names list by removing all names that should be ignored as 
defined by the listing
  * ignore list
  * 
@@ -1081,7 +1089,7 @@
 public void filterIgnore(Collection names) {
 names.removeAll(listingIgnore);
 }
-
+
 public boolean isCheckUpToDate() {
 return checkUpToDate;
 }

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/util/FileUtil.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/util/FileUtil.java?rev=644532r1=644531r2=644532view=diff

svn commit: r644547 - /ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/SshResolver.java

2008-04-03 Thread maartenc
Author: maartenc
Date: Thu Apr  3 15:54:57 2008
New Revision: 644547

URL: http://svn.apache.org/viewvc?rev=644547view=rev
Log:
IMPROVEMENT: make it possible to specify permissions of published files for the 
SSH resolver (IVY-764)

Modified:
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/SshResolver.java

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/SshResolver.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/SshResolver.java?rev=644547r1=644546r2=644547view=diff
==
--- 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/SshResolver.java 
(original)
+++ 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/SshResolver.java 
Thu Apr  3 15:54:57 2008
@@ -23,9 +23,17 @@
  * Resolver for SSH resolver for ivy
  */
 public class SshResolver extends AbstractSshBasedResolver {
-
+
 public SshResolver() {
 setRepository(new SshRepository());
+}
+
+/**
+ * A four digit string (e.g., 0644, see man chmod, man open) 
specifying the permissions
+ * of the published files.
+ */
+public void setPublishMode(String mode) {
+((SshRepository) getRepository()).setPublishMode(mode);
 }
 
 /**




svn commit: r644911 - in /ant/ivy/core/trunk: CHANGES.txt src/java/org/apache/ivy/core/module/id/ModuleRevisionId.java

2008-04-04 Thread maartenc
Author: maartenc
Date: Fri Apr  4 13:56:22 2008
New Revision: 644911

URL: http://svn.apache.org/viewvc?rev=644911view=rev
Log:
FIX: Memory leak in ModuleRevisionId.java (IVY-791)

Modified:
ant/ivy/core/trunk/CHANGES.txt

ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/id/ModuleRevisionId.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=644911r1=644910r2=644911view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Fri Apr  4 13:56:22 2008
@@ -78,6 +78,7 @@
 - IMPROVEMENT: Change allownomd and skipbuildwithoutivy into a more 
semantically correct name (IVY-297)
 - IMPROVEMENT: Smarter determination if an expression is exact or not for 
RegexpPatternMatcher and GlobPatternMatcher
 
+- FIX: Memory leak in ModuleRevisionId.java (IVY-791)
 - FIX: conflict manager scoping does not work as expected (IVY-465)
 - FIX: ivy.original.xml file using artifact pattern in cache and causing 
problems (IVY-787)
 - FIX: ivy:retrieve with sync=true removes the .svn directory (IVY-763)

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/id/ModuleRevisionId.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/id/ModuleRevisionId.java?rev=644911r1=644910r2=644911view=diff
==
--- 
ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/id/ModuleRevisionId.java 
(original)
+++ 
ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/id/ModuleRevisionId.java 
Fri Apr  4 13:56:22 2008
@@ -17,6 +17,7 @@
  */
 package org.apache.ivy.core.module.id;
 
+import java.lang.ref.WeakReference;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
@@ -143,12 +144,19 @@
  * @return an interned ModuleRevisionId
  */
 public static ModuleRevisionId intern(ModuleRevisionId moduleRevisionId) {
-ModuleRevisionId r = (ModuleRevisionId) CACHE.get(moduleRevisionId);
-if (r == null) {
-r = moduleRevisionId;
-CACHE.put(r, r);
+ModuleRevisionId r = null;
 
+synchronized (CACHE) {
+WeakReference ref = (WeakReference) CACHE.get(moduleRevisionId);
+if (ref != null) {
+r = (ModuleRevisionId) ref.get();
+}
+if (r == null) {
+r = moduleRevisionId;
+CACHE.put(r, new WeakReference(r));
+}
 }
+ 
 return r;
 }
 




svn commit: r645709 - /ant/ivy/core/trunk/test/repositories/m2/ivysettings.xml

2008-04-07 Thread maartenc
Author: maartenc
Date: Mon Apr  7 15:12:12 2008
New Revision: 645709

URL: http://svn.apache.org/viewvc?rev=645709view=rev
Log:
Fixed junit tests on windows. I hope I won't brake the tests when they run on 
unix. A better solution to this problem would be fixing IVY-607 though, which 
would make it possible to define the root as: root=${ivy.settings.base.url}.

Modified:
ant/ivy/core/trunk/test/repositories/m2/ivysettings.xml

Modified: ant/ivy/core/trunk/test/repositories/m2/ivysettings.xml
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/m2/ivysettings.xml?rev=645709r1=645708r2=645709view=diff
==
--- ant/ivy/core/trunk/test/repositories/m2/ivysettings.xml (original)
+++ ant/ivy/core/trunk/test/repositories/m2/ivysettings.xml Mon Apr  7 15:12:12 
2008
@@ -20,6 +20,6 @@
settings defaultCache=build/cache defaultResolver=m2/
resolvers
ibiblio name=m2 m2compatible=true useMavenMetadata=true 
-root=file://${ivy.settings.dir} /
+root=file:/${ivy.settings.dir} /
/resolvers
 /ivysettings




svn commit: r645714 - in /ant/ivy/core/trunk/src/java/org/apache/ivy: core/settings/XmlSettingsParser.java plugins/parser/xml/XmlModuleDescriptorParser.java

2008-04-07 Thread maartenc
Author: maartenc
Date: Mon Apr  7 15:32:30 2008
New Revision: 645714

URL: http://svn.apache.org/viewvc?rev=645714view=rev
Log:
Make sure the cause of the SAXException is printed in stacktraces, this will 
make it easier to find parsing problems.

Modified:

ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/XmlSettingsParser.java

ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/XmlSettingsParser.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/XmlSettingsParser.java?rev=645714r1=645713r2=645714view=diff
==
--- 
ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/XmlSettingsParser.java 
(original)
+++ 
ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/XmlSettingsParser.java 
Mon Apr  7 15:32:30 2008
@@ -213,9 +213,14 @@
 moduleStarted(attributes);
 }
 } catch (ParseException ex) {
-throw new SAXException(problem in config file:  + 
ex.getMessage(), ex);
+SAXException sax = new SAXException(problem in config file:  + 
ex.getMessage(), ex);
+sax.initCause(ex);
+throw sax;
 } catch (IOException ex) {
-throw new SAXException(io problem while parsing config file:  + 
ex.getMessage(), ex);
+SAXException sax = new SAXException(io problem while parsing 
config file:  
++ ex.getMessage(), ex);
+sax.initCause(ex);
+throw sax;
 }
 }
 

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java?rev=645714r1=645713r2=645714view=diff
==
--- 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java
 (original)
+++ 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java
 Mon Apr  7 15:32:30 2008
@@ -336,8 +336,10 @@
 if (ex instanceof SAXException) {
 throw (SAXException) ex;
 }
-throw new SAXException(problem occured while parsing ivy 
file. message: 
+SAXException sax = new SAXException(Problem occured while 
parsing ivy file: 
 + ex.getMessage(), ex);
+sax.initCause(ex);
+throw sax;
 }
 }
 




svn commit: r646073 - in /ant/ivy/core/trunk/test: java/org/apache/ivy/core/resolve/ResolveTest.java repositories/m2/ivysettings.xml

2008-04-08 Thread maartenc
Author: maartenc
Date: Tue Apr  8 14:09:59 2008
New Revision: 646073

URL: http://svn.apache.org/viewvc?rev=646073view=rev
Log:
New attempt to make the tests pass on both unix and windows.

Modified:
ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java
ant/ivy/core/trunk/test/repositories/m2/ivysettings.xml

Modified: 
ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java?rev=646073r1=646072r2=646073view=diff
==
--- ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java 
(original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java 
Tue Apr  8 14:09:59 2008
@@ -3332,7 +3332,7 @@
 public void testResolveMaven2() throws Exception {
 // test3 depends on test2 which depends on test
 Ivy ivy = new Ivy();
-ivy.configure(new File(test/repositories/m2/ivysettings.xml));
+ivy.configure(new 
File(test/repositories/m2/ivysettings.xml).toURL());
 ResolveReport report = ivy.resolve(new File(
 
test/repositories/m2/org/apache/test3/1.0/test3-1.0.pom).toURL(),
 getResolveOptions(new String[] {test}));
@@ -3360,7 +3360,7 @@
 //Same as testResolveMaven2 but with a relocated module pointing to 
the module
 //used in testResolveMaven2.
 ivy = new Ivy();
-ivy.configure(new File(test/repositories/m2/ivysettings.xml));
+ivy.configure(new 
File(test/repositories/m2/ivysettings.xml).toURL());
 ivy.pushContext();
 try {
 ResolveReport report = ivy.resolve(new File(
@@ -3388,7 +3388,7 @@
 //Same as testResolveMaven2 but with a relocated module pointing to 
the module
 //used in testResolveMaven2.
 ivy = new Ivy();
-ivy.configure(new File(test/repositories/m2/ivysettings.xml));
+ivy.configure(new 
File(test/repositories/m2/ivysettings.xml).toURL());
 ivy.pushContext();
 try {
 ResolveReport report = ivy.resolve(new File(
@@ -3414,7 +3414,7 @@
 
 public void testResolveVesionRelocationChainedWithGroupRelocation() throws 
Exception {
 ivy = new Ivy();
-ivy.configure(new File(test/repositories/m2/ivysettings.xml));
+ivy.configure(new 
File(test/repositories/m2/ivysettings.xml).toURL());
 ivy.pushContext();
 try {
 ResolveReport report = ivy.resolve(new File(
@@ -3440,7 +3440,7 @@
 
 public void testResolveTransitivelyToRelocatedPom() throws Exception {
 ivy = new Ivy();
-ivy.configure(new File(test/repositories/m2/ivysettings.xml));
+ivy.configure(new 
File(test/repositories/m2/ivysettings.xml).toURL());
 ivy.pushContext();
 try {
 ResolveReport report = ivy.resolve(new File(
@@ -3466,7 +3466,7 @@
 
 public void testResolveTransitivelyToPomRelocatedToNewVersion() throws 
Exception {
 ivy = new Ivy();
-ivy.configure(new File(test/repositories/m2/ivysettings.xml));
+ivy.configure(new 
File(test/repositories/m2/ivysettings.xml).toURL());
 ivy.pushContext();
 try {
 ResolveReport report = ivy.resolve(new File(
@@ -3495,7 +3495,7 @@
 // test case for IVY-418
 // test-classifier depends on test-classified with classifier asl
 Ivy ivy = new Ivy();
-ivy.configure(new File(test/repositories/m2/ivysettings.xml));
+ivy.configure(new 
File(test/repositories/m2/ivysettings.xml).toURL());
 ResolveReport report = ivy.resolve(new File(
 
test/repositories/m2/org/apache/test-classifier/1.0/test-classifier-1.0.pom)
 .toURL(), getResolveOptions(new String[] {*}));
@@ -3517,7 +3517,7 @@
 
 public void testResolveMaven2WithVersionProperty() throws Exception {
 Ivy ivy = new Ivy();
-ivy.configure(new File(test/repositories/m2/ivysettings.xml));
+ivy.configure(new 
File(test/repositories/m2/ivysettings.xml).toURL());
 ResolveReport report = ivy.resolve(new File(
 
test/repositories/m2/org/apache/test-version/1.0/test-version-1.0.pom).toURL(),
 getResolveOptions(new String[] {*}));
@@ -3679,7 +3679,7 @@
 // here we test maven SNAPSHOT versions handling, 
 // with m2 snapshotRepository/uniqueVersion set to true
 Ivy ivy = new Ivy();
-ivy.configure(new File(test/repositories/m2/ivysettings.xml));
+ivy.configure(new 
File(test/repositories/m2/ivysettings.xml).toURL());
 ResolveReport report = ivy.resolve(new File(
 test/repositories/m2/org/apache/test4/1.0/test4-1.0.pom)
 .toURL(), getResolveOptions(new String[] {*}));
@@ -3698,7 +3698,7 @@
 // here

svn commit: r646074 - in /ant/ivy/core/trunk: doc/resolver/ssh.html src/java/org/apache/ivy/plugins/repository/ssh/SshRepository.java src/java/org/apache/ivy/plugins/resolver/SshResolver.java

2008-04-08 Thread maartenc
Author: maartenc
Date: Tue Apr  8 14:17:48 2008
New Revision: 646074

URL: http://svn.apache.org/viewvc?rev=646074view=rev
Log:
Renamed publishMode to publishPermissions (IVY-764)

Modified:
ant/ivy/core/trunk/doc/resolver/ssh.html

ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/SshRepository.java
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/SshResolver.java

Modified: ant/ivy/core/trunk/doc/resolver/ssh.html
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/doc/resolver/ssh.html?rev=646074r1=646073r2=646074view=diff
==
--- ant/ivy/core/trunk/doc/resolver/ssh.html (original)
+++ ant/ivy/core/trunk/doc/resolver/ssh.html Tue Apr  8 14:17:48 2008
@@ -56,7 +56,7 @@
 tdNo, defaults to host given on the patterns, fail if none is 
set/td/tr
 trtdport/tdtdThe port to connect to/td
 tdNo, defaults to 22/td/tr
-trtdpublishMode/tdtdA four digit string (e.g., 0644, see man 
chmod, man open) specifying the permissions of the published files. span 
class=since(since 2.0)/span
+trtdpublishPermissions/tdtdA four digit string (e.g., 0644, see 
man chmod, man open) specifying the permissions of the published files. 
span class=since(since 2.0)/span
 /tdtdNo, defaults to 0600/td/tr
 /tbody
 /table

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/SshRepository.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/SshRepository.java?rev=646074r1=646073r2=646074view=diff
==
--- 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/SshRepository.java
 (original)
+++ 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/SshRepository.java
 Tue Apr  8 14:17:48 2008
@@ -55,7 +55,7 @@
 
 private String createDirCommand = mkdir;
 
-private String publishMode = 0600;
+private String publishPermissions = 0600;
 
 /**
  * create a new resource with lazy initializing
@@ -261,7 +261,7 @@
 makePath(path, session);
 }
 Scp myCopy = new Scp(session);
-myCopy.put(source.getCanonicalPath(), path, name, publishMode);
+myCopy.put(source.getCanonicalPath(), path, name, 
publishPermissions);
 } catch (IOException e) {
 if (session != null) {
 releaseSession(session, destination);
@@ -429,8 +429,8 @@
  * A four digit string (e.g., 0644, see man chmod, man open) 
specifying the permissions
  * of the published files.
  */
-public void setPublishMode(String mode) {
-this.publishMode = mode;
+public void setPublishPermissions(String permissions) {
+this.publishPermissions = permissions;
 }
 
 /**

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/SshResolver.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/SshResolver.java?rev=646074r1=646073r2=646074view=diff
==
--- 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/SshResolver.java 
(original)
+++ 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/SshResolver.java 
Tue Apr  8 14:17:48 2008
@@ -32,8 +32,8 @@
  * A four digit string (e.g., 0644, see man chmod, man open) 
specifying the permissions
  * of the published files.
  */
-public void setPublishMode(String mode) {
-((SshRepository) getRepository()).setPublishMode(mode);
+public void setPublishPermissions(String permissions) {
+((SshRepository) getRepository()).setPublishPermissions(permissions);
 }
 
 /**




svn commit: r646561 - in /ant/ivy/core/trunk: CHANGES.txt doc/use/report.html src/java/org/apache/ivy/ant/IvyReport.java test/java/org/apache/ivy/ant/IvyReportTest.java

2008-04-09 Thread maartenc
Author: maartenc
Date: Wed Apr  9 15:08:49 2008
New Revision: 646561

URL: http://svn.apache.org/viewvc?rev=646561view=rev
Log:
FIX: revision token is not set in report outputpattern (IVY-272)

Modified:
ant/ivy/core/trunk/CHANGES.txt
ant/ivy/core/trunk/doc/use/report.html
ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyReport.java
ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyReportTest.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=646561r1=646560r2=646561view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Wed Apr  9 15:08:49 2008
@@ -78,6 +78,7 @@
 - IMPROVEMENT: Change allownomd and skipbuildwithoutivy into a more 
semantically correct name (IVY-297)
 - IMPROVEMENT: Smarter determination if an expression is exact or not for 
RegexpPatternMatcher and GlobPatternMatcher
 
+- FIX: revision token is not set in report outputpattern (IVY-272)
 - FIX: Ivy uses the first set of configurations it sees when resolving 
multiple versions of a module (IVY-681)
 - FIX: Eviction fails for libs not providing their ivy configuration and 
providing artifacts named different between lib versions (IVY-537)
 - FIX: Memory leak in ModuleRevisionId.java (IVY-791)

Modified: ant/ivy/core/trunk/doc/use/report.html
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/doc/use/report.html?rev=646561r1=646560r2=646561view=diff
==
--- ant/ivy/core/trunk/doc/use/report.html (original)
+++ ant/ivy/core/trunk/doc/use/report.html Wed Apr  9 15:08:49 2008
@@ -56,14 +56,16 @@
 trtdconf/tdtda comma separated list of the configurations for 
which a report should be generated/td
 tdNo. Defaults to the configurations resolved by the last resolve 
call (during same ant build), or ${ivy.resolved.configurations} if no resolve 
was called/td/tr
 trtdorganisation/tdtdthe name of the organisation of the module 
for which report should be generated/td
-tdNo, unless no resolve was called during the build. Defaults to 
last resolved module organisation./td/tr
+tdNo, unless resolveId has not been specified and no resolve was 
called during the build. Defaults to last resolved module 
organisation./td/tr
 trtdmodule/tdtdthe name of the module for which report should be 
generated/td
-tdNo, unless no resolve was called during the build. Defaults to 
last resolved module./td/tr
+tdNo, unless resolveId has not been specified and no resolve was 
called during the build. Defaults to last resolved module./td/tr
 trtdvalidate/tdtdtrue to force ivy files validation against 
ivy.xsd, false to force no validation/td
 tdNo. Defaults to default ivy value (as configured in configuration 
file)/td/tr
 trtdxslfile/tdtdindicates which xsl file should be used to 
generate the report/td
 tdNo, defaults to ivy provided xsl which generates html 
report/td/tr
-trtdsettingsRef/tdtdA reference to the ivy settings that must be 
used by this task span class=since(since 2.0)/span/tdtdNo, 
'ivy.instance' is taken by default./td/tr/tbody
+trtdsettingsRef/tdtdA reference to the ivy settings that must be 
used by this task span class=since(since 2.0)/span/tdtdNo, 
'ivy.instance' is taken by default./td/tr
+trtdresolveId/tdtdThe id which was used for a previous resolve 
span class=since(since 2.0)/span/tdtdNo, defaults to 
'[org]-[module]'./td/tr
+/tbody
 /table
 
 h1Examples/h1

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyReport.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyReport.java?rev=646561r1=646560r2=646561view=diff
==
--- ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyReport.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyReport.java Wed Apr  9 
15:08:49 2008
@@ -25,6 +25,7 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.text.ParseException;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
@@ -41,9 +42,11 @@
 import org.apache.ivy.core.IvyPatternHelper;
 import org.apache.ivy.core.cache.ResolutionCacheManager;
 import org.apache.ivy.core.module.id.ModuleId;
+import org.apache.ivy.core.module.id.ModuleRevisionId;
 import org.apache.ivy.core.resolve.ResolveOptions;
 import org.apache.ivy.core.settings.IvySettings;
 import org.apache.ivy.plugins.report.XmlReportOutputter;
+import org.apache.ivy.plugins.report.XmlReportParser;
 import org.apache.ivy.util.FileUtil;
 import org.apache.ivy.util.Message;
 import org.apache.tools.ant.BuildException;
@@ -79,6 +82,8 @@
 private List params = new ArrayList();
 
 private String resolveId;
+
+private

svn commit: r646563 - /ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyResolveTest.java

2008-04-09 Thread maartenc
Author: maartenc
Date: Wed Apr  9 15:13:39 2008
New Revision: 646563

URL: http://svn.apache.org/viewvc?rev=646563view=rev
Log:
Removed unused imports.

Modified:
ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyResolveTest.java

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyResolveTest.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyResolveTest.java?rev=646563r1=646562r2=646563view=diff
==
--- ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyResolveTest.java 
(original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyResolveTest.java Wed Apr 
 9 15:13:39 2008
@@ -25,8 +25,6 @@
 import org.apache.ivy.TestHelper;
 import org.apache.ivy.core.module.id.ModuleRevisionId;
 import org.apache.ivy.core.report.ResolveReport;
-import org.apache.ivy.util.DefaultMessageLogger;
-import org.apache.ivy.util.Message;
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.Project;
 import org.apache.tools.ant.taskdefs.Delete;




svn commit: r650229 - in /ant/ivy/core/trunk: CHANGES.txt src/java/org/apache/ivy/ant/IvyBuildList.java test/buildlist/H/ test/buildlist/H/build.xml test/java/org/apache/ivy/ant/IvyBuildListTest.java

2008-04-21 Thread maartenc
Author: maartenc
Date: Mon Apr 21 12:21:49 2008
New Revision: 650229

URL: http://svn.apache.org/viewvc?rev=650229view=rev
Log:
FIX: onMissingDescriptor doesn't work due to == comparison (IVY-805) (thanks to 
Ben Hale)

Added:
ant/ivy/core/trunk/test/buildlist/H/
ant/ivy/core/trunk/test/buildlist/H/build.xml
Modified:
ant/ivy/core/trunk/CHANGES.txt
ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyBuildList.java
ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyBuildListTest.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=650229r1=650228r2=650229view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Mon Apr 21 12:21:49 2008
@@ -28,6 +28,7 @@
Jacob Grydholt Jensen
Scott Goldstein
Pierre Hägnestrand
+   Ben Hale
Peter Hayes
Matt Inger
Anders Janmyr
@@ -78,6 +79,7 @@
 - IMPROVEMENT: Change allownomd and skipbuildwithoutivy into a more 
semantically correct name (IVY-297)
 - IMPROVEMENT: Smarter determination if an expression is exact or not for 
RegexpPatternMatcher and GlobPatternMatcher
 
+- FIX: onMissingDescriptor doesn't work due to == comparison (IVY-805) (thanks 
to Ben Hale)
 - FIX: revision token is not set in report outputpattern (IVY-272)
 - FIX: Ivy uses the first set of configurations it sees when resolving 
multiple versions of a module (IVY-681)
 - FIX: Eviction fails for libs not providing their ivy configuration and 
providing artifacts named different between lib versions (IVY-537)

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyBuildList.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyBuildList.java?rev=650229r1=650228r2=650229view=diff
==
--- ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyBuildList.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyBuildList.java Mon Apr 21 
12:21:49 2008
@@ -244,7 +244,7 @@
 new WarningNonMatchingVersionReporter();
 List sortedModules = ivy.sortModuleDescriptors(mds, 
nonMatchingVersionReporter);
 
-if (onMissingDescriptor != OnMissingDescriptor.TAIL) {
+if (!OnMissingDescriptor.TAIL.equals(onMissingDescriptor)) {
 for (ListIterator iter = noDescriptor.listIterator(); 
iter.hasNext();) {
 File buildFile = (File) iter.next();
 addBuildFile(path, buildFile);
@@ -286,7 +286,7 @@
 File buildFile = (File) buildFiles.get(md);
 addBuildFile(path, buildFile);
 }
-if (onMissingDescriptor == OnMissingDescriptor.TAIL) {
+if (OnMissingDescriptor.TAIL.equals(onMissingDescriptor)) {
 for (ListIterator iter = noDescriptor.listIterator(); 
iter.hasNext();) {
 File buildFile = (File) iter.next();
 addBuildFile(path, buildFile);
@@ -298,23 +298,23 @@
 }
 
 private void onMissingDescriptor(File buildFile, File ivyFile, List 
noDescriptor) {
-if (onMissingDescriptor == OnMissingDescriptor.SKIP) {
+if (OnMissingDescriptor.SKIP.equals(onMissingDescriptor)) {
 Message.debug(skipping  + buildFile + : descriptor  + ivyFile
 +  doesn't exist);
-} else if (onMissingDescriptor == OnMissingDescriptor.FAIL) {
+} else if (OnMissingDescriptor.FAIL.equals(onMissingDescriptor)) {
 throw new BuildException(
 a module has no module descriptor and 
onMissingDescriptor=fail. 
 + Build file:  + buildFile + . Expected descriptor:  + 
ivyFile);
 } else {
-if (onMissingDescriptor == OnMissingDescriptor.WARN) {
+if (OnMissingDescriptor.WARN.equals(onMissingDescriptor)) {
 Message.warn(
 a module has no module descriptor. 
 + Build file:  + buildFile + . Expected descriptor:  + 
ivyFile);
 }
 Message.verbose(no descriptor for  + buildFile + : descriptor= 
+ ivyFile
 + : adding it at the  
-+ onMissingDescriptor == OnMissingDescriptor.TAIL 
-? tail : head +  of the path);
++ (OnMissingDescriptor.TAIL.equals(onMissingDescriptor) 
+? tail : head +  of the path));
 Message.verbose(
 \t(change onMissingDescriptor if you want to take another 
action);
 noDescriptor.add(buildFile);

Added: ant/ivy/core/trunk/test/buildlist/H/build.xml
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/buildlist/H/build.xml?rev=650229view=auto
==
--- ant/ivy/core/trunk/test/buildlist/H/build.xml (added

svn commit: r653610 - in /ant/ivy/core/trunk: CHANGES.txt src/java/org/apache/ivy/core/IvyPatternHelper.java test/java/org/apache/ivy/plugins/resolver/FileSystemResolverTest.java

2008-05-05 Thread maartenc
Author: maartenc
Date: Mon May  5 14:43:23 2008
New Revision: 653610

URL: http://svn.apache.org/viewvc?rev=653610view=rev
Log:
FIX: Filesystem resolver does not evaluate [branch] token when publishing 
(IVY-814)

Modified:
ant/ivy/core/trunk/CHANGES.txt
ant/ivy/core/trunk/src/java/org/apache/ivy/core/IvyPatternHelper.java

ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/FileSystemResolverTest.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=653610r1=653609r2=653610view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Mon May  5 14:43:23 2008
@@ -79,6 +79,7 @@
 - IMPROVEMENT: Change allownomd and skipbuildwithoutivy into a more 
semantically correct name (IVY-297)
 - IMPROVEMENT: Smarter determination if an expression is exact or not for 
RegexpPatternMatcher and GlobPatternMatcher
 
+- FIX: Filesystem resolver does not evaluate [branch] token when publishing 
(IVY-814)
 - FIX: Using ivy:settings with the id attribute not behaving as expected 
(IVY-809)
 - FIX: onMissingDescriptor doesn't work due to == comparison (IVY-805) (thanks 
to Ben Hale)
 - FIX: revision token is not set in report outputpattern (IVY-272)

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/IvyPatternHelper.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/IvyPatternHelper.java?rev=653610r1=653609r2=653610view=diff
==
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/IvyPatternHelper.java 
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/IvyPatternHelper.java Mon 
May  5 14:43:23 2008
@@ -69,8 +69,8 @@
 
 public static String substitute(String pattern, ModuleRevisionId 
moduleRevision) {
 return substitute(pattern, moduleRevision.getOrganisation(), 
moduleRevision.getName(),
-moduleRevision.getRevision(), ivy, ivy, xml, null,
-moduleRevision.getAttributes());
+moduleRevision.getBranch(), moduleRevision.getRevision(), ivy, 
ivy, xml, null,
+null, moduleRevision.getAttributes());
 }
 
 public static String substitute(String pattern, ModuleRevisionId 
moduleRevision,

Modified: 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/FileSystemResolverTest.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/FileSystemResolverTest.java?rev=653610r1=653609r2=653610view=diff
==
--- 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/FileSystemResolverTest.java
 (original)
+++ 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/FileSystemResolverTest.java
 Mon May  5 14:43:23 2008
@@ -633,6 +633,45 @@
 }
 }
 
+public void testPublishTransactionWithBranch() throws Exception {
+try {
+FileSystemResolver resolver = new FileSystemResolver();
+resolver.setName(test);
+resolver.setSettings(settings);
+
+resolver.addIvyPattern(
+
test/repositories/1/[organisation]/[module]/[branch]/[revision]/[artifact].[ext]);
+resolver.addArtifactPattern(
+ 
test/repositories/1/[organisation]/[module]/[branch]/[revision]/[artifact]-[revision].[ext]);
+
+ModuleRevisionId mrid = ModuleRevisionId.newInstance(myorg, 
mymodule, mybranch, myrevision);
+Artifact ivyArtifact = new DefaultArtifact(mrid, new Date(), 
ivy, ivy, xml);
+Artifact artifact = new DefaultArtifact(mrid, new Date(), 
myartifact, mytype,
+myext);
+File src = new File(test/repositories/ivysettings.xml);
+
+resolver.beginPublishTransaction(mrid, false);
+
+// files should not be available until the transaction is committed
+resolver.publish(ivyArtifact, src, false);
+assertFalse(new 
File(test/repositories/1/myorg/mymodule/mybranch/myrevision/ivy.xml).exists());
+
+resolver.publish(artifact, src, false);
+assertFalse(new File(
+
test/repositories/1/myorg/mymodule/mybranch/myrevision/myartifact-myrevision.myext)
+.exists());
+
+resolver.commitPublishTransaction();
+
+assertTrue(new 
File(test/repositories/1/myorg/mymodule/mybranch/myrevision/ivy.xml).exists());
+assertTrue(new File(
+
test/repositories/1/myorg/mymodule/mybranch/myrevision/myartifact-myrevision.myext)
+.exists());
+} finally {
+FileUtil.forceDelete(new File(test/repositories/1/myorg));
+}
+}
+
 public void testAbortTransaction() throws Exception {
 try

svn commit: r656455 - /ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/Scp.java

2008-05-14 Thread maartenc
Author: maartenc
Date: Wed May 14 15:22:45 2008
New Revision: 656455

URL: http://svn.apache.org/viewvc?rev=656455view=rev
Log:
Attempt to fix IVY-764

Modified:
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/Scp.java

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/Scp.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/Scp.java?rev=656455r1=656454r2=656455view=diff
==
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/Scp.java 
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/Scp.java 
Wed May 14 15:22:45 2008
@@ -492,7 +492,7 @@
 }
 }
 
-String cmd = scp -t ;
+String cmd = scp -tp ;
 if (remoteTargetDir != null  remoteTargetDir.length()  0) {
 cmd = cmd + -d  + remoteTargetDir;
 }




svn commit: r657200 - /ant/ivy/core/trunk/src/java/org/apache/ivy/util/HostUtil.java

2008-05-16 Thread maartenc
Author: maartenc
Date: Fri May 16 13:42:21 2008
New Revision: 657200

URL: http://svn.apache.org/viewvc?rev=657200view=rev
Log:
Cache the localhost name as suggested in IVY-817

Modified:
ant/ivy/core/trunk/src/java/org/apache/ivy/util/HostUtil.java

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/util/HostUtil.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/util/HostUtil.java?rev=657200r1=657199r2=657200view=diff
==
--- ant/ivy/core/trunk/src/java/org/apache/ivy/util/HostUtil.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/util/HostUtil.java Fri May 16 
13:42:21 2008
@@ -25,6 +25,9 @@
  * 
  */
 public final class HostUtil {
+
+private static String localHostName = null;
+
 /**
  * This default constructor is to hide this class from initialization 
through other classes.
  */
@@ -38,10 +41,13 @@
  * @return The name of the current local Host.
  */
 public static String getLocalHostName() {
-try {
-return InetAddress.getLocalHost().getHostName();
-} catch (UnknownHostException e) {
-return localhost;
+if (localHostName == null) {
+try {
+localHostName = InetAddress.getLocalHost().getHostName();
+} catch (UnknownHostException e) {
+localHostName = localhost;
+}
 }
+return localHostName;
 }
 }




svn commit: r657204 - in /ant/ivy/core/trunk: doc/resolver/ssh.html src/java/org/apache/ivy/plugins/repository/ssh/Scp.java src/java/org/apache/ivy/plugins/repository/ssh/SshRepository.java

2008-05-16 Thread maartenc
Author: maartenc
Date: Fri May 16 13:54:03 2008
New Revision: 657204

URL: http://svn.apache.org/viewvc?rev=657204view=rev
Log:
Improved backwards compatibility with previous releases.

Modified:
ant/ivy/core/trunk/doc/resolver/ssh.html
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/Scp.java

ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/SshRepository.java

Modified: ant/ivy/core/trunk/doc/resolver/ssh.html
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/doc/resolver/ssh.html?rev=657204r1=657203r2=657204view=diff
==
--- ant/ivy/core/trunk/doc/resolver/ssh.html (original)
+++ ant/ivy/core/trunk/doc/resolver/ssh.html Fri May 16 13:54:03 2008
@@ -57,7 +57,7 @@
 trtdport/tdtdThe port to connect to/td
 tdNo, defaults to 22/td/tr
 trtdpublishPermissions/tdtdA four digit string (e.g., 0644, see 
man chmod, man open) specifying the permissions of the published files. 
span class=since(since 2.0)/span
-/tdtdNo, defaults to 0600/td/tr
+/tdtdNo, defaults to scp standard behaviour/td/tr
 /tbody
 /table
 h1Child elements/h1

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/Scp.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/Scp.java?rev=657204r1=657203r2=657204view=diff
==
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/Scp.java 
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/Scp.java 
Fri May 16 13:54:03 2008
@@ -300,7 +300,11 @@
 File f = new File(localFile);
 long remain = f.length();
 
-String cline = C + mode +   + remain +   + remoteName + \n;
+String cMode = mode;
+if (cMode == null) {
+cMode = 0600;
+}
+String cline = C + cMode +   + remain +   + remoteName + \n;
 
 os.write(cline.getBytes());
 os.flush();
@@ -492,7 +496,10 @@
 }
 }
 
-String cmd = scp -tp ;
+String cmd = scp -t ;
+if (mode != null) {
+cmd = cmd + -p ;
+}
 if (remoteTargetDir != null  remoteTargetDir.length()  0) {
 cmd = cmd + -d  + remoteTargetDir;
 }

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/SshRepository.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/SshRepository.java?rev=657204r1=657203r2=657204view=diff
==
--- 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/SshRepository.java
 (original)
+++ 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/SshRepository.java
 Fri May 16 13:54:03 2008
@@ -55,7 +55,7 @@
 
 private String createDirCommand = mkdir;
 
-private String publishPermissions = 0600;
+private String publishPermissions = null;
 
 /**
  * create a new resource with lazy initializing




svn commit: r657658 - in /ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2: PomModuleDescriptorBuilder.java PomModuleDescriptorParser.java PomReader.java

2008-05-18 Thread maartenc
Author: maartenc
Date: Sun May 18 15:25:23 2008
New Revision: 657658

URL: http://svn.apache.org/viewvc?rev=657658view=rev
Log:
Added quick-fix for IVY-633. I think it will solve most of the packaging 
problems, but we should work on a better solution.

Modified:

ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java

ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java?rev=657658r1=657657r2=657658view=diff
==
--- 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java
 (original)
+++ 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java
 Sun May 18 15:25:23 2008
@@ -18,11 +18,14 @@
 package org.apache.ivy.plugins.parser.m2;
 
 import java.text.ParseException;
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.LinkedHashMap;
+import java.util.List;
 import java.util.Map;
+import java.util.StringTokenizer;
 import java.util.Map.Entry;
 
 import org.apache.ivy.Ivy;
@@ -43,8 +46,10 @@
 import org.apache.ivy.plugins.matcher.PatternMatcher;
 import org.apache.ivy.plugins.parser.ModuleDescriptorParser;
 import org.apache.ivy.plugins.parser.m2.PomReader.PomDependencyData;
+import org.apache.ivy.plugins.parser.m2.PomReader.PomPluginElement;
 import org.apache.ivy.plugins.repository.Resource;
 import org.apache.ivy.util.Message;
+import org.w3c.dom.Element;
 
 
 /**
@@ -202,8 +207,25 @@
 
 
 public void addArtifact(String artifactId, String packaging) {
+String ext = packaging;
+
+// TODO: we should refactor the following code into something more 
configurable
+
+// if 'packaging == bundle' and if we use the 'maven-bundle-plugin', 
the
+// type must be 'jar'
+if (bundle.equals(packaging)) {
+for (Iterator it = getPlugins(ivyModuleDescriptor).iterator(); 
it.hasNext();) {
+PomDependencyMgt plugin = (PomDependencyMgt) it.next();
+if (org.apache.felix.equals(plugin.getGroupId())
+ 
maven-bundle-plugin.equals(plugin.getArtifaceId())) {
+ext = jar;
+break;
+}
+}
+}
+
 ivyModuleDescriptor.addArtifact(master, 
-new DefaultArtifact(mrid, new Date(), artifactId, packaging, 
packaging));
+new DefaultArtifact(mrid, new Date(), artifactId, ext, ext));
 }
 
 
@@ -267,6 +289,57 @@
 ExactPatternMatcher.INSTANCE,
 new OverrideDependencyDescriptorMediator(null, dep.getVersion()));
 }
+
+public void addPlugin(PomDependencyMgt plugin) {
+String pluginValue = plugin.getGroupId() + EXTRA_INFO_DELIMITER + 
plugin.getArtifaceId() 
++ EXTRA_INFO_DELIMITER + plugin.getVersion();
+String pluginExtraInfo = (String) 
ivyModuleDescriptor.getExtraInfo().get(maven.plugins);
+if (pluginExtraInfo == null) {
+pluginExtraInfo = pluginValue;
+} else {
+pluginExtraInfo = pluginExtraInfo + | + pluginValue;
+}
+ivyModuleDescriptor.getExtraInfo().put(m:maven.plugins, 
pluginExtraInfo);
+}
+
+public static List /*PomDependencyMgt*/ getPlugins(ModuleDescriptor md) {
+List result = new ArrayList();
+String plugins = (String) md.getExtraInfo().get(m:maven.plugins);
+if (plugins == null) {
+return new ArrayList();
+}
+String[] pluginsArray = plugins.split(\\|);
+for (int i = 0; i  pluginsArray.length; i++) {
+String[] parts = pluginsArray[i].split(EXTRA_INFO_DELIMITER);
+result.add(new PomPluginElement(parts[0], parts[1], parts[2]));
+}
+
+return result;
+}
+
+private static class PomPluginElement implements PomDependencyMgt {
+private String groupId;
+private String artifactId;
+private String version;
+
+public PomPluginElement(String groupId, String artifactId, String 
version) {
+this.groupId = groupId;
+this.artifactId = artifactId;
+this.version = version;
+}
+
+public String getGroupId() {
+return groupId;
+}
+
+public String getArtifaceId() {
+return artifactId;
+}
+
+public String getVersion() {
+return version;
+}
+}
 
 private String getDefaultVersion(PomDependencyData dep

svn commit: r657663 - /ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java

2008-05-18 Thread maartenc
Author: maartenc
Date: Sun May 18 15:30:59 2008
New Revision: 657663

URL: http://svn.apache.org/viewvc?rev=657663view=rev
Log:
Removed some unused imports

Modified:

ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java?rev=657663r1=657662r2=657663view=diff
==
--- 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java
 (original)
+++ 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java
 Sun May 18 15:30:59 2008
@@ -25,7 +25,6 @@
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.StringTokenizer;
 import java.util.Map.Entry;
 
 import org.apache.ivy.Ivy;
@@ -46,10 +45,8 @@
 import org.apache.ivy.plugins.matcher.PatternMatcher;
 import org.apache.ivy.plugins.parser.ModuleDescriptorParser;
 import org.apache.ivy.plugins.parser.m2.PomReader.PomDependencyData;
-import org.apache.ivy.plugins.parser.m2.PomReader.PomPluginElement;
 import org.apache.ivy.plugins.repository.Resource;
 import org.apache.ivy.util.Message;
-import org.w3c.dom.Element;
 
 
 /**




svn commit: r658922 - in /ant/ivy/core/trunk: ./ src/java/org/apache/ivy/plugins/parser/m2/

2008-05-21 Thread maartenc
Author: maartenc
Date: Wed May 21 16:01:47 2008
New Revision: 658922

URL: http://svn.apache.org/viewvc?rev=658922view=rev
Log:
FIX: Maven scope defined in POM dependencyManagement section not honoured 
(IVY-811)

Modified:
ant/ivy/core/trunk/CHANGES.txt

ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/DefaultPomDependencyMgt.java

ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomDependencyMgt.java

ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java

ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=658922r1=658921r2=658922view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Wed May 21 16:01:47 2008
@@ -81,6 +81,7 @@
 - IMPROVEMENT: Change allownomd and skipbuildwithoutivy into a more 
semantically correct name (IVY-297)
 - IMPROVEMENT: Smarter determination if an expression is exact or not for 
RegexpPatternMatcher and GlobPatternMatcher
 
+- FIX: Maven scope defined in POM dependencyManagement section not honoured 
(IVY-811)
 - FIX: SFTPRepository incorrectly calculates last modified time for resources 
(IVY-815)
 - FIX: Filesystem resolver does not evaluate [branch] token when publishing 
(IVY-814)
 - FIX: Using ivy:settings with the id attribute not behaving as expected 
(IVY-809)

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/DefaultPomDependencyMgt.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/DefaultPomDependencyMgt.java?rev=658922r1=658921r2=658922view=diff
==
--- 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/DefaultPomDependencyMgt.java
 (original)
+++ 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/DefaultPomDependencyMgt.java
 Wed May 21 16:01:47 2008
@@ -21,11 +21,17 @@
 private String groupId;
 private String artifactId;
 private String version;
+private String scope;
 
-public DefaultPomDependencyMgt(String groupId, String artifactId, String 
version) {
+public DefaultPomDependencyMgt(String groupId, String artifactId, String 
version, String scope) {
 this.groupId = groupId;
 this.artifactId = artifactId;
 this.version = version;
+this.scope = scope;
+}
+
+public String getScope() {
+return scope;
 }
 
 public String getGroupId() {

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomDependencyMgt.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomDependencyMgt.java?rev=658922r1=658921r2=658922view=diff
==
--- 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomDependencyMgt.java
 (original)
+++ 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomDependencyMgt.java
 Wed May 21 16:01:47 2008
@@ -24,5 +24,7 @@
 public abstract String getArtifactId();
 
 public abstract String getVersion();
+
+public abstract String getScope();
 
 }
\ No newline at end of file

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java?rev=658922r1=658921r2=658922view=diff
==
--- 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java
 (original)
+++ 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java
 Wed May 21 16:01:47 2008
@@ -56,7 +56,7 @@
 public class PomModuleDescriptorBuilder {
 
 
-private static final int DEPENDENCY_MANAGEMENT_KEY_PARTS_COUNT = 3;
+private static final int DEPENDENCY_MANAGEMENT_KEY_PARTS_COUNT = 4;
 
 public static final Configuration[] MAVEN2_CONFIGURATIONS = new 
Configuration[] {
 new Configuration(default, Visibility.PUBLIC,
@@ -227,8 +227,10 @@
 
 
 public void addDependency(Resource res, PomDependencyData dep) throws 
ParseException {
-if (!MAVEN2_CONF_MAPPING.containsKey(dep.getScope())) {
-String msg = Unknown scope  + dep.getScope() +  for dependency 
+String scope = dep.getScope();
+System.out.println(*** scope =  + scope);
+if ((scope != null)  (scope.length()  0)  
!MAVEN2_CONF_MAPPING.containsKey(scope)) {
+String msg = Unknown scope ' + scope + ' for dependency

svn commit: r659217 - /ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java

2008-05-22 Thread maartenc
Author: maartenc
Date: Thu May 22 12:24:02 2008
New Revision: 659217

URL: http://svn.apache.org/viewvc?rev=659217view=rev
Log:
Forgot to remove System.out.println (IVY-811)

Modified:

ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java?rev=659217r1=659216r2=659217view=diff
==
--- 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java
 (original)
+++ 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java
 Thu May 22 12:24:02 2008
@@ -228,7 +228,6 @@
 
 public void addDependency(Resource res, PomDependencyData dep) throws 
ParseException {
 String scope = dep.getScope();
-System.out.println(*** scope =  + scope);
 if ((scope != null)  (scope.length()  0)  
!MAVEN2_CONF_MAPPING.containsKey(scope)) {
 String msg = Unknown scope ' + scope + ' for dependency 
 + ModuleId.newInstance(dep.getGroupId(), 
dep.getArtifactId()) +  in 




svn commit: r659266 - in /ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2: PomModuleDescriptorParserTest.java test-dependencyMgt-with-scope.pom

2008-05-22 Thread maartenc
Author: maartenc
Date: Thu May 22 14:40:17 2008
New Revision: 659266

URL: http://svn.apache.org/viewvc?rev=659266view=rev
Log:
Added junit test for IVY-811

Added:

ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-dependencyMgt-with-scope.pom
Modified:

ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java

Modified: 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java?rev=659266r1=659265r2=659266view=diff
==
--- 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java
 (original)
+++ 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java
 Thu May 22 14:40:17 2008
@@ -495,7 +495,24 @@
 dds[0].getDependencyRevisionId());
 assertEquals(There is no special artifact when there is no 
classifier, 
  0, dds[0].getAllDependencyArtifacts().length);
-
+}
+
+public void testDependencyManagmentWithScope() throws ParseException, 
IOException {
+ModuleDescriptor md = 
PomModuleDescriptorParser.getInstance().parseDescriptor(
+settings, 
getClass().getResource(test-dependencyMgt-with-scope.pom), false);
+assertNotNull(md);
+assertEquals(ModuleRevisionId.newInstance(org.apache, test-depMgt, 
1.1), 
+md.getModuleRevisionId());
+
+DependencyDescriptor[] dds = md.getDependencies();
+assertNotNull(dds);
+assertEquals(1, dds.length);
+assertEquals(ModuleRevisionId.newInstance(commons-logging, 
commons-logging, 1.0.4),
+dds[0].getDependencyRevisionId());
+assertEquals(There is no special artifact when there is no 
classifier, 
+ 0, dds[0].getAllDependencyArtifacts().length);
+assertEquals(The number of configurations is incorrect, 1, 
dds[0].getModuleConfigurations().length);
+assertEquals(The configuration must be test, test, 
dds[0].getModuleConfigurations()[0]);
 }
 
 public void testParentDependencyMgt() throws ParseException, IOException { 
   

Added: 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-dependencyMgt-with-scope.pom
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-dependencyMgt-with-scope.pom?rev=659266view=auto
==
--- 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-dependencyMgt-with-scope.pom
 (added)
+++ 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-dependencyMgt-with-scope.pom
 Thu May 22 14:40:17 2008
@@ -0,0 +1,52 @@
+?xml version=1.0?
+!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   License); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+--
+project
+  modelVersion4.0.0/modelVersion
+  groupIdorg.apache/groupId
+  artifactIdtest-depMgt/artifactId
+  nameTest Module for Ivy M2 parsing/name
+  version1.1/version
+  urlhttp://ivy.jayasoft.org//url
+  organization
+nameJayasoft/name
+urlhttp://www.jayasoft.org//url
+  /organization
+  dependencyManagement
+dependencies
+  dependency
+groupIdcommons-logging/groupId
+artifactIdcommons-logging/artifactId
+version1.0.4/version
+scopetest/scope
+  /dependency
+  dependency
+  groupIdcommons-collection/groupId
+  artifactIdcommons-collection/artifactId
+  version1.0.5/version
+  /dependency
+/dependencies
+  /dependencyManagement
+  dependencies
+dependency
+  groupIdcommons-logging/groupId
+  artifactIdcommons-logging/artifactId
+/dependency
+  /dependencies
+/project




svn commit: r663380 - /ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyReportTest.java

2008-06-04 Thread maartenc
Author: maartenc
Date: Wed Jun  4 14:54:02 2008
New Revision: 663380

URL: http://svn.apache.org/viewvc?rev=663380view=rev
Log:
Set graphml to false before executing the report task...

Modified:
ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyReportTest.java

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyReportTest.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyReportTest.java?rev=663380r1=663379r2=663380view=diff
==
--- ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyReportTest.java 
(original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyReportTest.java Wed Jun  
4 14:54:02 2008
@@ -94,8 +94,8 @@
 res.setFile(new 
File(test/java/org/apache/ivy/ant/ivy-simple.xml));
 res.execute();
 
-report.execute();
 report.setGraph(false);
+report.execute();
 
 assertTrue(new 
File(apache-resolve-simple-default.html).exists());
 assertTrue(new File(ivy-report.css).exists()); // IVY-826




svn commit: r666836 - in /ant/ivy/core/trunk: CHANGES.txt build.xml

2008-06-11 Thread maartenc
Author: maartenc
Date: Wed Jun 11 14:03:09 2008
New Revision: 666836

URL: http://svn.apache.org/viewvc?rev=666836view=rev
Log:
FIX: Ivy build system: fix build.xml to allow ant coverage-report behind a 
proxy (IVY-832)

Modified:
ant/ivy/core/trunk/CHANGES.txt
ant/ivy/core/trunk/build.xml

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=666836r1=666835r2=666836view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Wed Jun 11 14:03:09 2008
@@ -85,6 +85,7 @@
 - IMPROVEMENT: Change allownomd and skipbuildwithoutivy into a more 
semantically correct name (IVY-297)
 - IMPROVEMENT: Smarter determination if an expression is exact or not for 
RegexpPatternMatcher and GlobPatternMatcher
 
+- FIX: Ivy build system: fix build.xml to allow ant coverage-report behind a 
proxy (IVY-832)
 - FIX: NPE in AbstractResolver.exists() if a resource cannot be found (IVY-831)
 - FIX: Ivy distribution jars contains duplicate entries (IVY-828)
 - FIX: ivy:report will generate an HTML file that references non-existent 
ivy-report.css (IVY-826)

Modified: ant/ivy/core/trunk/build.xml
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/build.xml?rev=666836r1=666835r2=666836view=diff
==
--- ant/ivy/core/trunk/build.xml (original)
+++ ant/ivy/core/trunk/build.xml Wed Jun 11 14:03:09 2008
@@ -335,8 +335,8 @@
 artifactsPattern=${artifacts.build.dir}/[type]s/[artifact].[ext] 
 forcedeliver=true /
 /target
-
-!-- =
+
+   !-- =
  TESTS
  = --
 target name=build-custom-resolver-jar depends=jar
@@ -438,6 +438,11 @@
 classpath
 path refid=test.classpath /
 /classpath
+   
+   !-- pass the proxy properties to the forked junit process to 
use correct proxy --
+   syspropertyset
+   propertyref prefix=http /
+   /syspropertyset
 jvmarg 
value=-Demma.coverage.out.file=${coverage.dir}/coverage.emma /
 jvmarg value=-Demma.coverage.out.merge=true /
 




svn commit: r667269 - in /ant/ivy/core/trunk: ./ src/java/org/apache/ivy/plugins/matcher/ test/java/org/apache/ivy/core/settings/

2008-06-12 Thread maartenc
Author: maartenc
Date: Thu Jun 12 15:17:39 2008
New Revision: 667269

URL: http://svn.apache.org/viewvc?rev=667269view=rev
Log:
FIX: NPE in ivy:install if ivy.settings.xml contains custom attribute for a 
module (IVY-838)

Added:

ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-extra-module-attribute.xml
Modified:
ant/ivy/core/trunk/CHANGES.txt
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/matcher/MapMatcher.java

ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/XmlSettingsParserTest.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=667269r1=667268r2=667269view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Thu Jun 12 15:17:39 2008
@@ -86,6 +86,7 @@
 - IMPROVEMENT: Change allownomd and skipbuildwithoutivy into a more 
semantically correct name (IVY-297)
 - IMPROVEMENT: Smarter determination if an expression is exact or not for 
RegexpPatternMatcher and GlobPatternMatcher
 
+- FIX: NPE in ivy:install if ivy.settings.xml contains custom attribute for a 
module (IVY-838)
 - FIX: Ivy unit tests fail because 'classifier' attribute of 'artifacts' 
element is missing in ivy.xsd (IVY-837)
 - FIX: Ivy build system: fix build.xml to allow ant coverage-report behind a 
proxy (IVY-832)
 - FIX: NPE in AbstractResolver.exists() if a resource cannot be found (IVY-831)

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/matcher/MapMatcher.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/matcher/MapMatcher.java?rev=667269r1=667268r2=667269view=diff
==
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/matcher/MapMatcher.java 
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/matcher/MapMatcher.java 
Thu Jun 12 15:17:39 2008
@@ -45,11 +45,14 @@
 public boolean matches(Map/*String,String*/ m) {
 for (Iterator iter = matchers.entrySet().iterator(); iter.hasNext();) {
 Entry entry = (Entry) iter.next();
-if (!((Matcher) entry.getValue())
-.matches((String) m.get(entry.getKey( {
+
+Matcher matcher = (Matcher) entry.getValue();
+String value = (String) m.get(entry.getKey());
+if ((value == null) || !matcher.matches(value)) {
 return false;
 }
 }
+
 return true;
 }
 

Modified: 
ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/XmlSettingsParserTest.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/XmlSettingsParserTest.java?rev=667269r1=667268r2=667269view=diff
==
--- 
ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/XmlSettingsParserTest.java
 (original)
+++ 
ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/XmlSettingsParserTest.java
 Thu Jun 12 15:17:39 2008
@@ -174,6 +174,14 @@
 assertEquals(dynamic, settings.getResolveMode(new ModuleId(apache, 
ivyde)));
 assertEquals(default, settings.getResolveMode(new ModuleId(apache, 
ant)));
 }
+
+public void testExtraModuleAttribute() throws Exception {
+IvySettings settings = new IvySettings();
+XmlSettingsParser parser = new XmlSettingsParser(settings);
+
parser.parse(XmlSettingsParserTest.class.getResource(ivysettings-extra-module-attribute.xml));
+
+assertEquals(default, settings.getResolveMode(new ModuleId(foo, 
bar)));
+}
 
 public void testCache() throws Exception {
 IvySettings settings = new IvySettings();

Added: 
ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-extra-module-attribute.xml
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-extra-module-attribute.xml?rev=667269view=auto
==
--- 
ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-extra-module-attribute.xml
 (added)
+++ 
ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/ivysettings-extra-module-attribute.xml
 Thu Jun 12 15:17:39 2008
@@ -0,0 +1,24 @@
+!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   License); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed

svn commit: r667272 - /ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/XmlSettingsParserTest.java

2008-06-12 Thread maartenc
Author: maartenc
Date: Thu Jun 12 15:23:44 2008
New Revision: 667272

URL: http://svn.apache.org/viewvc?rev=667272view=rev
Log:
Improved junit test...

Modified:

ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/XmlSettingsParserTest.java

Modified: 
ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/XmlSettingsParserTest.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/XmlSettingsParserTest.java?rev=667272r1=667271r2=667272view=diff
==
--- 
ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/XmlSettingsParserTest.java
 (original)
+++ 
ant/ivy/core/trunk/test/java/org/apache/ivy/core/settings/XmlSettingsParserTest.java
 Thu Jun 12 15:23:44 2008
@@ -180,7 +180,7 @@
 XmlSettingsParser parser = new XmlSettingsParser(settings);
 
parser.parse(XmlSettingsParserTest.class.getResource(ivysettings-extra-module-attribute.xml));
 
-assertEquals(default, settings.getResolveMode(new ModuleId(foo, 
bar)));
+assertEquals(default, settings.getResolveMode(new ModuleId(apache, 
ivy)));
 }
 
 public void testCache() throws Exception {




svn commit: r678558 - /ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/PackagerResolverTest.java

2008-07-21 Thread maartenc
Author: maartenc
Date: Mon Jul 21 13:49:30 2008
New Revision: 678558

URL: http://svn.apache.org/viewvc?rev=678558view=rev
Log:
Fixed compilation problem.

Modified:

ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/PackagerResolverTest.java

Modified: 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/PackagerResolverTest.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/PackagerResolverTest.java?rev=678558r1=678557r2=678558view=diff
==
--- 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/PackagerResolverTest.java
 (original)
+++ 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/PackagerResolverTest.java
 Mon Jul 21 13:49:30 2008
@@ -35,7 +35,6 @@
 import org.apache.ivy.core.resolve.ResolvedModuleRevision;
 import org.apache.ivy.core.settings.IvySettings;
 import org.apache.ivy.core.sort.SortEngine;
-import org.apache.ivy.plugins.resolver.packager.PackagerProperty;
 import org.apache.ivy.plugins.resolver.packager.PackagerResolver;
 import org.apache.ivy.util.DefaultMessageLogger;
 import org.apache.ivy.util.FileUtil;




svn commit: r678564 - /ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/PackagerResolverTest.java

2008-07-21 Thread maartenc
Author: maartenc
Date: Mon Jul 21 13:56:42 2008
New Revision: 678564

URL: http://svn.apache.org/viewvc?rev=678564view=rev
Log:
Fixed problem with test on some VM's where XSLT doesn't like the Turkish locale.

Modified:

ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/PackagerResolverTest.java

Modified: 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/PackagerResolverTest.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/PackagerResolverTest.java?rev=678564r1=678563r2=678564view=diff
==
--- 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/PackagerResolverTest.java
 (original)
+++ 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/PackagerResolverTest.java
 Mon Jul 21 13:56:42 2008
@@ -20,6 +20,7 @@
 import java.io.File;
 import java.util.Date;
 import java.util.GregorianCalendar;
+import java.util.Locale;
 
 import org.apache.ivy.core.event.EventManager;
 import org.apache.ivy.core.module.descriptor.Artifact;
@@ -63,7 +64,6 @@
 private File _websitedir;
 
 protected void setUp() throws Exception {
-
 _settings = new IvySettings();
 Message.setDefaultLogger(new DefaultMessageLogger(99));
 _engine = new ResolveEngine(_settings, new EventManager(), new 
SortEngine(_settings));
@@ -102,75 +102,84 @@
 }
 
 public void testFile() throws Exception {
-
-// Create and configure resolver
-PackagerResolver resolver = new PackagerResolver();
-resolver.setSettings(_settings);
-File repoRoot = new File(test/repositories/packager/repo);
-resolver.addIvyPattern(
-   + new File(repoRoot, 
[organisation]/[module]/[revision]/ivy.xml).getAbsoluteFile().toURL().toExternalForm());
-resolver.setPackagerPattern(
-   + new File(repoRoot, 
[organisation]/[module]/[revision]/packager.xml).getAbsoluteFile().toURL().toExternalForm());
-resolver.setBuildRoot(_builddir.getAbsolutePath());
-resolver.setResourceCache(_cachedir.getAbsolutePath());
-resolver.setPreserveBuildDirectories(true);
-resolver.setVerbose(true);
+Locale oldLocale = Locale.getDefault();
 
-System.setProperty(packager.website.url, new 
File(test/repositories/packager/website).getAbsoluteFile().toURL().toExternalForm());
-
-resolver.setName(packager);
-assertEquals(packager, resolver.getName());
-
-// Get module descriptor
-ModuleRevisionId mrid = ModuleRevisionId.newInstance(org, mod, 
1.0);
-ResolvedModuleRevision rmr = resolver.getDependency(
-  new DefaultDependencyDescriptor(mrid, false), _data);
-assertNotNull(rmr);
-
-assertEquals(mrid, rmr.getId());
-Date pubdate = new GregorianCalendar(2004, 10, 1, 11, 0, 0).getTime();
-assertEquals(pubdate, rmr.getPublicationDate());
-
-// Download artifact
-Artifact artifact = new DefaultArtifact(mrid, pubdate, mod, jar, 
jar);
-DownloadReport report = resolver.download(new Artifact[] {artifact}, 
downloadOptions());
-assertNotNull(report);
-
-assertEquals(1, report.getArtifactsReports().length);
-
-ArtifactDownloadReport ar = report.getArtifactReport(artifact);
-System.out.println(downloaddetails:  + ar.getDownloadDetails());
-assertNotNull(ar);
-
-assertEquals(artifact, ar.getArtifact());
-assertEquals(DownloadStatus.SUCCESSFUL, ar.getDownloadStatus());
-
-// Verify resource cache now contains the distribution archive
-assertTrue(new File(_cachedir, mod-1.0.tar.gz).exists());
-
-// Download again, should use Ivy cache this time
-report = resolver.download(new Artifact[] {artifact}, 
downloadOptions());
-assertNotNull(report);
-
-assertEquals(1, report.getArtifactsReports().length);
-
-ar = report.getArtifactReport(artifact);
-assertNotNull(ar);
-
-assertEquals(artifact, ar.getArtifact());
-assertEquals(DownloadStatus.NO, ar.getDownloadStatus());
-
-// Now download the maven2 artifact
-artifact = DefaultArtifact.cloneWithAnotherName(artifact, 
foobar-janfu);
-report = resolver.download(new Artifact[] {artifact}, 
downloadOptions());
-assertNotNull(report);
-
-assertEquals(1, report.getArtifactsReports().length);
-
-ar = report.getArtifactReport(artifact);
-assertNotNull(ar);
-
-assertEquals(artifact, ar.getArtifact());
-assertEquals(DownloadStatus.SUCCESSFUL, ar.getDownloadStatus());
+try {
+// set the locale to UK as workaround for SUN bug 6240963
+Locale.setDefault(Locale.UK);
+
+
+// Create and configure resolver
+PackagerResolver resolver = new PackagerResolver();
+resolver.setSettings(_settings

svn commit: r682974 - in /ant/ivy/core/trunk: ./ src/java/org/apache/ivy/plugins/parser/m2/ test/java/org/apache/ivy/plugins/parser/m2/

2008-08-05 Thread maartenc
Author: maartenc
Date: Tue Aug  5 14:45:49 2008
New Revision: 682974

URL: http://svn.apache.org/viewvc?rev=682974view=rev
Log:
FIX: Maven2 ejb packaging is not supported (IVY-873)

Added:

ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-ejb-packaging.pom
Modified:
ant/ivy/core/trunk/CHANGES.txt

ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java

ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=682974r1=682973r2=682974view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Tue Aug  5 14:45:49 2008
@@ -101,6 +101,7 @@
 - IMPROVEMENT: Smarter determination if an expression is exact or not for 
RegexpPatternMatcher and GlobPatternMatcher
 - IMPROVEMENT: Check branch consistency during resolve (IVY-858)
 
+- FIX: Maven2 ejb packaging is not supported (IVY-873)
 - FIX: Config files with # in path can't be read (IVY-868) (thanks to Simon 
Steiner)
 - FIX: Cache can't distinguish artifacts with classifiers (IVY-803) (thanks to 
James P. White)
 - FIX: Reports showing double dependencies in certain cases (IVY-578)

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java?rev=682974r1=682973r2=682974view=diff
==
--- 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java
 (original)
+++ 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java
 Tue Aug  5 14:45:49 2008
@@ -213,7 +213,15 @@
 
 
 public void addArtifact(String artifactId, String packaging) {
-String ext = packaging;
+String ext;
+if (pom.equals(packaging)) {
+// no artifact defined!
+return;
+} else if (ejb.equals(packaging)) {
+ext = jar;
+} else {
+ext = packaging;
+}
 
 // TODO: we should refactor the following code into something more 
configurable
 
@@ -231,7 +239,7 @@
 }
 
 ivyModuleDescriptor.addArtifact(master, 
-new DefaultArtifact(mrid, new Date(), artifactId, ext, ext));
+new DefaultArtifact(mrid, new Date(), artifactId, packaging, 
ext));
 }
 
 

Modified: 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java?rev=682974r1=682973r2=682974view=diff
==
--- 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java
 (original)
+++ 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java
 Tue Aug  5 14:45:49 2008
@@ -121,6 +121,22 @@
 assertEquals(war, artifact[0].getType());
 }
 
+public void testEjbPackaging() throws Exception {
+ModuleDescriptor md = 
PomModuleDescriptorParser.getInstance().parseDescriptor(
+settings, getClass().getResource(test-ejb-packaging.pom), false);
+assertNotNull(md);
+
+ModuleRevisionId mrid = ModuleRevisionId.newInstance(org.apache, 
test, 1.0);
+assertEquals(mrid, md.getModuleRevisionId());
+
+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(ejb, artifact[0].getType());
+}
+
 
 public void testParent() throws Exception {
 ModuleDescriptor md = 
PomModuleDescriptorParser.getInstance().parseDescriptor(

Added: 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-ejb-packaging.pom
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-ejb-packaging.pom?rev=682974view=auto
==
--- 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-ejb-packaging.pom
 (added)
+++ 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-ejb-packaging.pom
 Tue Aug  5 14:45:49 2008
@@ -0,0 +1,32 @@
+?xml version=1.0?
+!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding

svn commit: r683017 - /ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/url/URLRepository.java

2008-08-05 Thread maartenc
Author: maartenc
Date: Tue Aug  5 15:45:50 2008
New Revision: 683017

URL: http://svn.apache.org/viewvc?rev=683017view=rev
Log:
Attempt to fix IVY-652

Modified:

ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/url/URLRepository.java

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/url/URLRepository.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/url/URLRepository.java?rev=683017r1=683016r2=683017view=diff
==
--- 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/url/URLRepository.java
 (original)
+++ 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/url/URLRepository.java
 Tue Aug  5 15:45:50 2008
@@ -40,6 +40,7 @@
 private Map resourcesCache = new HashMap();
 
 public Resource getResource(String source) throws IOException {
+source = encode(source);
 Resource res = (Resource) resourcesCache.get(source);
 if (res == null) {
 res = new URLResource(new URL(source));
@@ -47,6 +48,11 @@
 }
 return res;
 }
+
+private static String encode(String source) {
+// TODO: add some more URL encodings here
+return source.trim().replaceAll( , %20);
+}
 
 public void get(String source, File destination) throws IOException {
 fireTransferInitiated(getResource(source), TransferEvent.REQUEST_GET);




svn commit: r683715 - in /ant/ivy/core/trunk: ./ src/java/org/apache/ivy/plugins/repository/url/ src/java/org/apache/ivy/util/ src/java/org/apache/ivy/util/url/

2008-08-07 Thread maartenc
Author: maartenc
Date: Thu Aug  7 14:08:34 2008
New Revision: 683715

URL: http://svn.apache.org/viewvc?rev=683715view=rev
Log:
NEW: Add publish support to URL resolver (IVY-848) (thanks to Brian Sanders)

Modified:
ant/ivy/core/trunk/CHANGES.txt

ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/url/URLRepository.java
ant/ivy/core/trunk/src/java/org/apache/ivy/util/FileUtil.java
ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/AbstractURLHandler.java
ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/BasicURLHandler.java
ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/HttpClientHandler.java
ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/URLHandler.java

ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/URLHandlerDispatcher.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=683715r1=683714r2=683715view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Thu Aug  7 14:08:34 2008
@@ -61,6 +61,7 @@
Geoff Reedy
Christian Riege
Andreas Sahlbach
+   Brian Sanders
Adrian Sandor
Ruslan Shevchenko
John Shields
@@ -75,6 +76,7 @@
 
trunk version
 =
+- NEW: Add publish support to URL resolver (IVY-848) (thanks to Brian Sanders)
 - NEW: Better support for local builds (IVY-857)
 - NEW: Retain original dependency constraint rules in resolved ivy file 
(IVY-739)
 - NEW: Add a new resolve mode (optionally per module) to utilize dynamic 
constraint rule metadata (IVY-740)

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/url/URLRepository.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/url/URLRepository.java?rev=683715r1=683714r2=683715view=diff
==
--- 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/url/URLRepository.java
 (original)
+++ 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/url/URLRepository.java
 Thu Aug  7 14:08:34 2008
@@ -20,13 +20,7 @@
 import java.io.File;
 import java.io.IOException;
 import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Map;
-
+import java.util.*;
 import org.apache.ivy.plugins.repository.AbstractRepository;
 import org.apache.ivy.plugins.repository.RepositoryCopyProgressListener;
 import org.apache.ivy.plugins.repository.Resource;
@@ -75,8 +69,27 @@
 }
 
 public void put(File source, String destination, boolean overwrite) throws 
IOException {
-throw new UnsupportedOperationException(
-URL repository is not able to put files for the moment);
+if (!overwrite) {
+throw new UnsupportedOperationException(
+URL repository do not support append operations at the 
moment);
+}
+
+fireTransferInitiated(getResource(destination), 
TransferEvent.REQUEST_PUT);
+try {
+long totalLength = source.length();
+if (totalLength  0) {
+progress.setTotalLength(new Long(totalLength));
+}
+FileUtil.copy(source, new URL(destination), progress);
+} catch (IOException ex) {
+fireTransferError(ex);
+throw ex;
+} catch (RuntimeException ex) {
+fireTransferError(ex);
+throw ex;
+} finally {
+progress.setTotalLength(null);
+}
 }
 
 private ApacheURLLister lister = new ApacheURLLister();

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/util/FileUtil.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/util/FileUtil.java?rev=683715r1=683714r2=683715view=diff
==
--- ant/ivy/core/trunk/src/java/org/apache/ivy/util/FileUtil.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/util/FileUtil.java Thu Aug  7 
14:08:34 2008
@@ -136,6 +136,10 @@
 URLHandlerRegistry.getDefault().download(src, dest, l);
 }
 
+public static void copy(File src, URL dest, CopyProgressListener l) throws 
IOException {
+URLHandlerRegistry.getDefault().upload(src, dest, l);
+}
+
 public static void copy(InputStream src, File dest, CopyProgressListener 
l) throws IOException {
 if (dest.getParentFile() != null) {
 dest.getParentFile().mkdirs();
@@ -172,6 +176,12 @@
 evt.update(EMPTY_BUFFER, 0, total);
 }
 
+try {
+dest.flush();
+} catch (IOException ex) {
+// ignore
+}
+
 // close the streams

svn commit: r684120 - in /ant/ivy/core/trunk: CHANGES.txt src/java/org/apache/ivy/util/url/BasicURLHandler.java src/java/org/apache/ivy/util/url/HttpClientHandler.java

2008-08-08 Thread maartenc
Author: maartenc
Date: Fri Aug  8 14:59:36 2008
New Revision: 684120

URL: http://svn.apache.org/viewvc?rev=684120view=rev
Log:
NEW: Report version of Ivy in HTTP headers (user-agent?) when Ivy downloads 
artifacts (IVY-878)

Modified:
ant/ivy/core/trunk/CHANGES.txt
ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/BasicURLHandler.java
ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/HttpClientHandler.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=684120r1=684119r2=684120view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Fri Aug  8 14:59:36 2008
@@ -76,6 +76,7 @@
 
trunk version
 =
+- NEW: Report version of Ivy in HTTP headers (user-agent?) when Ivy downloads 
artifacts (IVY-878)
 - NEW: Add publish support to URL resolver (IVY-848) (thanks to Brian Sanders)
 - NEW: Better support for local builds (IVY-857)
 - NEW: Retain original dependency constraint rules in resolved ivy file 
(IVY-739)

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/BasicURLHandler.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/BasicURLHandler.java?rev=684120r1=684119r2=684120view=diff
==
--- ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/BasicURLHandler.java 
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/BasicURLHandler.java 
Fri Aug  8 14:59:36 2008
@@ -23,6 +23,7 @@
 import java.net.URLConnection;
 import java.net.UnknownHostException;
 
+import org.apache.ivy.Ivy;
 import org.apache.ivy.util.CopyProgressListener;
 import org.apache.ivy.util.FileUtil;
 import org.apache.ivy.util.Message;
@@ -58,6 +59,7 @@
 URLConnection con = null;
 try {
 con = url.openConnection();
+con.setRequestProperty(User-Agent, Apache Ivy/ + 
Ivy.getIvyVersion());
 if (con instanceof HttpURLConnection) {
 ((HttpURLConnection) con).setRequestMethod(HEAD);
 int status = ((HttpURLConnection) con).getResponseCode();
@@ -100,6 +102,7 @@
 InputStream inStream = null;
 try {
 conn = url.openConnection();
+conn.setRequestProperty(User-Agent, Apache Ivy/ + 
Ivy.getIvyVersion());
 inStream = conn.getInputStream();
 ByteArrayOutputStream outStream = new ByteArrayOutputStream();
 
@@ -122,6 +125,7 @@
 URLConnection srcConn = null;
 try {
 srcConn = src.openConnection();
+srcConn.setRequestProperty(User-Agent, Apache Ivy/ + 
Ivy.getIvyVersion());
 int contentLength = srcConn.getContentLength();
 FileUtil.copy(srcConn.getInputStream(), dest, l);
 if (dest.length() != contentLength  contentLength != -1) {
@@ -150,7 +154,7 @@
 conn = (HttpURLConnection) dest.openConnection();
 conn.setDoOutput(true);
 conn.setRequestMethod(PUT);
-conn.setRequestProperty(User-Agent, Apache Ivy);
+conn.setRequestProperty(User-Agent, Apache Ivy/ + 
Ivy.getIvyVersion());
 conn.setRequestProperty(Content-type, 
application/octet-stream);
 conn.setRequestProperty(Content-length, 
Long.toString(source.length()));
 conn.setInstanceFollowRedirects(true);

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/HttpClientHandler.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/HttpClientHandler.java?rev=684120r1=684119r2=684120view=diff
==
--- ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/HttpClientHandler.java 
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/HttpClientHandler.java 
Fri Aug  8 14:59:36 2008
@@ -41,6 +41,8 @@
 import org.apache.commons.httpclient.methods.HeadMethod;
 import org.apache.commons.httpclient.methods.PutMethod;
 import org.apache.commons.httpclient.methods.InputStreamRequestEntity;
+import org.apache.commons.httpclient.params.HttpMethodParams;
+import org.apache.ivy.Ivy;
 import org.apache.ivy.util.CopyProgressListener;
 import org.apache.ivy.util.Credentials;
 import org.apache.ivy.util.FileUtil;
@@ -256,6 +258,9 @@
 new UsernamePasswordCredentials(proxyUserName, 
proxyPasswd));
 }
 }
+
+// user-agent
+httpClient.getParams().setParameter(http.useragent, Apache 
Ivy/ + Ivy.getIvyVersion());
 }
 
 Credentials c = getCredentials(url);




svn commit: r688894 - in /ant/ivy/core/trunk: CHANGES.txt src/java/org/apache/ivy/util/url/BasicURLHandler.java src/java/org/apache/ivy/util/url/HttpClientHandler.java

2008-08-25 Thread maartenc
Author: maartenc
Date: Mon Aug 25 14:56:56 2008
New Revision: 688894

URL: http://svn.apache.org/viewvc?rev=688894view=rev
Log:
FIX: HTTP Handlers ignore unsuccessful response codes (IVY-864) (thanks to 
James P. White)

Modified:
ant/ivy/core/trunk/CHANGES.txt
ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/BasicURLHandler.java
ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/HttpClientHandler.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=688894r1=688893r2=688894view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Mon Aug 25 14:56:56 2008
@@ -108,6 +108,7 @@
 - IMPROVEMENT: Add a memory cache for the module descriptor that are parsed 
from the cache (IVY-883)
 - IMPROVEMENT: Improve performance (IVY-872)
 
+- FIX: HTTP Handlers ignore unsuccessful response codes (IVY-864) (thanks to 
James P. White)
 - FIX: Deliver delivers the wrong version when a dynamic revision is evicted 
before being resolved (IVY-707)
 - FIX: Inconsistency with multi-project tutorial (IVY-667)
 - FIX: URLRepository does not allow some valid file scheme uri's (IVY-884)

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/BasicURLHandler.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/BasicURLHandler.java?rev=688894r1=688893r2=688894view=diff
==
--- ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/BasicURLHandler.java 
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/BasicURLHandler.java 
Mon Aug 25 14:56:56 2008
@@ -61,22 +61,11 @@
 con = url.openConnection();
 con.setRequestProperty(User-Agent, Apache Ivy/ + 
Ivy.getIvyVersion());
 if (con instanceof HttpURLConnection) {
-((HttpURLConnection) con).setRequestMethod(HEAD);
-int status = ((HttpURLConnection) con).getResponseCode();
-if (status == HttpStatus.SC_OK) {
-return new URLInfo(true, ((HttpURLConnection) 
con).getContentLength(), con
-.getLastModified());
+HttpURLConnection httpCon = (HttpURLConnection) con;
+httpCon.setRequestMethod(HEAD);
+if (checkStatusCode(url, httpCon)) {
+return new URLInfo(true, httpCon.getContentLength(), 
con.getLastModified());
 }
-if (status == HttpStatus.SC_PROXY_AUTHENTICATION_REQUIRED) {
-Message.warn(Your proxy requires authentication.);
-} else if (String.valueOf(status).startsWith(4)) {
-Message.verbose(CLIENT ERROR: 
-+ ((HttpURLConnection) con).getResponseMessage() + 
 url= + url);
-} else if (String.valueOf(status).startsWith(5)) {
-Message.error(SERVER ERROR:  + ((HttpURLConnection) 
con).getResponseMessage()
-+  url= + url);
-}
-Message.debug(HTTP response status:  + status +  url= + 
url);
 } else {
 int contentLength = con.getContentLength();
 if (contentLength = 0) {
@@ -97,12 +86,38 @@
 return UNAVAILABLE;
 }
 
+private boolean checkStatusCode(URL url, HttpURLConnection con) throws 
IOException {
+int status = con.getResponseCode();
+if (status == HttpStatus.SC_OK) {
+return true;
+}
+Message.debug(HTTP response status:  + status +  url= + url);
+if (status == HttpStatus.SC_PROXY_AUTHENTICATION_REQUIRED) {
+Message.warn(Your proxy requires authentication.);
+} else if (String.valueOf(status).startsWith(4)) {
+Message.verbose(CLIENT ERROR: 
++ ((HttpURLConnection) con).getResponseMessage() +  url= 
+ url);
+} else if (String.valueOf(status).startsWith(5)) {
+Message.error(SERVER ERROR:  + ((HttpURLConnection) 
con).getResponseMessage()
++  url= + url);
+}
+return false;
+}
+
 public InputStream openStream(URL url) throws IOException {
 URLConnection conn = null;
 InputStream inStream = null;
 try {
 conn = url.openConnection();
 conn.setRequestProperty(User-Agent, Apache Ivy/ + 
Ivy.getIvyVersion());
+if (conn instanceof HttpURLConnection) {
+HttpURLConnection httpCon = (HttpURLConnection) conn;
+if (!checkStatusCode(url, httpCon)) {
+throw new IOException(
+The HTTP response code for  + url +  did not 
indicate a success.
++  See log for more detail

svn commit: r688898 - /ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/URLHandlerRegistry.java

2008-08-25 Thread maartenc
Author: maartenc
Date: Mon Aug 25 15:09:54 2008
New Revision: 688898

URL: http://svn.apache.org/viewvc?rev=688898view=rev
Log:
temporary fix for IVY-880: only use HttpClientHandler when http-client-3.x is 
available

Modified:
ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/URLHandlerRegistry.java

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/URLHandlerRegistry.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/URLHandlerRegistry.java?rev=688898r1=688897r2=688898view=diff
==
--- ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/URLHandlerRegistry.java 
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/URLHandlerRegistry.java 
Mon Aug 25 15:09:54 2008
@@ -45,6 +45,11 @@
 public static URLHandler getHttp() {
 try {
 Class.forName(org.apache.commons.httpclient.HttpClient);
+
+// temporary fix for IVY-880: only use HttpClientHandler when 
+// http-client-3.x is available
+
Class.forName(org.apache.commons.httpclient.params.HttpClientParams);
+
 Class handler = 
Class.forName(org.apache.ivy.util.url.HttpClientHandler);
 Message.verbose(jakarta commons httpclient detected: using it for 
http downloading);
 return (URLHandler) handler.newInstance();




svn commit: r691071 - in /ant/ivy/core/trunk: ./ src/java/org/apache/ivy/plugins/parser/xml/ test/java/org/apache/ivy/plugins/parser/xml/

2008-09-01 Thread maartenc
Author: maartenc
Date: Mon Sep  1 14:52:35 2008
New Revision: 691071

URL: http://svn.apache.org/viewvc?rev=691071view=rev
Log:
FIX: Ivy Publish Task Fails When XML Comments Exist Next to Dependency 
Declarations (IVY-888)

Added:

ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/test-with-comments.xml
Modified:
ant/ivy/core/trunk/   (props changed)
ant/ivy/core/trunk/CHANGES.txt

ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorUpdater.java

ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/XmlModuleUpdaterTest.java

Propchange: ant/ivy/core/trunk/
--
--- svn:ignore (original)
+++ svn:ignore Mon Sep  1 14:52:35 2008
@@ -1,4 +1,5 @@
-.classpath
-build
-lib
-bin
+.classpath
+build
+lib
+bin
+nbproject

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=691071r1=691070r2=691071view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Mon Sep  1 14:52:35 2008
@@ -108,6 +108,7 @@
 - IMPROVEMENT: Add a memory cache for the module descriptor that are parsed 
from the cache (IVY-883)
 - IMPROVEMENT: Improve performance (IVY-872)
 
+- FIX: Ivy Publish Task Fails When XML Comments Exist Next to Dependency 
Declarations (IVY-888)
 - FIX: Incorrect directory path resolve when running from a different 
directory (IVY-232)
 - FIX: Ivy#listTokenValues(String, Map) does not filter returned values, and 
does not use maven-metadata.xml files with IBiblio resolver (IVY-886)
 - FIX: Circular Dependency messages in a resolve do not reflect the 
configuration used during the resolve (IVY-708)

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorUpdater.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorUpdater.java?rev=691071r1=691070r2=691071view=diff
==
--- 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorUpdater.java
 (original)
+++ 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorUpdater.java
 Mon Sep  1 14:52:35 2008
@@ -704,6 +704,10 @@
 }
 
 public void comment(char[] ch, int start, int length) throws 
SAXException {
+if (justOpen != null) {
+write();
+justOpen = null;
+}
 if (!inHeader) {
 StringBuffer comment = new StringBuffer();
 comment.append(ch, start, length);

Modified: 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/XmlModuleUpdaterTest.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/XmlModuleUpdaterTest.java?rev=691071r1=691070r2=691071view=diff
==
--- 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/XmlModuleUpdaterTest.java
 (original)
+++ 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/XmlModuleUpdaterTest.java
 Mon Sep  1 14:52:35 2008
@@ -17,6 +17,7 @@
  */
 package org.apache.ivy.plugins.parser.xml;
 
+import java.io.BufferedOutputStream;
 import java.io.BufferedReader;
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
@@ -78,6 +79,23 @@
 assertEquals(expected, updated);
 }
 
+public void testUpdateWithComments() throws Exception {
+ByteArrayOutputStream buffer = new ByteArrayOutputStream();
+URL settingsUrl = new 
File(test/java/org/apache/ivy/plugins/parser/xml/ 
++ test-with-comments.xml).toURL();
+XmlModuleDescriptorUpdater.update(settingsUrl, new 
BufferedOutputStream(buffer, 1024), 
+getUpdateOptions(release, mynewrev));
+
+XmlModuleDescriptorParser parser = 
XmlModuleDescriptorParser.getInstance();
+ModuleDescriptor updatedMd = parser.parseDescriptor(new IvySettings(),
+new ByteArrayInputStream(buffer.toByteArray()), new 
BasicResource(test, false, 0, 0,
+false), true);
+
+DependencyDescriptor[] dependencies = updatedMd.getDependencies();
+assertNotNull(dependencies);
+assertEquals(3, dependencies.length);
+}
+
 public void testVariableReplacement() throws Exception {
 /*
  * For updated file to be equals to updated.xml, we have to fix the 
line separator to the

Added: 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/test-with-comments.xml
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/test-with-comments.xml?rev=691071view=auto

svn commit: r691785 - /ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyAntSettings.java

2008-09-03 Thread maartenc
Author: maartenc
Date: Wed Sep  3 14:31:50 2008
New Revision: 691785

URL: http://svn.apache.org/viewvc?rev=691785view=rev
Log:
Slightly changed error message

Modified:
ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyAntSettings.java

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyAntSettings.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyAntSettings.java?rev=691785r1=691784r2=691785view=diff
==
--- ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyAntSettings.java 
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyAntSettings.java Wed Sep  
3 14:31:50 2008
@@ -271,10 +271,10 @@
 ivyEngine = ivy;
 } catch (ParseException e) {
 throw new BuildException(impossible to configure ivy:settings 
with given 
-+ (file != null ? file:  + file : url : + url) +  : 
+ e, e);
++ (file != null ? file:  + file : url:  + url) +  :  
+ e, e);
 } catch (IOException e) {
 throw new BuildException(impossible to configure ivy:settings 
with given 
-+ (file != null ? file:  + file : url : + url) +  : 
+ e, e);
++ (file != null ? file:  + file : url:  + url) +  :  
+ e, e);
 } finally {
 ivy.getLoggerEngine().popLogger();
 }




svn commit: r691802 - /ant/ivy/core/trunk/CHANGES.txt

2008-09-03 Thread maartenc
Author: maartenc
Date: Wed Sep  3 14:58:13 2008
New Revision: 691802

URL: http://svn.apache.org/viewvc?rev=691802view=rev
Log:
add variable expansion in extra attributes (IVY-798)

Modified:
ant/ivy/core/trunk/CHANGES.txt

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=691802r1=691801r2=691802view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Wed Sep  3 14:58:13 2008
@@ -111,6 +111,7 @@
 - IMPROVEMENT: Add a memory cache for the module descriptor that are parsed 
from the cache (IVY-883)
 - IMPROVEMENT: Improve performance (IVY-872)
 
+- FIX: add variable expansion in extra attributes (IVY-798)
 - FIX: Invalid URL when using dynamic ranges (IVY-885)
 - FIX: can't use gotoNode with a node which has not been visited yet (IVY-874)
 - FIX: Ivy Publish Task Fails When XML Comments Exist Next to Dependency 
Declarations (IVY-888)




svn commit: r691877 - in /ant/ivy/core/trunk: CHANGES.txt src/java/org/apache/ivy/util/ConfigurationUtils.java test/java/org/apache/ivy/ant/IvyResolveTest.java

2008-09-04 Thread maartenc
Author: maartenc
Date: Wed Sep  3 23:08:00 2008
New Revision: 691877

URL: http://svn.apache.org/viewvc?rev=691877view=rev
Log:
FIX: Enable consistent support of the configuration negation operator (IVY-894)

Modified:
ant/ivy/core/trunk/CHANGES.txt
ant/ivy/core/trunk/src/java/org/apache/ivy/util/ConfigurationUtils.java
ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyResolveTest.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=691877r1=691876r2=691877view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Wed Sep  3 23:08:00 2008
@@ -111,6 +111,7 @@
 - IMPROVEMENT: Add a memory cache for the module descriptor that are parsed 
from the cache (IVY-883)
 - IMPROVEMENT: Improve performance (IVY-872)
 
+- FIX: Enable consistent support of the configuration negation operator 
(IVY-894)
 - FIX: add variable expansion in extra attributes (IVY-798)
 - FIX: Invalid URL when using dynamic ranges (IVY-885)
 - FIX: can't use gotoNode with a node which has not been visited yet (IVY-874)

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/util/ConfigurationUtils.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/util/ConfigurationUtils.java?rev=691877r1=691876r2=691877view=diff
==
--- ant/ivy/core/trunk/src/java/org/apache/ivy/util/ConfigurationUtils.java 
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/util/ConfigurationUtils.java Wed 
Sep  3 23:08:00 2008
@@ -20,6 +20,7 @@
 import java.util.Arrays;
 import java.util.LinkedHashSet;
 import java.util.Set;
+import java.util.Iterator;
 
 import org.apache.ivy.core.module.descriptor.Configuration;
 import org.apache.ivy.core.module.descriptor.ModuleDescriptor;
@@ -61,6 +62,7 @@
 }
 
 Set result = new LinkedHashSet();
+Set excluded = new LinkedHashSet();
 for (int i = 0; i  confs.length; i++) {
 if (*.equals(confs[i])) {
 result.addAll(Arrays.asList(md.getConfigurationsNames()));
@@ -78,10 +80,15 @@
 result.add(all[j].getName());
 }
 }
+} else if (confs[i].startsWith(!)) {
+excluded.add(confs[i].substring( 1 ));
 } else {
 result.add(confs[i]);
 }
 }
+for (Iterator iter = excluded.iterator(); iter.hasNext();) {
+result.remove(iter.next());
+}
 
 return (String[]) result.toArray(new String[result.size()]);
 }

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyResolveTest.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyResolveTest.java?rev=691877r1=691876r2=691877view=diff
==
--- ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyResolveTest.java 
(original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyResolveTest.java Wed Sep 
 3 23:08:00 2008
@@ -388,6 +388,17 @@
 
assertNotNull(project.getReference(ivy.resolved.configurations.ref.testWithResolveId));
 }
 
+public void testExcludedConf() throws Exception {
+resolve.setFile(new 
File(test/java/org/apache/ivy/ant/ivy-multiconf.xml));
+resolve.setConf(*,!default);
+resolve.execute();
+
+assertTrue(getIvyFileInCache(
+ModuleRevisionId.newInstance(org1, mod1.1, 2.0)).exists());
+assertFalse(getIvyFileInCache(
+ModuleRevisionId.newInstance(org1, mod1.2, 2.0)).exists());
+}
+
 public void testResolveWithAbsoluteFile() {
 // IVY-396
 File ivyFile = new File(test/java/org/apache/ivy/ant/ivy-simple.xml);




svn commit: r691878 - /ant/ivy/core/trunk/CHANGES.txt

2008-09-04 Thread maartenc
Author: maartenc
Date: Wed Sep  3 23:08:57 2008
New Revision: 691878

URL: http://svn.apache.org/viewvc?rev=691878view=rev
Log:
The patch came from Patrick Woodworth

Modified:
ant/ivy/core/trunk/CHANGES.txt

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=691878r1=691877r2=691878view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Wed Sep  3 23:08:57 2008
@@ -111,7 +111,7 @@
 - IMPROVEMENT: Add a memory cache for the module descriptor that are parsed 
from the cache (IVY-883)
 - IMPROVEMENT: Improve performance (IVY-872)
 
-- FIX: Enable consistent support of the configuration negation operator 
(IVY-894)
+- FIX: Enable consistent support of the configuration negation operator 
(IVY-894) (thanks to Patrick Woodworth)
 - FIX: add variable expansion in extra attributes (IVY-798)
 - FIX: Invalid URL when using dynamic ranges (IVY-885)
 - FIX: can't use gotoNode with a node which has not been visited yet (IVY-874)




svn commit: r692729 - in /ant/ivy/core/trunk: ./ src/java/org/apache/ivy/plugins/parser/m2/ test/java/org/apache/ivy/plugins/parser/m2/

2008-09-06 Thread maartenc
Author: maartenc
Date: Sat Sep  6 13:32:48 2008
New Revision: 692729

URL: http://svn.apache.org/viewvc?rev=692729view=rev
Log:
FIX: Ivy ibiblio resolver chokes on variables while checking descriptor 
consistency (IVY-818)

Modified:
ant/ivy/core/trunk/CHANGES.txt

ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java

ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java

ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java

ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-parent-properties.pom

ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-version.pom

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=692729r1=692728r2=692729view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Sat Sep  6 13:32:48 2008
@@ -111,6 +111,7 @@
 - IMPROVEMENT: Add a memory cache for the module descriptor that are parsed 
from the cache (IVY-883)
 - IMPROVEMENT: Improve performance (IVY-872)
 
+- FIX: Ivy ibiblio resolver chokes on variables while checking descriptor 
consistency (IVY-818)
 - FIX: Enable consistent support of the configuration negation operator 
(IVY-894) (thanks to Patrick Woodworth)
 - FIX: add variable expansion in extra attributes (IVY-798)
 - FIX: Invalid URL when using dynamic ranges (IVY-885)

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java?rev=692729r1=692728r2=692729view=diff
==
--- 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java
 (original)
+++ 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java
 Sat Sep  6 13:32:48 2008
@@ -328,7 +328,7 @@
 public void addPlugin(PomDependencyMgt plugin) {
 String pluginValue = plugin.getGroupId() + EXTRA_INFO_DELIMITER + 
plugin.getArtifactId() 
 + EXTRA_INFO_DELIMITER + plugin.getVersion();
-String pluginExtraInfo = (String) 
ivyModuleDescriptor.getExtraInfo().get(maven.plugins);
+String pluginExtraInfo = (String) 
ivyModuleDescriptor.getExtraInfo().get(m:maven.plugins);
 if (pluginExtraInfo == null) {
 pluginExtraInfo = pluginValue;
 } else {

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java?rev=692729r1=692728r2=692729view=diff
==
--- 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
 (original)
+++ 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
 Sat Sep  6 13:32:48 2008
@@ -111,10 +111,33 @@
 PomModuleDescriptorBuilder mdBuilder = new 
PomModuleDescriptorBuilder(this, res);
 
 try {   
-PomReader domReader = new PomReader(descriptorURL, res);
-
+PomReader domReader = new PomReader(descriptorURL, res);   
 
 domReader.setProperty(parent.version, 
domReader.getParentVersion());
 
+ModuleDescriptor parentDescr = null;
+if (domReader.hasParent()) {
+//Is there any other parent properties?
+
+ModuleRevisionId parentModRevID = ModuleRevisionId.newInstance(
+domReader.getParentGroupId(), 
+domReader.getParentArtifactId(), 
+domReader.getParentVersion());
+ResolvedModuleRevision parentModule = 
parseOtherPom(ivySettings, 
+parentModRevID);
+if (parentModule != null) {
+parentDescr = parentModule.getDescriptor();
+} else {
+   Message.warn(impossible to load parent for  + 
descriptorURL + .
+   +  Parent= + parentModRevID); 
+}
+
+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

svn commit: r694036 - in /ant/ivy/core/trunk: ./ src/java/org/apache/ivy/ant/ src/java/org/apache/ivy/core/settings/ src/java/org/apache/ivy/plugins/parser/m2/handlers/ test/java/org/apache/ivy/ant/

2008-09-10 Thread maartenc
Author: maartenc
Date: Wed Sep 10 15:25:06 2008
New Revision: 694036

URL: http://svn.apache.org/viewvc?rev=694036view=rev
Log:
FIX: ivy.cache.dir.${settingsRef} is set to default instead of the 
defaultCacheDir from the ivysettings.xml after ivy:resolve (IVY-898)

Added:
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/handlers/

ant/ivy/core/trunk/test/java/org/apache/ivy/ant/ivysettings-defaultCacheDir.xml

ant/ivy/core/trunk/test/java/org/apache/ivy/ant/ivysettings-noDefaultCacheDir.xml
Modified:
ant/ivy/core/trunk/CHANGES.txt
ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyAntSettings.java
ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyConfigure.java
ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java
ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyConfigureTest.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=694036r1=694035r2=694036view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Wed Sep 10 15:25:06 2008
@@ -111,6 +111,7 @@
 - IMPROVEMENT: Add a memory cache for the module descriptor that are parsed 
from the cache (IVY-883)
 - IMPROVEMENT: Improve performance (IVY-872)
 
+- FIX: ivy.cache.dir.${settingsRef} is set to default instead of the 
defaultCacheDir from the ivysettings.xml after ivy:resolve (IVY-898)
 - FIX: Ivy ibiblio resolver chokes on variables while checking descriptor 
consistency (IVY-818)
 - FIX: Enable consistent support of the configuration negation operator 
(IVY-894) (thanks to Patrick Woodworth)
 - FIX: add variable expansion in extra attributes (IVY-798)

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyAntSettings.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyAntSettings.java?rev=694036r1=694035r2=694036view=diff
==
--- ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyAntSettings.java 
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyAntSettings.java Wed Sep 
10 15:25:06 2008
@@ -201,6 +201,10 @@
 public void setUrl(String confUrl) throws MalformedURLException {
 this.url = new URL(confUrl);
 }
+
+public void setUrl(URL url) {
+this.url = url;
+}
 
 /*
  * This is usually not necessary to define a reference in Ant, but it's 
the only

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyConfigure.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyConfigure.java?rev=694036r1=694035r2=694036view=diff
==
--- ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyConfigure.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyConfigure.java Wed Sep 10 
15:25:06 2008
@@ -89,6 +89,13 @@
 public void setUrl(String url) throws MalformedURLException {
 settings.setUrl(url);
 }
+
+public void setUrl(URL url) {
+if (url == null) {
+throw new NullPointerException(Cannot set a null URL);
+}
+settings.setUrl(url);
+}
 
 public String getRealm() {
 return settings.getRealm();

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java?rev=694036r1=694035r2=694036view=diff
==
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java 
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java 
Wed Sep 10 15:25:06 2008
@@ -371,7 +371,6 @@
 } else {
 getDefaultIvyUserDir();
 }
-getDefaultCache();
 
 loadDefaultProperties();
 try {
@@ -397,7 +396,6 @@
 } else {
 getDefaultIvyUserDir();
 }
-getDefaultCache();
 
 loadDefaultProperties();
 new XmlSettingsParser(this).parse(settingsURL);

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyConfigureTest.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyConfigureTest.java?rev=694036r1=694035r2=694036view=diff
==
--- ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyConfigureTest.java 
(original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyConfigureTest.java Wed 
Sep 10 15:25:06 2008
@@ -54,6 +54,35 @@
 task.setSettingsRef(ref);
 return task.getIvyInstance();
 }
+
+public void testDefaultCacheDir() {
+// test with an URL
+
configure.setUrl(getClass().getResource

svn commit: r696014 - /ant/ivy/core/trunk/src/java/org/apache/ivy/util/FileResolver.java

2008-09-16 Thread maartenc
Author: maartenc
Date: Tue Sep 16 12:25:13 2008
New Revision: 696014

URL: http://svn.apache.org/viewvc?rev=696014view=rev
Log:
Fixed problem with setting File properties from XML config files.

Modified:
ant/ivy/core/trunk/src/java/org/apache/ivy/util/FileResolver.java

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/util/FileResolver.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/util/FileResolver.java?rev=696014r1=696013r2=696014view=diff
==
--- ant/ivy/core/trunk/src/java/org/apache/ivy/util/FileResolver.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/util/FileResolver.java Tue Sep 
16 12:25:13 2008
@@ -22,7 +22,7 @@
 public interface FileResolver {
 public static final FileResolver DEFAULT = new FileResolver() {
 public File resolveFile(String path, String filename) {
-return new File(filename);
+return new File(path);
 }
 };
 




svn propchange: r696014 - svn:log

2008-09-16 Thread maartenc
Author: maartenc
Revision: 696014
Modified property: svn:log

Modified: svn:log at Tue Sep 16 12:56:01 2008
--
--- svn:log (original)
+++ svn:log Tue Sep 16 12:56:01 2008
@@ -1 +1 @@
-Fixed problem with setting File properties from XML config files.
+Fixed problem with setting File properties from XML config files (IVY-905)



svn commit: r696031 - /ant/ivy/core/trunk/test/java/org/apache/ivy/util/ConfiguratorTest.java

2008-09-16 Thread maartenc
Author: maartenc
Date: Tue Sep 16 12:56:48 2008
New Revision: 696031

URL: http://svn.apache.org/viewvc?rev=696031view=rev
Log:
FIX: Cannot configure items with java.io.File attributes (IVY-905)

Modified:
ant/ivy/core/trunk/test/java/org/apache/ivy/util/ConfiguratorTest.java

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/util/ConfiguratorTest.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/util/ConfiguratorTest.java?rev=696031r1=696030r2=696031view=diff
==
--- ant/ivy/core/trunk/test/java/org/apache/ivy/util/ConfiguratorTest.java 
(original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/util/ConfiguratorTest.java Tue 
Sep 16 12:56:48 2008
@@ -17,6 +17,7 @@
  */
 package org.apache.ivy.util;
 
+import java.io.File;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
@@ -27,6 +28,19 @@
  *
  */
 public class ConfiguratorTest extends TestCase {
+
+public static class FileTester {
+private File file;
+
+public void setFile(File file) {
+this.file = file;
+}
+
+public File getFile() {
+return file;
+}
+}
+
 public static class City {
 private List _housings = new ArrayList();
 
@@ -357,4 +371,15 @@
 assertEquals(20, ((Room) ((Housing) 
city.getHousings().get(1)).getRooms().get(2))
 .getSurface());
 }
+
+public void testFileAttribute() {
+FileTester root = new FileTester();
+_conf.setRoot(root);
+_conf.setAttribute(file, path/to/file.txt);
+
+String filePath = root.getFile().getPath();
+filePath = filePath.replace('\\', '/');
+
+assertEquals(path/to/file.txt, filePath);
+}
 }




svn commit: r696442 - in /ant/ivy/core/trunk: CHANGES.txt doc/resolver/filesystem.html

2008-09-17 Thread maartenc
Author: maartenc
Date: Wed Sep 17 13:53:37 2008
New Revision: 696442

URL: http://svn.apache.org/viewvc?rev=696442view=rev
Log:
DOCUMENTATION: Filesystem resolver: talks about patterns but does notmention 
these must become absolute file paths (IVY-910)

Modified:
ant/ivy/core/trunk/CHANGES.txt
ant/ivy/core/trunk/doc/resolver/filesystem.html

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=696442r1=696441r2=696442view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Wed Sep 17 13:53:37 2008
@@ -74,6 +74,11 @@
John Williams
Patrick Woodworth
Jaroslaw Wypychowski
+   
+   trunk version
+=
+- DOCUMENTATION: Filesystem resolver: talks about patterns but does not 
mention these must become absolute file paths (IVY-910)
+
 
2.0.0-rc1
 =

Modified: ant/ivy/core/trunk/doc/resolver/filesystem.html
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/doc/resolver/filesystem.html?rev=696442r1=696441r2=696442view=diff
==
--- ant/ivy/core/trunk/doc/resolver/filesystem.html (original)
+++ ant/ivy/core/trunk/doc/resolver/filesystem.html Wed Sep 17 13:53:37 2008
@@ -32,7 +32,7 @@
 
 span class=tagdoc id=ivysettings.resolvers.filesystemThis resolver uses 
the file system to resolve ivy files and artifacts./span It presents the 
advantage to usually have very good performances. Moreover, it is easy to setup 
using basic OS file sharing mechanism.
 
-The configuration of such a resolver is mainly done through ivy and artifact 
patterns, indicating where ivy files and artifacts can be found in the file 
system. You can indicate a list of pattern which will be checked one after the 
other.
+The configuration of such a resolver is mainly done through ivy and artifact 
patterns, indicating where ivy files and artifacts can be found in the file 
system. These patterns must be absolute paths (span class=sincesince 
2.0/span). You can indicate a list of pattern which will be checked one after 
the other.
 
 span class=sincesince 1.3/span Using the m2compatible attribute, this 
resolver will convert dots found in organisation in slashes like maven2 does 
for groupId. For instance, it will transform the organisation from 
'com.company' into 'com/company' when replacing the token [organisation] in 
your pattern.
 strongLimitation/strong: in m2compatible mode, this resolver is not able 
list available organizations. It means some features like [[ant:repreport]] are 
not available.
@@ -44,7 +44,7 @@
 bLimitations/b
 Atomic publish is currently limited in several ways:
 ul
-liyou need to use a pattern for both the artifact and the ivy files which 
uses the revision as a directory. For instance 
[module]/[revision]/[artifact].[ext] works, 
[module]/[artifact]-[revision].[ext] doesn't/li
+liyou need to use a pattern for both the artifact and the ivy files which 
uses the revision as a directory. For instance 
${repository.dir}/[module]/[revision]/[artifact].[ext] works, 
${repository.dir}/[module]/[artifact]-[revision].[ext] doesn't/li
 liboth the artifact and ivy pattern should have the same prefix until the 
[revision] token./li
 lioverwrite during publish is not supported/li
 liyou should not use revision names ending with '.part'/li




svn commit: r696456 - in /ant/ivy/core/branches/2.0.x: CHANGES.txt doc/resolver/filesystem.html

2008-09-17 Thread maartenc
Author: maartenc
Date: Wed Sep 17 14:26:02 2008
New Revision: 696456

URL: http://svn.apache.org/viewvc?rev=696456view=rev
Log:
merged IVY-910 changes from trunk

Modified:
ant/ivy/core/branches/2.0.x/CHANGES.txt
ant/ivy/core/branches/2.0.x/doc/resolver/filesystem.html

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=696456r1=696455r2=696456view=diff
==
--- ant/ivy/core/branches/2.0.x/CHANGES.txt (original)
+++ ant/ivy/core/branches/2.0.x/CHANGES.txt Wed Sep 17 14:26:02 2008
@@ -74,6 +74,11 @@
John Williams
Patrick Woodworth
Jaroslaw Wypychowski
+   
+   trunk version
+=
+- DOCUMENTATION: Filesystem resolver: talks about patterns but does not 
mention these must become absolute file paths (IVY-910)
+
 
2.0.0-rc1
 =

Modified: ant/ivy/core/branches/2.0.x/doc/resolver/filesystem.html
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/branches/2.0.x/doc/resolver/filesystem.html?rev=696456r1=696455r2=696456view=diff
==
--- ant/ivy/core/branches/2.0.x/doc/resolver/filesystem.html (original)
+++ ant/ivy/core/branches/2.0.x/doc/resolver/filesystem.html Wed Sep 17 
14:26:02 2008
@@ -32,7 +32,7 @@
 
 span class=tagdoc id=ivysettings.resolvers.filesystemThis resolver uses 
the file system to resolve ivy files and artifacts./span It presents the 
advantage to usually have very good performances. Moreover, it is easy to setup 
using basic OS file sharing mechanism.
 
-The configuration of such a resolver is mainly done through ivy and artifact 
patterns, indicating where ivy files and artifacts can be found in the file 
system. You can indicate a list of pattern which will be checked one after the 
other.
+The configuration of such a resolver is mainly done through ivy and artifact 
patterns, indicating where ivy files and artifacts can be found in the file 
system. These patterns must be absolute paths (span class=sincesince 
2.0/span). You can indicate a list of pattern which will be checked one after 
the other.
 
 span class=sincesince 1.3/span Using the m2compatible attribute, this 
resolver will convert dots found in organisation in slashes like maven2 does 
for groupId. For instance, it will transform the organisation from 
'com.company' into 'com/company' when replacing the token [organisation] in 
your pattern.
 strongLimitation/strong: in m2compatible mode, this resolver is not able 
list available organizations. It means some features like [[ant:repreport]] are 
not available.
@@ -44,7 +44,7 @@
 bLimitations/b
 Atomic publish is currently limited in several ways:
 ul
-liyou need to use a pattern for both the artifact and the ivy files which 
uses the revision as a directory. For instance 
[module]/[revision]/[artifact].[ext] works, 
[module]/[artifact]-[revision].[ext] doesn't/li
+liyou need to use a pattern for both the artifact and the ivy files which 
uses the revision as a directory. For instance 
${repository.dir}/[module]/[revision]/[artifact].[ext] works, 
${repository.dir}/[module]/[artifact]-[revision].[ext] doesn't/li
 liboth the artifact and ivy pattern should have the same prefix until the 
[revision] token./li
 lioverwrite during publish is not supported/li
 liyou should not use revision names ending with '.part'/li




svn commit: r698318 - in /ant/ivy/core/trunk: ./ src/java/org/apache/ivy/ant/ src/java/org/apache/ivy/core/settings/ src/java/org/apache/ivy/util/ src/java/org/apache/ivy/util/url/

2008-09-23 Thread maartenc
Author: maartenc
Date: Tue Sep 23 12:45:00 2008
New Revision: 698318

URL: http://svn.apache.org/viewvc?rev=698318view=rev
Log:
Merged changes from 2.0.x branch back into trunk (IVY-910, IVY-909, IVY-907, 
IVY-911)

Modified:
ant/ivy/core/trunk/   (props changed)
ant/ivy/core/trunk/CHANGES.txt
ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyAntVariableContainer.java

ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvyVariableContainerImpl.java

ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/XmlSettingsParser.java
ant/ivy/core/trunk/src/java/org/apache/ivy/util/Configurator.java
ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/AbstractURLHandler.java
ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/BasicURLHandler.java
ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/HttpClientHandler.java
ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/URLHandler.java

ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/URLHandlerDispatcher.java

Propchange: ant/ivy/core/trunk/
--
--- svn:mergeinfo (added)
+++ svn:mergeinfo Tue Sep 23 12:45:00 2008
@@ -0,0 +1,2 @@
+/ant/ivy/core/branches/2.0.x:696803-698317
+/ant/ivy/core/trunk:695737,696014-696031,696442

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=698318r1=698317r2=698318view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Tue Sep 23 12:45:00 2008
@@ -75,10 +75,15 @@
Patrick Woodworth
Jaroslaw Wypychowski

-   trunk version
+   trunk
 =
 - DOCUMENTATION: Filesystem resolver: talks about patterns but does not 
mention these must become absolute file paths (IVY-910)
 
+- IMPROVEMENT: Error messages on use of relative paths can be cyrptic (IVY-909)
+
+- 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)
 
2.0.0-rc1
 =

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyAntVariableContainer.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyAntVariableContainer.java?rev=698318r1=698317r2=698318view=diff
==
--- ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyAntVariableContainer.java 
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyAntVariableContainer.java 
Tue Sep 23 12:45:00 2008
@@ -52,7 +52,7 @@
 public void setVariable(String varName, String value, boolean overwrite) {
 if (overwrite) {
 Message.debug(setting ' + varName + ' to ' + value + ');
-overwrittenProperties.put(varName, value);
+overwrittenProperties.put(varName, substitute(value));
 } else {
 super.setVariable(varName, value, overwrite);
 }

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvyVariableContainerImpl.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvyVariableContainerImpl.java?rev=698318r1=698317r2=698318view=diff
==
--- 
ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvyVariableContainerImpl.java
 (original)
+++ 
ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvyVariableContainerImpl.java
 Tue Sep 23 12:45:00 2008
@@ -59,7 +59,7 @@
 }
 }
 
-private String substitute(String value) {
+protected String substitute(String value) {
 return IvyPatternHelper.substituteVariables(value, this);
 }
 

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/XmlSettingsParser.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/XmlSettingsParser.java?rev=698318r1=698317r2=698318view=diff
==
--- 
ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/XmlSettingsParser.java 
(original)
+++ 
ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/XmlSettingsParser.java 
Tue Sep 23 12:45:00 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.URLHandler;
 import org.apache.ivy.util.url.URLHandlerRegistry;
 import org.xml.sax.Attributes;
 import org.xml.sax.SAXException;
@@ -364,6 +365,16 @@
 defaultCM = (String) attributes.get(defaultConflictManager);
 defaultLatest = (String) attributes.get(defaultLatestStrategy);
 defaultCircular = (String

svn commit: r698324 - in /ant/ivy/core/trunk: CHANGES.txt src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java

2008-09-23 Thread maartenc
Author: maartenc
Date: Tue Sep 23 13:03:04 2008
New Revision: 698324

URL: http://svn.apache.org/viewvc?rev=698324view=rev
Log:
FIX: Ivy can't handle bare POM ${groupId} property (IVY-913) (thanks to Tom 
Widmer)

Modified:
ant/ivy/core/trunk/CHANGES.txt

ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=698324r1=698323r2=698324view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Tue Sep 23 13:03:04 2008
@@ -71,6 +71,7 @@
Jason Trump
Tjeerd Verhagen
James P. White
+   Tom Widmer
John Williams
Patrick Woodworth
Jaroslaw Wypychowski
@@ -84,6 +85,7 @@
 - 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)
 
2.0.0-rc1
 =

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java?rev=698324r1=698323r2=698324view=diff
==
--- 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
 (original)
+++ 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
 Tue Sep 23 13:03:04 2008
@@ -190,8 +190,10 @@
 } else {
 domReader.setProperty(project.groupId, groupId);
 domReader.setProperty(pom.groupId, groupId);
+domReader.setProperty(groupId, groupId);
 domReader.setProperty(project.artifactId, artifactId);
 domReader.setProperty(pom.artifactId, artifactId);
+domReader.setProperty(artifactId, artifactId);
 domReader.setProperty(project.version, version);
 domReader.setProperty(pom.version, version);
 domReader.setProperty(version, version);




svn commit: r698345 - in /ant/ivy/core/trunk: CHANGES.txt src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java test/java/org/apache/ivy/plugins/parser/m2/test-properties.pom

2008-09-23 Thread maartenc
Author: maartenc
Date: Tue Sep 23 13:57:13 2008
New Revision: 698345

URL: http://svn.apache.org/viewvc?rev=698345view=rev
Log:
FIX: Properties needed to parse version in POM (IVY-914) (thanks to Tom Widmer)

Modified:
ant/ivy/core/trunk/CHANGES.txt

ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java

ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-properties.pom

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=698345r1=698344r2=698345view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Tue Sep 23 13:57:13 2008
@@ -86,6 +86,7 @@
 - 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)
 
2.0.0-rc1
 =

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java?rev=698345r1=698344r2=698345view=diff
==
--- 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
 (original)
+++ 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
 Tue Sep 23 13:57:13 2008
@@ -113,6 +113,13 @@
 try {   
 PomReader domReader = new PomReader(descriptorURL, res);   
 
 domReader.setProperty(parent.version, 
domReader.getParentVersion());
+
+Map pomProperties = domReader.getPomProperties();
+for (Iterator iter = pomProperties.entrySet().iterator(); 
iter.hasNext();) {
+Map.Entry prop = (Map.Entry) iter.next();
+domReader.setProperty((String) prop.getKey(), (String) 
prop.getValue());
+mdBuilder.addProperty((String) prop.getKey(), (String) 
prop.getValue());
+}
 
 ModuleDescriptor parentDescr = null;
 if (domReader.hasParent()) {
@@ -198,13 +205,6 @@
 domReader.setProperty(pom.version, version);
 domReader.setProperty(version, version);
 
-Map pomProperties = domReader.getPomProperties();
-for (Iterator iter = pomProperties.entrySet().iterator(); 
iter.hasNext();) {
-Map.Entry prop = (Map.Entry) iter.next();
-domReader.setProperty((String) prop.getKey(), (String) 
prop.getValue());
-mdBuilder.addProperty((String) prop.getKey(), (String) 
prop.getValue());
-}
-
 if (parentDescr != null) {
 mdBuilder.addExtraInfos(parentDescr.getExtraInfo());
 

Modified: 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-properties.pom
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-properties.pom?rev=698345r1=698344r2=698345view=diff
==
--- 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-properties.pom
 (original)
+++ 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-properties.pom
 Tue Sep 23 13:57:13 2008
@@ -21,7 +21,7 @@
   groupIddrools/groupId
   artifactIddrools-smf/artifactId
   nameDrools :: Semantics Module Framework/name
-  version2.0-beta-18/version
+  version${my-version}/version
   dependencies
 dependency
   groupId${pom.groupId}/groupId
@@ -29,4 +29,7 @@
   version${pom.version}/version
 /dependency
   /dependencies
+  properties
+my-version2.0-beta-18/my-version
+  /properties
 /project




svn commit: r698347 - in /ant/ivy/core/branches/2.0.x: ./ CHANGES.txt src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java test/java/org/apache/ivy/plugins/parser/m2/test-propertie

2008-09-23 Thread maartenc
Author: maartenc
Date: Tue Sep 23 14:02:10 2008
New Revision: 698347

URL: http://svn.apache.org/viewvc?rev=698347view=rev
Log:
Merged changes for IVY-914 from trunk.

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/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java

ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/plugins/parser/m2/test-properties.pom

Propchange: ant/ivy/core/branches/2.0.x/
--
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Sep 23 14:02:10 2008
@@ -1 +1 @@
-/ant/ivy/core/trunk:695737,696014-696031,698324
+/ant/ivy/core/trunk:695737,696014-696031,698324,698345

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=698347r1=698346r2=698347view=diff
==
--- ant/ivy/core/branches/2.0.x/CHANGES.txt (original)
+++ ant/ivy/core/branches/2.0.x/CHANGES.txt Tue Sep 23 14:02:10 2008
@@ -86,6 +86,7 @@
 - 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)
 
 
2.0.0-rc1

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=698347r1=698346r2=698347view=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 Sep 23 14:02:10 2008
@@ -113,6 +113,13 @@
 try {   
 PomReader domReader = new PomReader(descriptorURL, res);   
 
 domReader.setProperty(parent.version, 
domReader.getParentVersion());
+
+Map pomProperties = domReader.getPomProperties();
+for (Iterator iter = pomProperties.entrySet().iterator(); 
iter.hasNext();) {
+Map.Entry prop = (Map.Entry) iter.next();
+domReader.setProperty((String) prop.getKey(), (String) 
prop.getValue());
+mdBuilder.addProperty((String) prop.getKey(), (String) 
prop.getValue());
+}
 
 ModuleDescriptor parentDescr = null;
 if (domReader.hasParent()) {
@@ -198,13 +205,6 @@
 domReader.setProperty(pom.version, version);
 domReader.setProperty(version, version);
 
-Map pomProperties = domReader.getPomProperties();
-for (Iterator iter = pomProperties.entrySet().iterator(); 
iter.hasNext();) {
-Map.Entry prop = (Map.Entry) iter.next();
-domReader.setProperty((String) prop.getKey(), (String) 
prop.getValue());
-mdBuilder.addProperty((String) prop.getKey(), (String) 
prop.getValue());
-}
-
 if (parentDescr != null) {
 mdBuilder.addExtraInfos(parentDescr.getExtraInfo());
 

Modified: 
ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/plugins/parser/m2/test-properties.pom
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/plugins/parser/m2/test-properties.pom?rev=698347r1=698346r2=698347view=diff
==
--- 
ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/plugins/parser/m2/test-properties.pom
 (original)
+++ 
ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/plugins/parser/m2/test-properties.pom
 Tue Sep 23 14:02:10 2008
@@ -21,7 +21,7 @@
   groupIddrools/groupId
   artifactIddrools-smf/artifactId
   nameDrools :: Semantics Module Framework/name
-  version2.0-beta-18/version
+  version${my-version}/version
   dependencies
 dependency
   groupId${pom.groupId}/groupId
@@ -29,4 +29,7 @@
   version${pom.version}/version
 /dependency
   /dependencies
+  properties
+my-version2.0-beta-18/my-version
+  /properties
 /project




svn commit: r698354 - in /ant/ivy/core/trunk/doc: settings.html settings/settings.html

2008-09-23 Thread maartenc
Author: maartenc
Date: Tue Sep 23 14:20:29 2008
New Revision: 698354

URL: http://svn.apache.org/viewvc?rev=698354view=rev
Log:
Updated documentation for IVY-911.

Modified:
ant/ivy/core/trunk/doc/settings.html
ant/ivy/core/trunk/doc/settings/settings.html

Modified: ant/ivy/core/trunk/doc/settings.html
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/doc/settings.html?rev=698354r1=698353r2=698354view=diff
==
--- ant/ivy/core/trunk/doc/settings.html (original)
+++ ant/ivy/core/trunk/doc/settings.html Tue Sep 23 14:20:29 2008
@@ -68,7 +68,7 @@
 ivysettings
 a href=settings/property.htmlproperty/a
 a href=settings/properties.htmlproperties/a
-a href=settings/conf.htmlsettings/a
+a href=settings/settings.htmlsettings/a
 a href=settings/include.htmlinclude/a
 a href=settings/classpath.htmlclasspath/a
 a href=settings/typedef.htmltypedef/a
@@ -115,7 +115,7 @@
 td0..n/td/tr
 trtda href=settings/properties.htmlproperties/a/tdtdloads a 
properties file as ivy variables/td
 td0..n/td/tr
-trtda href=settings/conf.htmlsettings/a/tdtdconfigures ivy 
with some defaults/td
+trtda href=settings/settings.htmlsettings/a/tdtdconfigures 
ivy with some defaults/td
 td0..1/td/tr
 trtda href=settings/include.htmlinclude/a/tdtdincludes 
another settings file/td
 td0..n/td/tr

Modified: ant/ivy/core/trunk/doc/settings/settings.html
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/doc/settings/settings.html?rev=698354r1=698353r2=698354view=diff
==
--- ant/ivy/core/trunk/doc/settings/settings.html (original)
+++ ant/ivy/core/trunk/doc/settings/settings.html Tue Sep 23 14:20:29 2008
@@ -59,6 +59,8 @@
 tdNo, defaults to true/td/tr
 trtduseRemoteConfig/tdtdtrue to configure ivyrep and ibiblio 
resolver from a remote configuration file (updated with changes in those 
repository structure if any) (span class=sincesince 1.2/span)/td
 tdNo, defaults to false/td/tr
+trtdhttpRequestMethod/tdtdspecifies the HTTP method to use to 
retrieve information about an URL. Possible values are 'GET' and 'HEAD'. This 
setting can be used to solve problems with firewalls and proxies. (span 
class=sincesince 2.0/span)/td
+tdNo, defaults to 'HEAD'/td/tr
 trtdsdefaultCache/s/tdtda path to a directory to use as 
default basedir for both resolution and repository cache(s).
iDeprecated, we recommend using defaultCacheDir on the 
[[settings/caches]] tag instead/i/td
 tdNo, defaults to .ivy2/cache in user home/td/tr




svn commit: r698357 - in /ant/ivy/core/branches/2.0.x/doc: settings.html settings/settings.html

2008-09-23 Thread maartenc
Author: maartenc
Date: Tue Sep 23 14:25:16 2008
New Revision: 698357

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

Modified:
ant/ivy/core/branches/2.0.x/doc/settings.html
ant/ivy/core/branches/2.0.x/doc/settings/settings.html

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=698357r1=698356r2=698357view=diff
==
--- ant/ivy/core/branches/2.0.x/doc/settings.html (original)
+++ ant/ivy/core/branches/2.0.x/doc/settings.html Tue Sep 23 14:25:16 2008
@@ -68,7 +68,7 @@
 ivysettings
 a href=settings/property.htmlproperty/a
 a href=settings/properties.htmlproperties/a
-a href=settings/conf.htmlsettings/a
+a href=settings/settings.htmlsettings/a
 a href=settings/include.htmlinclude/a
 a href=settings/classpath.htmlclasspath/a
 a href=settings/typedef.htmltypedef/a
@@ -115,7 +115,7 @@
 td0..n/td/tr
 trtda href=settings/properties.htmlproperties/a/tdtdloads a 
properties file as ivy variables/td
 td0..n/td/tr
-trtda href=settings/conf.htmlsettings/a/tdtdconfigures ivy 
with some defaults/td
+trtda href=settings/settings.htmlsettings/a/tdtdconfigures 
ivy with some defaults/td
 td0..1/td/tr
 trtda href=settings/include.htmlinclude/a/tdtdincludes 
another settings file/td
 td0..n/td/tr

Modified: ant/ivy/core/branches/2.0.x/doc/settings/settings.html
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/branches/2.0.x/doc/settings/settings.html?rev=698357r1=698356r2=698357view=diff
==
--- ant/ivy/core/branches/2.0.x/doc/settings/settings.html (original)
+++ ant/ivy/core/branches/2.0.x/doc/settings/settings.html Tue Sep 23 14:25:16 
2008
@@ -59,6 +59,8 @@
 tdNo, defaults to true/td/tr
 trtduseRemoteConfig/tdtdtrue to configure ivyrep and ibiblio 
resolver from a remote configuration file (updated with changes in those 
repository structure if any) (span class=sincesince 1.2/span)/td
 tdNo, defaults to false/td/tr
+trtdhttpRequestMethod/tdtdspecifies the HTTP method to use to 
retrieve information about an URL. Possible values are 'GET' and 'HEAD'. This 
setting can be used to solve problems with firewalls and proxies. (span 
class=sincesince 2.0/span)/td
+tdNo, defaults to 'HEAD'/td/tr
 trtdsdefaultCache/s/tdtda path to a directory to use as 
default basedir for both resolution and repository cache(s).
iDeprecated, we recommend using defaultCacheDir on the 
[[settings/caches]] tag instead/i/td
 tdNo, defaults to .ivy2/cache in user home/td/tr




svn commit: r698364 - in /ant/ivy/core/trunk: doc/samples/ doc/style/ test/java/org/apache/ivy/ant/ test/java/org/apache/ivy/plugins/parser/ test/java/org/apache/ivy/util/url/

2008-09-23 Thread maartenc
Author: maartenc
Date: Tue Sep 23 14:43:19 2008
New Revision: 698364

URL: http://svn.apache.org/viewvc?rev=698364view=rev
Log:
Added missing licenses.

Modified:
ant/ivy/core/trunk/doc/samples/apache-hello-ivy-default.html
ant/ivy/core/trunk/doc/style/tree.css
ant/ivy/core/trunk/test/java/org/apache/ivy/ant/ivy-dyn-evicted.xml
ant/ivy/core/trunk/test/java/org/apache/ivy/ant/ivy-dyn-evicted2.xml
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/nores
ant/ivy/core/trunk/test/java/org/apache/ivy/util/url/archiva-listing.html

ant/ivy/core/trunk/test/java/org/apache/ivy/util/url/fixed-archiva-listing.html

ant/ivy/core/trunk/test/java/org/apache/ivy/util/url/maven-proxy-listing.html

Modified: ant/ivy/core/trunk/doc/samples/apache-hello-ivy-default.html
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/doc/samples/apache-hello-ivy-default.html?rev=698364r1=698363r2=698364view=diff
==
--- ant/ivy/core/trunk/doc/samples/apache-hello-ivy-default.html (original)
+++ ant/ivy/core/trunk/doc/samples/apache-hello-ivy-default.html Tue Sep 23 
14:43:19 2008
@@ -1,3 +1,21 @@
+!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   License); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+--
 html
 head
 META http-equiv=Content-Type content=text/html; charset=UTF-8

Modified: ant/ivy/core/trunk/doc/style/tree.css
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/doc/style/tree.css?rev=698364r1=698363r2=698364view=diff
==
--- ant/ivy/core/trunk/doc/style/tree.css (original)
+++ ant/ivy/core/trunk/doc/style/tree.css Tue Sep 23 14:43:19 2008
@@ -1,3 +1,21 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the License); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an AS IS BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
 .treeview ul{ 
 margin: 0;
 padding: 0;

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/ant/ivy-dyn-evicted.xml
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/ant/ivy-dyn-evicted.xml?rev=698364r1=698363r2=698364view=diff
==
--- ant/ivy/core/trunk/test/java/org/apache/ivy/ant/ivy-dyn-evicted.xml 
(original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/ant/ivy-dyn-evicted.xml Tue Sep 
23 14:43:19 2008
@@ -1,3 +1,21 @@
+!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   License); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+--
 ivy-module version=1.0 
info organisation=apache
   module=resolve-latest

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/ant/ivy-dyn-evicted2.xml
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/ant/ivy-dyn-evicted2.xml?rev=698364r1=698363r2=698364view=diff

svn commit: r698372 - in /ant/ivy/core/branches/2.0.x: ./ doc/samples/ doc/style/ test/java/org/apache/ivy/ant/ test/java/org/apache/ivy/plugins/parser/ test/java/org/apache/ivy/util/url/

2008-09-23 Thread maartenc
Author: maartenc
Date: Tue Sep 23 14:59:47 2008
New Revision: 698372

URL: http://svn.apache.org/viewvc?rev=698372view=rev
Log:
Added missing licenses (merged from trunk)

Modified:
ant/ivy/core/branches/2.0.x/   (props changed)
ant/ivy/core/branches/2.0.x/doc/samples/apache-hello-ivy-default.html
ant/ivy/core/branches/2.0.x/doc/style/tree.css
ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/ant/ivy-dyn-evicted.xml

ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/ant/ivy-dyn-evicted2.xml
ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/plugins/parser/nores

ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/util/url/archiva-listing.html

ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/util/url/fixed-archiva-listing.html

ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/util/url/maven-proxy-listing.html

Propchange: ant/ivy/core/branches/2.0.x/
--
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Sep 23 14:59:47 2008
@@ -1 +1 @@
-/ant/ivy/core/trunk:695737,696014-696031,698324,698345
+/ant/ivy/core/trunk:695737,696014-696031,698324,698345,698354,698364

Modified: ant/ivy/core/branches/2.0.x/doc/samples/apache-hello-ivy-default.html
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/branches/2.0.x/doc/samples/apache-hello-ivy-default.html?rev=698372r1=698371r2=698372view=diff
==
--- ant/ivy/core/branches/2.0.x/doc/samples/apache-hello-ivy-default.html 
(original)
+++ ant/ivy/core/branches/2.0.x/doc/samples/apache-hello-ivy-default.html Tue 
Sep 23 14:59:47 2008
@@ -1,3 +1,21 @@
+!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   License); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+--
 html
 head
 META http-equiv=Content-Type content=text/html; charset=UTF-8

Modified: ant/ivy/core/branches/2.0.x/doc/style/tree.css
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/branches/2.0.x/doc/style/tree.css?rev=698372r1=698371r2=698372view=diff
==
--- ant/ivy/core/branches/2.0.x/doc/style/tree.css (original)
+++ ant/ivy/core/branches/2.0.x/doc/style/tree.css Tue Sep 23 14:59:47 2008
@@ -1,3 +1,21 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the License); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an AS IS BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
 .treeview ul{ 
 margin: 0;
 padding: 0;

Modified: 
ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/ant/ivy-dyn-evicted.xml
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/ant/ivy-dyn-evicted.xml?rev=698372r1=698371r2=698372view=diff
==
--- 
ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/ant/ivy-dyn-evicted.xml 
(original)
+++ 
ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/ant/ivy-dyn-evicted.xml 
Tue Sep 23 14:59:47 2008
@@ -1,3 +1,21 @@
+!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   License); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing,
+   software

svn commit: r698745 - in /ant/ivy/core/trunk: CHANGES.txt build.xml

2008-09-24 Thread maartenc
Author: maartenc
Date: Wed Sep 24 14:29:55 2008
New Revision: 698745

URL: http://svn.apache.org/viewvc?rev=698745view=rev
Log:
FIX: build.xml: checkstyle + checkstyle-report dont work together (IVY-919)

Modified:
ant/ivy/core/trunk/CHANGES.txt
ant/ivy/core/trunk/build.xml

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=698745r1=698744r2=698745view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Wed Sep 24 14:29:55 2008
@@ -87,6 +87,7 @@
 - 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)
 
2.0.0-rc1
 =

Modified: ant/ivy/core/trunk/build.xml
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/build.xml?rev=698745r1=698744r2=698745view=diff
==
--- ant/ivy/core/trunk/build.xml (original)
+++ ant/ivy/core/trunk/build.xml Wed Sep 24 14:29:55 2008
@@ -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




svn commit: r699482 - in /ant/ivy/core/trunk: CHANGES.txt src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.

2008-09-26 Thread maartenc
Author: maartenc
Date: Fri Sep 26 13:16:10 2008
New Revision: 699482

URL: http://svn.apache.org/viewvc?rev=699482view=rev
Log:
FIX: Maven packaging of pom should add a jar artifact if present (IVY-920)

Modified:
ant/ivy/core/trunk/CHANGES.txt

ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java

ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=699482r1=699481r2=699482view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Fri Sep 26 13:16:10 2008
@@ -88,6 +88,7 @@
 - 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)
 
2.0.0-rc1
 =

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java?rev=699482r1=699481r2=699482view=diff
==
--- 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java
 (original)
+++ 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java
 Fri Sep 26 13:16:10 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,11 @@
 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 +202,7 @@
 }
 ivyModuleDescriptor.setMappingOverride(true);
 ivyModuleDescriptor.addExtraAttributeNamespace(m, 
Ivy.getIvyHomeURL() + maven);
+parserSettings = ivySettings;
 }
 
 
@@ -232,7 +238,19 @@
  * 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/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java?rev=699482r1=699481r2=699482view=diff
==
--- 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
 (original)
+++ 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
 Fri Sep 26 13:16:10 2008
@@ -108,7 +108,7 @@
 public ModuleDescriptor parseDescriptor(ParserSettings ivySettings, URL 
descriptorURL, 
 Resource res, boolean validate) throws ParseException

svn commit: r700296 - in /ant/ivy/core/trunk: CHANGES.txt src/java/org/apache/ivy/ant/IvyAntSettings.java

2008-09-29 Thread maartenc
Author: maartenc
Date: Mon Sep 29 15:47:12 2008
New Revision: 700296

URL: http://svn.apache.org/viewvc?rev=700296view=rev
Log:
FIX: StackOverflow when using ivy:settings with ivy.instance as id (IVY-924)

Modified:
ant/ivy/core/trunk/CHANGES.txt
ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyAntSettings.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=700296r1=700295r2=700296view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Mon Sep 29 15:47:12 2008
@@ -89,6 +89,7 @@
 - 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)
 
2.0.0-rc1
 =

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyAntSettings.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyAntSettings.java?rev=700296r1=700295r2=700296view=diff
==
--- ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyAntSettings.java 
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyAntSettings.java Mon Sep 
29 15:47:12 2008
@@ -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().get(id) 
== null) {
 // register ourselfs as default settings, just in case the id 
attribute is not set
 getProject().addReference(ivy.instance, this);
 autoRegistered = true;




svn commit: r700571 - in /ant/ivy/core/trunk: CHANGES.txt src/java/org/apache/ivy/plugins/parser/m2/PomReader.java test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java test/ja

2008-09-30 Thread maartenc
Author: maartenc
Date: Tue Sep 30 13:34:15 2008
New Revision: 700571

URL: http://svn.apache.org/viewvc?rev=700571view=rev
Log:
FIX: Maven Pom reader doesn't handle optional dependencies correctly in some 
instances (IVY-926) (thanks to Phil Messenger)

Modified:
ant/ivy/core/trunk/CHANGES.txt
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java

ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java

ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-optional.pom

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=700571r1=700570r2=700571view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Tue Sep 30 13:34:15 2008
@@ -53,6 +53,7 @@
Bernard Niset
David Maplesden
Glen Marchesani
+   Phil Messenger
Mathias Muller
Peter Oxenham
Emmanuel Pellereau
@@ -90,6 +91,7 @@
 - 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)
 
2.0.0-rc1
 =

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java?rev=700571r1=700570r2=700571view=diff
==
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java 
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java 
Tue Sep 30 13:34:15 2008
@@ -364,7 +364,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() {

Modified: 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java?rev=700571r1=700570r2=700571view=diff
==
--- 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java
 (original)
+++ 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java
 Tue Sep 30 13:34:15 2008
@@ -384,7 +384,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 +402,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 {

Modified: 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-optional.pom
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-optional.pom?rev=700571r1=700570r2=700571view=diff
==
--- 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-optional.pom 
(original)
+++ 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-optional.pom 
Tue Sep 30 13:34:15 2008
@@ -33,12 +33,18 @@
   groupIdcommons

svn commit: r700604 - /ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-write-dependencies-optional.xml

2008-09-30 Thread maartenc
Author: maartenc
Date: Tue Sep 30 15:18:17 2008
New Revision: 700604

URL: http://svn.apache.org/viewvc?rev=700604view=rev
Log:
Fixed junit test failure introduced by changing junit tests for IVY-926

Modified:

ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-write-dependencies-optional.xml

Modified: 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-write-dependencies-optional.xml
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-write-dependencies-optional.xml?rev=700604r1=700603r2=700604view=diff
==
--- 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-write-dependencies-optional.xml
 (original)
+++ 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-write-dependencies-optional.xml
 Tue Sep 30 15:18:17 2008
@@ -43,5 +43,11 @@
   version2.0.2/version
   scopecompile/scope
 /dependency
+dependency
+  groupIdcglib/groupId
+  artifactIdcglib-extra/artifactId
+  version2.0.2/version
+  scopecompile/scope
+/dependency
   /dependencies
 /project




svn commit: r700610 - in /ant/ivy/core/trunk: CHANGES.txt src/java/org/apache/ivy/plugins/parser/m2/PomReader.java src/java/org/apache/ivy/plugins/parser/m2/m2-entities.ent src/java/org/apache/ivy/uti

2008-09-30 Thread maartenc
Author: maartenc
Date: Tue Sep 30 15:22:12 2008
New Revision: 700610

URL: http://svn.apache.org/viewvc?rev=700610view=rev
Log:
Maven accepts illegal XML for its pom's, Ivy not (IVY-921)

Added:
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/m2-entities.ent
Modified:
ant/ivy/core/trunk/CHANGES.txt
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java
ant/ivy/core/trunk/src/java/org/apache/ivy/util/XMLHelper.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=700610r1=700609r2=700610view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Tue Sep 30 15:22:12 2008
@@ -82,6 +82,7 @@
 - DOCUMENTATION: Filesystem resolver: talks about patterns but does not 
mention these must become absolute file paths (IVY-910)
 
 - 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: Cannot configure items with java.io.File attributes (IVY-905)
 - FIX: Environment properties in ivy settings are no longer resolved (IVY-907)

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java?rev=700610r1=700609r2=700610view=diff
==
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java 
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java 
Tue Sep 30 15:22:12 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;
 
@@ -80,14 +86,32 @@
 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())) {
+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
 }
 
 
@@ -471,8 +495,74 @@
 return r;
 }
 
+private static final class AddDTDFilterInputStream extends 
FilterInputStream {
+private static 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(1);
+
+int bytesToSkip = 0;
+LineNumberReader reader = new LineNumberReader(new 
InputStreamReader

svn commit: r700929 - in /ant/ivy/core/trunk/test/java/org/apache/ivy/ant: IvyAntSettingsBuildFileStackOverflow.xml IvyAntSettingsBuildFileTest.java

2008-10-01 Thread maartenc
Author: maartenc
Date: Wed Oct  1 14:12:02 2008
New Revision: 700929

URL: http://svn.apache.org/viewvc?rev=700929view=rev
Log:
Added junit test for IVY-924

Added:

ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyAntSettingsBuildFileStackOverflow.xml
Modified:

ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyAntSettingsBuildFileTest.java

Added: 
ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyAntSettingsBuildFileStackOverflow.xml
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyAntSettingsBuildFileStackOverflow.xml?rev=700929view=auto
==
--- 
ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyAntSettingsBuildFileStackOverflow.xml
 (added)
+++ 
ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyAntSettingsBuildFileStackOverflow.xml
 Wed Oct  1 14:12:02 2008
@@ -0,0 +1,33 @@
+!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   License); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+--
+project xmlns:ivy=antlib:org.apache.ivy.ant basedir=../../../../../..
+  target name=setUp
+property name=ivy.cache.repository value=build/cache /
+  /target
+
+  target name=tearDown
+   delete dir=build/cache /
+  /target
+
+  target name=testStackOverflow
+   ivy:settings id=ivy.instance 
file=test/repositories/ivysettings.xml /
+   ivy:resolve settingsRef=ivy.instance 
file=test/java/org/apache/ivy/ant/ivy-simple.xml /
+  /target
+
+/project
\ No newline at end of file

Modified: 
ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyAntSettingsBuildFileTest.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyAntSettingsBuildFileTest.java?rev=700929r1=700928r2=700929view=diff
==
--- 
ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyAntSettingsBuildFileTest.java
 (original)
+++ 
ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyAntSettingsBuildFileTest.java
 Wed Oct  1 14:12:02 2008
@@ -49,10 +49,21 @@
 }
 
 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());
+}
 }




svn commit: r700932 - in /ant/ivy/core/trunk: CHANGES.txt src/java/org/apache/ivy/util/url/HttpClientHandler.java

2008-10-01 Thread maartenc
Author: maartenc
Date: Wed Oct  1 14:21:11 2008
New Revision: 700932

URL: http://svn.apache.org/viewvc?rev=700932view=rev
Log:
FIX: HttpClientHandler hanging in certain cases (IVY-930) (thanks to Scott 
Hebert)

Modified:
ant/ivy/core/trunk/CHANGES.txt
ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/HttpClientHandler.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=700932r1=700931r2=700932view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Wed Oct  1 14:21:11 2008
@@ -34,6 +34,7 @@
Tobias Himstedt
Ben Hale
Peter Hayes
+   Scott Hebert
Matt Inger
Anders Janmyr
Christer Jonsson
@@ -96,6 +97,7 @@
 - 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)
 
2.0.0-rc1
 =

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/HttpClientHandler.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/HttpClientHandler.java?rev=700932r1=700931r2=700932view=diff
==
--- ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/HttpClientHandler.java 
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/HttpClientHandler.java 
Wed Oct  1 14:21: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,15 +104,18 @@
 
 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 {
@@ -133,6 +137,7 @@
 /* ignored */
 }
 }
+put.releaseConnection();
 }
 }
 




svn commit: r700941 - in /ant/ivy/core/trunk: CHANGES.txt src/java/org/apache/ivy/util/url/AbstractURLHandler.java src/java/org/apache/ivy/util/url/BasicURLHandler.java src/java/org/apache/ivy/util/ur

2008-10-01 Thread maartenc
Author: maartenc
Date: Wed Oct  1 14:52:11 2008
New Revision: 700941

URL: http://svn.apache.org/viewvc?rev=700941view=rev
Log:
FIX: Can't download files containing space or + in their names by HTTP (IVY-923)

Modified:
ant/ivy/core/trunk/CHANGES.txt
ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/AbstractURLHandler.java
ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/BasicURLHandler.java
ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/HttpClientHandler.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=700941r1=700940r2=700941view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Wed Oct  1 14:52:11 2008
@@ -98,6 +98,7 @@
 - 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)
 
2.0.0-rc1
 =

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/AbstractURLHandler.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/AbstractURLHandler.java?rev=700941r1=700940r2=700941view=diff
==
--- ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/AbstractURLHandler.java 
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/AbstractURLHandler.java 
Wed Oct  1 14:52: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/trunk/src/java/org/apache/ivy/util/url/BasicURLHandler.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/BasicURLHandler.java?rev=700941r1=700940r2=700941view=diff
==
--- ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/BasicURLHandler.java 
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/BasicURLHandler.java 
Wed Oct  1 14:52: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

svn commit: r701217 - /ant/ivy/core/trunk/build.xml

2008-10-02 Thread maartenc
Author: maartenc
Date: Thu Oct  2 12:21:20 2008
New Revision: 701217

URL: http://svn.apache.org/viewvc?rev=701217view=rev
Log:
Don't use the id attribute on the ivy:configure task...

Modified:
ant/ivy/core/trunk/build.xml

Modified: ant/ivy/core/trunk/build.xml
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/build.xml?rev=701217r1=701216r2=701217view=diff
==
--- ant/ivy/core/trunk/build.xml (original)
+++ ant/ivy/core/trunk/build.xml Thu Oct  2 12:21:20 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 




svn commit: r701232 - in /ant/ivy/core/trunk: CHANGES.txt src/java/org/apache/ivy/plugins/parser/m2/PomReader.java test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java test/ja

2008-10-02 Thread maartenc
Author: maartenc
Date: Thu Oct  2 13:19:59 2008
New Revision: 701232

URL: http://svn.apache.org/viewvc?rev=701232view=rev
Log:
FIX: Maven2 parser doesn't support POMs with model as root (IVY-932)

Added:
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-model.pom
Modified:
ant/ivy/core/trunk/CHANGES.txt
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java

ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=701232r1=701231r2=701232view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Thu Oct  2 13:19:59 2008
@@ -99,6 +99,7 @@
 - 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)
 
2.0.0-rc1
 =

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java?rev=701232r1=701231r2=701232view=diff
==
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java 
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java 
Thu Oct  2 13:19:59 2008
@@ -58,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;
@@ -99,7 +100,7 @@
 }
 });
 projectElement = pomDomDoc.getDocumentElement();
-if (!PROJECT.equals(projectElement.getNodeName())) {
+if (!PROJECT.equals(projectElement.getNodeName())  
!MODEL.equals(projectElement.getNodeName())) {
 throw new SAXParseException(project must be the root tag , 
res.getName() , 
 res.getName(), 0, 0);
 }

Modified: 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java?rev=701232r1=701231r2=701232view=diff
==
--- 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java
 (original)
+++ 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java
 Thu Oct  2 13:19:59 2008
@@ -631,5 +631,25 @@
 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());
+}
 
 }

Added: 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-model.pom
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-model.pom?rev=701232view=auto
==
--- 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-model.pom 
(added)
+++ 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-model.pom 
Thu Oct  2 13:19:59 2008
@@ -0,0 +1,31 @@
+?xml version=1.0?
+!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information

svn commit: r701710 - in /ant/ivy/core/trunk: CHANGES.txt src/java/org/apache/ivy/core/settings/ivy.properties

2008-10-04 Thread maartenc
Author: maartenc
Date: Sat Oct  4 13:56:36 2008
New Revision: 701710

URL: http://svn.apache.org/viewvc?rev=701710view=rev
Log:
FIX: Default retrieve, publish and deliver patterns doesn't include the 
[classifier] token (IVY-935)

Modified:
ant/ivy/core/trunk/CHANGES.txt
ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/ivy.properties

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=701710r1=701709r2=701710view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Sat Oct  4 13:56:36 2008
@@ -100,6 +100,7 @@
 - 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)
 
2.0.0-rc1
 =

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/ivy.properties
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/ivy.properties?rev=701710r1=701709r2=701710view=diff
==
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/ivy.properties 
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/ivy.properties Sat 
Oct  4 13:56:36 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]




svn commit: r702262 - in /ant/ivy/core/trunk: CHANGES.txt src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java

2008-10-06 Thread maartenc
Author: maartenc
Date: Mon Oct  6 14:02:33 2008
New Revision: 702262

URL: http://svn.apache.org/viewvc?rev=702262view=rev
Log:
FIX: Can't use latest.release for pom dependencies (IVY-936)

Modified:
ant/ivy/core/trunk/CHANGES.txt

ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=702262r1=702261r2=702262view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Mon Oct  6 14:02:33 2008
@@ -101,6 +101,7 @@
 - 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)
 
2.0.0-rc1
 =

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java?rev=702262r1=702261r2=702262view=diff
==
--- 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java
 (original)
+++ 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java
 Mon Oct  6 14:02:33 2008
@@ -215,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) {




svn commit: r704631 - in /ant/ivy/core/trunk: CHANGES.txt src/java/org/apache/ivy/core/event/IvyEvent.java src/java/org/apache/ivy/core/event/resolve/ResolveDependencyEvent.java

2008-10-14 Thread maartenc
Author: maartenc
Date: Tue Oct 14 12:28:11 2008
New Revision: 704631

URL: http://svn.apache.org/viewvc?rev=704631view=rev
Log:
FIX: pre-resolve-dependency event doesn't export branch information (IVY-941) 
(thanks to Jaroslaw Wypychowski)

Modified:
ant/ivy/core/trunk/CHANGES.txt
ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/IvyEvent.java

ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/resolve/ResolveDependencyEvent.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=704631r1=704630r2=704631view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Tue Oct 14 12:28:11 2008
@@ -103,6 +103,7 @@
 - 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)
 
2.0.0-rc1
 =

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/IvyEvent.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/IvyEvent.java?rev=704631r1=704630r2=704631view=diff
==
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/IvyEvent.java 
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/IvyEvent.java Tue Oct 
14 12:28: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/trunk/src/java/org/apache/ivy/core/event/resolve/ResolveDependencyEvent.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/resolve/ResolveDependencyEvent.java?rev=704631r1=704630r2=704631view=diff
==
--- 
ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/resolve/ResolveDependencyEvent.java
 (original)
+++ 
ant/ivy/core/trunk/src/java/org/apache/ivy/core/event/resolve/ResolveDependencyEvent.java
 Tue Oct 14 12:28: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() {




svn commit: r705768 - in /ant/ivy/core/trunk: CHANGES.txt src/java/org/apache/ivy/ant/IvyCacheFileset.java

2008-10-17 Thread maartenc
Author: maartenc
Date: Fri Oct 17 14:55:13 2008
New Revision: 705768

URL: http://svn.apache.org/viewvc?rev=705768view=rev
Log:
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)

Modified:
ant/ivy/core/trunk/CHANGES.txt
ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyCacheFileset.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=705768r1=705767r2=705768view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Fri Oct 17 14:55:13 2008
@@ -75,6 +75,7 @@
James P. White
Tom Widmer
John Williams
+Chris Wood
Patrick Woodworth
Jaroslaw Wypychowski

@@ -104,6 +105,7 @@
 - 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)
 
2.0.0-rc1
 =

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyCacheFileset.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyCacheFileset.java?rev=705768r1=705767r2=705768view=diff
==
--- ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyCacheFileset.java 
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyCacheFileset.java Fri Oct 
17 14:55:13 2008
@@ -78,7 +78,7 @@
 for (Iterator iter = paths.iterator(); iter.hasNext();) {
 ArtifactDownloadReport a = (ArtifactDownloadReport) 
iter.next();
 if (a.getLocalFile() != null) {
-NameEntry ne = fileset.createInclude();
+NameEntry ne = fileset. createInclude();
 ne.setName(getPath(base, a.getLocalFile()));
 }
 }
@@ -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);
 }
 
 /**




svn commit: r705769 - /ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyCacheFileset.java

2008-10-17 Thread maartenc
Author: maartenc
Date: Fri Oct 17 14:58:23 2008
New Revision: 705769

URL: http://svn.apache.org/viewvc?rev=705769view=rev
Log:
Formatting correction

Modified:
ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyCacheFileset.java

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyCacheFileset.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyCacheFileset.java?rev=705769r1=705768r2=705769view=diff
==
--- ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyCacheFileset.java 
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyCacheFileset.java Fri Oct 
17 14:58:23 2008
@@ -78,7 +78,7 @@
 for (Iterator iter = paths.iterator(); iter.hasNext();) {
 ArtifactDownloadReport a = (ArtifactDownloadReport) 
iter.next();
 if (a.getLocalFile() != null) {
-NameEntry ne = fileset. createInclude();
+NameEntry ne = fileset.createInclude();
 ne.setName(getPath(base, a.getLocalFile()));
 }
 }




svn commit: r706421 - in /ant/ivy/core/trunk: CHANGES.txt src/java/org/apache/ivy/plugins/resolver/BasicResolver.java test/java/org/apache/ivy/core/resolve/ResolveTest.java test/repositories/extra-att

2008-10-20 Thread maartenc
Author: maartenc
Date: Mon Oct 20 14:47:15 2008
New Revision: 706421

URL: http://svn.apache.org/viewvc?rev=706421view=rev
Log:
FIX: Extra Attributes specified in the Dependency's Module Descriptor are not 
available to resolvers (IVY-929) (thanks to Scott Hebert)

Modified:
ant/ivy/core/trunk/CHANGES.txt

ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/BasicResolver.java
ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java

ant/ivy/core/trunk/test/repositories/extra-attributes/mymodule/task1/1854/ivy.xml

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=706421r1=706420r2=706421view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Mon Oct 20 14:47:15 2008
@@ -31,6 +31,7 @@
Jacob Grydholt Jensen
Scott Goldstein
Pierre Hägnestrand
+   Scott Hebert
Tobias Himstedt
Ben Hale
Peter Hayes
@@ -106,6 +107,7 @@
 - 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)
 
2.0.0-rc1
 =

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/BasicResolver.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/BasicResolver.java?rev=706421r1=706420r2=706421view=diff
==
--- 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/BasicResolver.java 
(original)
+++ 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/BasicResolver.java 
Mon Oct 20 14:47:15 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/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java?rev=706421r1=706420r2=706421view=diff
==
--- ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java 
(original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java 
Mon Oct 20 14:47:15 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

svn commit: r706432 - in /ant/ivy/core/trunk: CHANGES.txt src/java/org/apache/ivy/util/cli/CommandLineParser.java test/java/org/apache/ivy/MainTest.java

2008-10-20 Thread maartenc
Author: maartenc
Date: Mon Oct 20 15:26:49 2008
New Revision: 706432

URL: http://svn.apache.org/viewvc?rev=706432view=rev
Log:
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)

Modified:
ant/ivy/core/trunk/CHANGES.txt
ant/ivy/core/trunk/src/java/org/apache/ivy/util/cli/CommandLineParser.java
ant/ivy/core/trunk/test/java/org/apache/ivy/MainTest.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=706432r1=706431r2=706432view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Mon Oct 20 15:26:49 2008
@@ -108,6 +108,7 @@
 - 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)
 
2.0.0-rc1
 =

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/util/cli/CommandLineParser.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/util/cli/CommandLineParser.java?rev=706432r1=706431r2=706432view=diff
==
--- ant/ivy/core/trunk/src/java/org/apache/ivy/util/cli/CommandLineParser.java 
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/util/cli/CommandLineParser.java 
Mon Oct 20 15:26:49 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/trunk/test/java/org/apache/ivy/MainTest.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/MainTest.java?rev=706432r1=706431r2=706432view=diff
==
--- ant/ivy/core/trunk/test/java/org/apache/ivy/MainTest.java (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/MainTest.java Mon Oct 20 
15:26:49 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

svn commit: r706440 - in /ant/ivy/core/trunk: CHANGES.txt src/java/org/apache/ivy/ant/IvyResolve.java test/java/org/apache/ivy/ant/IvyResolveTest.java

2008-10-20 Thread maartenc
Author: maartenc
Date: Mon Oct 20 15:45:13 2008
New Revision: 706440

URL: http://svn.apache.org/viewvc?rev=706440view=rev
Log:
FIX: Correctly set ivy.resolved.configurations property when the conf string 
includes a negation operator (IVY-951) (thanks to Patrick Woodworth)

Modified:
ant/ivy/core/trunk/CHANGES.txt
ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyResolve.java
ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyResolveTest.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=706440r1=706439r2=706440view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Mon Oct 20 15:45:13 2008
@@ -109,6 +109,7 @@
 - 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)
 
2.0.0-rc1
 =

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyResolve.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyResolve.java?rev=706440r1=706439r2=706440view=diff
==
--- ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyResolve.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyResolve.java Mon Oct 20 
15:45:13 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/trunk/test/java/org/apache/ivy/ant/IvyResolveTest.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyResolveTest.java?rev=706440r1=706439r2=706440view=diff
==
--- ant/ivy/core/trunk/test/java/org/apache/ivy/ant

svn commit: r706442 - in /ant/ivy/core/trunk: CHANGES.txt src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorWriter.java

2008-10-20 Thread maartenc
Author: maartenc
Date: Mon Oct 20 15:54:23 2008
New Revision: 706442

URL: http://svn.apache.org/viewvc?rev=706442view=rev
Log:
FIX: Maven pom license url can contain xml entities (IVY-950)

Modified:
ant/ivy/core/trunk/CHANGES.txt

ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorWriter.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=706442r1=706441r2=706442view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Mon Oct 20 15:54:23 2008
@@ -110,6 +110,7 @@
 - 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)
 
2.0.0-rc1
 =

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorWriter.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorWriter.java?rev=706442r1=706441r2=706442view=diff
==
--- 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorWriter.java
 (original)
+++ 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorWriter.java
 Mon Oct 20 15:54:23 2008
@@ -447,21 +447,21 @@
 License license = licenses[i];
 out.print(\t\tlicense );
 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\tdescription);
 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( /);




svn commit: r706443 - /ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/test-write-full.xml

2008-10-20 Thread maartenc
Author: maartenc
Date: Mon Oct 20 15:57:56 2008
New Revision: 706443

URL: http://svn.apache.org/viewvc?rev=706443view=rev
Log:
Fixed failing junit test (introduced by fixing IVY-950)

Modified:

ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/test-write-full.xml

Modified: 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/test-write-full.xml
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/test-write-full.xml?rev=706443r1=706442r2=706443view=diff
==
--- 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/test-write-full.xml
 (original)
+++ 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/test-write-full.xml
 Mon Oct 20 15:57:56 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 bgreat/b !br/
+   This module is lt;bgreatlt;/b !lt;br/
You can use it especially with myconf1 and myconf2, and myconf4 is not 
too bad too.
/description
e:someExtra56576/e:someExtra




svn commit: r706728 - in /ant/ivy/core/trunk: CHANGES.txt src/java/org/apache/ivy/plugins/parser/m2/PomReader.java

2008-10-21 Thread maartenc
Author: maartenc
Date: Tue Oct 21 12:26:15 2008
New Revision: 706728

URL: http://svn.apache.org/viewvc?rev=706728view=rev
Log:
FIX: Maven pom license has name as optional element (IVY-949)

Modified:
ant/ivy/core/trunk/CHANGES.txt
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=706728r1=706727r2=706728view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Tue Oct 21 12:26:15 2008
@@ -111,6 +111,7 @@
 - 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)
 
2.0.0-rc1
 =

Modified: 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java?rev=706728r1=706727r2=706728view=diff
==
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java 
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java 
Tue Oct 21 12:26:15 2008
@@ -222,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()]);




svn commit: r706736 - in /ant/ivy/core/trunk: CHANGES.txt doc/settings.html doc/settings/credentials.html doc/toc.json src/java/org/apache/ivy/core/settings/XmlSettingsParser.java

2008-10-21 Thread maartenc
Author: maartenc
Date: Tue Oct 21 12:52:44 2008
New Revision: 706736

URL: http://svn.apache.org/viewvc?rev=706736view=rev
Log:
NEW: Allow authentication credentials to be specified in settings file 
(IVY-943) (thanks to Randy Nott)

Added:
ant/ivy/core/trunk/doc/settings/credentials.html
Modified:
ant/ivy/core/trunk/CHANGES.txt
ant/ivy/core/trunk/doc/settings.html
ant/ivy/core/trunk/doc/toc.json

ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/XmlSettingsParser.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=706736r1=706735r2=706736view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Tue Oct 21 12:52:44 2008
@@ -57,6 +57,7 @@
Glen Marchesani
Phil Messenger
Mathias Muller
+   Randy Nott
Peter Oxenham
Emmanuel Pellereau
Roshan Punnoose
@@ -84,6 +85,8 @@
 =
 - 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)
 

Modified: ant/ivy/core/trunk/doc/settings.html
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/doc/settings.html?rev=706736r1=706735r2=706736view=diff
==
--- ant/ivy/core/trunk/doc/settings.html (original)
+++ ant/ivy/core/trunk/doc/settings.html Tue Oct 21 12:52:44 2008
@@ -72,6 +72,7 @@
 a href=settings/include.htmlinclude/a
 a href=settings/classpath.htmlclasspath/a
 a href=settings/typedef.htmltypedef/a
+a href=settings/credentials.htmlcredentials/a
 a href=settings/lock-strategies.htmllock-strategies/a
 a href=settings/caches.htmlcaches/a
 a href=settings/caches/cache.htmlcache/a

Added: ant/ivy/core/trunk/doc/settings/credentials.html
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/doc/settings/credentials.html?rev=706736view=auto
==
--- ant/ivy/core/trunk/doc/settings/credentials.html (added)
+++ ant/ivy/core/trunk/doc/settings/credentials.html Tue Oct 21 12:52:44 2008
@@ -0,0 +1,50 @@
+!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN 
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;
+!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   License); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+--
+html
+head
+   script type=text/javascriptvar xookiConfig = {level: 1};/script   
+   script type=text/javascript src=../xooki/xooki.js/script
+/head
+body
+   textarea id=xooki-source
+bTag:/b credentials
+
+span class=tagdoc id=ivysettings.credentialsConfigures HTTP 
authentication credentials./span span class=sincesince 2.0/span.
+
+h1Attributes/h1
+table class=ivy-attributes
+thead
+trth class=ivy-attAttribute/thth 
class=ivy-att-descDescription/thth class=ivy-att-reqRequired/th/tr
+/thead
+tbody
+trtdhost/tdtdthe name of the host/td
+tdYes/td/tr
+trtdrealm/tdtdthe name of the realm/td
+tdNo/td/tr
+trtdusername/tdtdthe username/td
+tdYes/td/tr
+trtdpasswd/tdtdthe password/td
+tdYes/td/tr
+/tbody
+/table
+/textarea
+script type=text/javascriptxooki.postProcess();/script
+/body
+/html

Modified: ant/ivy/core/trunk/doc/toc.json
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/doc/toc.json?rev=706736r1=706735r2=706736view=diff
==
--- ant/ivy/core/trunk/doc/toc.json (original)
+++ ant/ivy/core/trunk/doc/toc.json Tue Oct 21 12:52:44 2008
@@ -186,6 +186,13 @@
 ]
 },
 {
+  id:settings/credentials,
+  title:credentials,
+  children

svn commit: r706768 - in /ant/ivy/core/trunk: ./ src/java/org/apache/ivy/plugins/parser/m2/ test/java/org/apache/ivy/plugins/parser/m2/

2008-10-21 Thread maartenc
Author: maartenc
Date: Tue Oct 21 14:03:57 2008
New Revision: 706768

URL: http://svn.apache.org/viewvc?rev=706768view=rev
Log:
FIX: Ivy doesn't throw an error when the parent POM cannot be loaded (IVY-931)

Added:

ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-parent-not-found.pom
Modified:
ant/ivy/core/trunk/CHANGES.txt

ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java

ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=706768r1=706767r2=706768view=diff
==
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Tue Oct 21 14:03:57 2008
@@ -115,6 +115,7 @@
 - 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/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java?rev=706768r1=706767r2=706768view=diff
==
--- 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
 (original)
+++ 
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
 Tue Oct 21 14:03:57 2008
@@ -135,8 +135,8 @@
 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(

Modified: 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java?rev=706768r1=706767r2=706768view=diff
==
--- 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java
 (original)
+++ 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java
 Tue Oct 21 14:03:57 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);

Added: 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-parent-not-found.pom
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-parent-not-found.pom?rev=706768view=auto
==
--- 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-parent-not-found.pom
 (added)
+++ 
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-parent-not-found.pom
 Tue Oct 21 14:03:57 2008
@@ -0,0 +1,36 @@
+?xml version=1.0?
+!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership

svn commit: r706780 - /ant/ivy/core/branches/2.0.x/version.properties

2008-10-21 Thread maartenc
Author: maartenc
Date: Tue Oct 21 14:42:45 2008
New Revision: 706780

URL: http://svn.apache.org/viewvc?rev=706780view=rev
Log:
updated version for 2.0.x branch

Modified:
ant/ivy/core/branches/2.0.x/version.properties

Modified: ant/ivy/core/branches/2.0.x/version.properties
URL: 
http://svn.apache.org/viewvc/ant/ivy/core/branches/2.0.x/version.properties?rev=706780r1=706779r2=706780view=diff
==
--- ant/ivy/core/branches/2.0.x/version.properties (original)
+++ ant/ivy/core/branches/2.0.x/version.properties Tue Oct 21 14:42:45 2008
@@ -16,5 +16,5 @@
 #   * specific language governing permissions and limitations
 #   * under the License.
 #   ***
-target.ivy.version=2.0.0-rc1
-target.ivy.bundle.version=2.0.0.cr1
+target.ivy.version=2.0.x
+target.ivy.bundle.version=2.0.x




  1   2   3   4   5   6   7   8   9   10   >