Hi Wureka,

Just as Ivan said, the <dep:dependency> just tell geronimo server to find the dependency. The red circle X in eclipse is caused by compiler, so you need to add commons-collections-3.2.jar to the build path of your project.

Try, build path->"configure build path" ->"java build path" ->"libaries"- >"add external library".

Hope it helps!


2009/7/16 David Jencks <david_jencks@yahoo.com>

On Jul 15, 2009, at 6:54 PM, Wureka wrote:



Hi,
I use Eclipse 3.4 to develop a WAR application for Geronimo 2.1.4.
The application needs  commons-collections-3.2.jar. For shrinking my
application size, I hope to reuse the same jar file in geronimo repository
if there is the jar my application needs.

Fortunately I did find that there is the jar in the repository. And I add
the below dependencies in <dep:dependencies> block in my geronimo-web.xml
          <dep:dependency>
              <dep:groupId>commons-collections</dep:groupId>
              <dep:artifactId>commons-collections</dep:artifactId>
              <dep:version>3.2</dep:version>
              <dep:type>jar</dep:type>
          </dep:dependency>

That should tell geronimo to reuse the jar but AFAIK not eclipse :-)


However, in Eclipse, I saw the code using the class in
commons-collections-3.2.jar still has red circle X on the lines where the
class appears.

What action do I still need to do for fixing the priblem?

I'm not an eclipse expert.

What I recommend is setting up a geronimo plugin project to "predeploy" your war to geronimo.  You'll have 2 maven projects:
- the war project in which you mark the dependency as "provided" so it doesn't get into the war
- the plugin project where you include the dependency without any scope.  Don't include the <environment> element in your geronimo plan, the car-maven-plugin will add it based on the maven pom.

If you then use m2eclipse eclpse will know about your dependency from the maven pom.

hope this helps
david jencks


Thank you for your help.

--
View this message in context: http://www.nabble.com/How-to-reuse-the-jars-in-geronimo-repository--tp24508861s134p24508861.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.




--
Best Regards,

Delos