The following issue has been updated:

    Updater: Hardy Ferentschik (mailto:[EMAIL PROTECTED])
       Date: Sat, 27 Nov 2004 2:17 PM
    Comment:
To fix the described bug I just added an additional check for 
Artifact.OVERRIDE_PATH in getDependencies() of DependencyVerifier.
    Changes:
             Attachment changed to DependencyVerifier.java.patch
    ---------------------------------------------------------------------
For a full history of the issue, see:

  http://jira.codehaus.org/browse/MAVEN-1518?page=history

---------------------------------------------------------------------
View the issue:
  http://jira.codehaus.org/browse/MAVEN-1518

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: MAVEN-1518
    Summary: Wrong behaviour for non existing overwritten dependency
       Type: Bug

     Status: Unassigned
   Priority: Major

 Original Estimate: Unknown
 Time Spent: Unknown
  Remaining: Unknown

    Project: maven
 Components: 
             core
   Fix Fors:
             1.0.2
   Versions:
             1.0.1

   Assignee: 
   Reporter: Hardy Ferentschik

    Created: Fri, 26 Nov 2004 11:12 AM
    Updated: Sat, 27 Nov 2004 2:17 PM

Description:
If a project dependency gets overwritten in project.xml and due the specified 
path to the overwrite jar is wrong, maven downloads the jar file specified in 
project.xml and saves it under the file name specified in project.properties. 
For example (that's how I found the bug):

In project.xml I specified:

        <dependency>
            <groupId>hibernate</groupId>
            <artifactId>hibernate</artifactId>
            <version>2.0-final</version>
            <properties>
                <war.bundle>true</war.bundle>
            </properties>
        </dependency>

Since I had some complication issues with 2.0-final I wanted to compile agaist 
a version I had on my hard disk from a previous project called hibernate.jar. I 
copied the jar into the lib directory of the project and modified 
project.properties to include:

maven.jar.override = on
maven.jar.hibernate = ${basedir}/lib/hiberante.jar <- note the typo

When I tried to compile maven downloaded hibernate-2.0-final.jar and saved it 
under lib/hiberante.jar without error message. I would expect if a jar gets 
overwritten with a path to another jar and this jar does not exist an 
UnsatisfiedDependencyException should be thrown.

I believe the problem is that in this described case the artifact for hibernate 
gets added to the failedDependencies list in 
DependencyVerifier.satisfyDependencies(), because artifact.exist() will return 
false. This there is now an entry in the list getDependencies() is getting 
called and hibernate-2.0-final.jar will be downloaded and saved under the path 
specified in project.properties. I guess getDependencies() should check the 
artifact type prior to downloading.

I made the fix in my version of maven and it seems to work. I am happy to send 
the fix to whoever is fixing the bug.




---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to