On Wednesday, 6 July 2016 at 21:53, Christian Schulte wrote:
> Am 07/06/16 um 22:21 schrieb Ralph Goers:
> > This is an interesting situation. The classes that use Jackson are all 
> > considered optional in Log4j, so having optional set to true is indeed what 
> > is desired. However, we require those dependencies to compile and to run 
> > the unit tests. With scope set to test I would expect that the non-test 
> > classes that need them would fail to compile. So it sounds like we have to 
> > make sure all transitive dependencies needed for testing are also specified 
> > with optional set to true?
> >  
> > Ralph
>  
> Not sure I understand the situation correctly. If the scope is set to
> test, it's not available in any other scope than test. Could you please
> point me at the POM in question? So I can 'mvn compile' that project
> successfully and you would expect it to not compile due to some optional
> transitive dependency?
>  
>  

Hi Christian,

Gary posted a link to the build in his original post.

Basically at the moment it has a dependencyManagement section in the top-level 
pom that declares various jackson dependencies as optional, including 
jackson-module-jaxb-annotations. The log4j-core sub-project declares a direct 
dependency to jackson-dataformat-xml with compile scope, marked as optional 
(also note that jackson-module-jaxb-annotations is a transitive dependency of 
jackson-dataformat-xml).

With the fix for MNG-5227 the transitive dependency to 
jackson-module-jaxb-annotations is managed as optional and is removed from the 
compile and test classpath. Because the code doesn’t directly depend on 
jackson-module-jaxb-annotations then it compiles ok. However, the tests fail 
because both jackson-dataformat-xml and jackson-module-jaxb-annotations are 
needed at test time.

Without the fix for MNG-5227 the optional flags in the dependencyManagement 
section are ignored, and jackson-module-jaxb-annotations is included on the 
compile and test classpath (because the optional jackson-dataformat-xml 
dependency is selected and jackson-module-jaxb-annotations is now seen as a 
non-optional transitive dependency of jackson-dataformat-xml).

HTH
>  
> Regards,
> --  
> Christian
>  
>  
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected] 
> (mailto:[email protected])
> For additional commands, e-mail: [email protected] 
> (mailto:[email protected])
>  
>  


Reply via email to