From http://maven.apache.org/guides/introduction/introduction-to-dependency-m echanism.html:
>> Excluded dependencies - If project X depends on project Y, and project Y depends on project Z, the owner of project X can explicitly exclude project Z as a dependency, using the "exclusion" element. << This sounds like what you want, to exclude a transitive dependency. If it were nontransitive, but you needed it for compilation, you would use the provided scope instead, which is described on the same page. -- Bryan -----Original Message----- From: Robert Einsle [mailto:[email protected]] Sent: Monday, April 06, 2009 5:40 AM To: Maven Users List Subject: Dependencie of war-developemant Hy List, i'm developing an war-Application, sending Mail with commons-email. So i add commons-email as dependencie of my pom.xml --- cut --- <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-email</artifactId> <version>1.1</version> </dependency> --- cut --- but commons-email dependy on mail.jar, and activation.jar. So ist adds mail.jar and activation.jar on my Projectdependency. My Developemen-Environment is Eclipse with WTP. Here when i start my Application-Server, i recieved the Message: --- cut --- 2009-04-06 11:13:53,296 ERROR [main] ContextLoader M[initWebApplicationContext] - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name '/index.html' defined in ServletContext resource [/WEB-INF/spring-servlet.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [javax.mail.Session] to required type [javax.mail.Session] for property 'mailSession'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [javax.mail.Session] to required type [javax.mail.Session] for property 'mailSession': no matching editors or conversion strategy found at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac tory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac tory$1.run(AbstractAutowireCapableBeanFactory.java:409) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac tory.createBean(AbstractAutowireCapableBeanFactory.java:380) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObjec t(AbstractBeanFactory.java:264) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.g etSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean( AbstractBeanFactory.java:261) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Ab stractBeanFactory.java:185) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Ab stractBeanFactory.java:164) at org.springframework.beans.factory.support.DefaultListableBeanFactory.pre InstantiateSingletons(DefaultListableBeanFactory.java:429) at org.springframework.context.support.AbstractApplicationContext.finishBea nFactoryInitialization(AbstractApplicationContext.java:728) at org.springframework.context.support.AbstractApplicationContext.refresh(A bstractApplicationContext.java:380) at org.springframework.web.context.ContextLoader.createWebApplicationContex t(ContextLoader.java:255) at org.springframework.web.context.ContextLoader.initWebApplicationContext( ContextLoader.java:199) at org.springframework.web.context.ContextLoaderServlet.init(ContextLoaderS ervlet.java:81) at javax.servlet.GenericServlet.init(GenericServlet.java:212) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.jav a:1172) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:992) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.j ava:4058) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4371 ) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:578) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav a:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Caused by: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [javax.mail.Session] to required type [javax.mail.Session] for property 'mailSession'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [javax.mail.Session] to required type [javax.mail.Session] for property 'mailSession': no matching editors or conversion strategy found at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapper Impl.java:391) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac tory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1289) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac tory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1250) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac tory.populateBean(AbstractAutowireCapableBeanFactory.java:1010) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac tory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472) ... 32 more Caused by: java.lang.IllegalArgumentException: Cannot convert value of type [javax.mail.Session] to required type [javax.mail.Session] for property 'mailSession': no matching editors or conversion strategy found at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeC onverterDelegate.java:231) at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeC onverterDelegate.java:138) at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapper Impl.java:386) ... 36 more --- cut --- Yes I'm using Spring, and the MailSession is configured in my Application-Server (Tomcat 6.0) which has already the jars for mail.jar and activation.jar. I think i will leave the jars (mail and actiovation) in my container, but how can i configure Maven to not resolve this dependency? Thanks for Help Robert --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] This message and the information contained herein is proprietary and confidential and subject to the Amdocs policy statement, you may review at http://www.amdocs.com/email_disclaimer.asp --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
