Hi,

If I override a dependency
in a child pom, and then
run 

mvn eclipse:eclipse 

in the child project directory
it does not set the class path
correctly.

I uploaded the testing document
I used containing shell scripts, etc.
to my sandbox account here:

https://svn.apache.org/repos/asf/directory/sandbox/oersoy/maven-testing/eclipse-maven-testing.apt

Incidentally - Anyone know if there is an option that
makes the eclipse plugin create eclipse projects for
projects with packaging pom.  This would be really
nice for editing the dependencyManagement section of
the pom.

Here is the section of this document containing the
test for this (The mail parser may nix some of the
entities)


Challenge

     See whether we can set
     a dependency version in
     the dependency management
     section of a pom and then 
     override it on a child pom. 
     
Solution

     Run the following script

----------------------------------------------------------------

mvn archetype:create -DartifactId=L0Project
-DgroupId=test
cd L0Project
sed -e 's/jar/pom/' pom.xml | sed -e '10,18d' >
pom.xml.tmp
cat << END >> pom.xml.tmp
<dependencyManagement>
     <dependencies>
          <dependency>
            
<artifactId>commons-collections</artifactId>
             <groupId>commons-collections</groupId>
             <version>2.11</version>
             <scope>test</scope>
          </dependency>
     </dependencies>
</dependencyManagement>
</project>
END
mv pom.xml.tmp pom.xml

mvn archetype:create -DartifactId=L1Project
-DgroupId=test

pushd L1Project
sed -e '20,21d' pom.xml > pom.xml.tmp

cat << END >> pom.xml.tmp
      <dependency>
         <artifactId>commons-collections</artifactId>
         <groupId>commons-collections</groupId>
         <version>3.2</version>
         <scope>test</scope>
    </dependency>
</dependencies>
</project>
END

mv pom.xml.tmp pom.xml

pushd src/test/java/test

cat << END > AppTest.java
package test;

import
org.apache.commons.collections.bag.AbstractBagDecorator;

import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;


/**
 * Unit test for simple App.
 */
public class AppTest 
    extends TestCase
{
    /**
     * Create the test case
     *
     * @param testName name of the test case
     */
    public AppTest( String testName )
    {
        super( testName );
    }

    /**
     * @return the suite of tests being tested
     */
    public static Test suite()
    {
        return new TestSuite( AppTest.class );
    }

    /**
     * Rigourous Test :-)
     */
    public void testApp()
    {
        AbstractBagDecorator emannuelsBagDecorator;
        assertTrue( true );
    }
}
END


popd
popd
mvn eclipse:eclipse
mvn test
----------------------------------------------------------------
    

Result

     The test runs fine. 











Challenge

     See whether we can import the 
     L1Project into eclipse and have
     the AbstractBagDecorator that the 
     AppTest needs loaded successfully. 
     
Solution

     Import the L1Project into 
     eclipse.
     
Result

     The AbstractBagDecorator
     does not load.

Follow Up

     Check with Maven Dev to see 
     whether this is a known bug.

Cheers,
- Ole



 
____________________________________________________________________________________
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.mail.yahoo.com

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

Reply via email to