0

I have a maven project depending on another maven projects. The project tree is the following:

final_project
     |
     |----sub_project
     |        |----jsf 1.2_09
     |----jsf 2.0.3

How is it known what exactly jsf-library will be used in what project? I mean does it arise a conflict in such project?

UPD: Because of the different group id:

<dependency>
    <groupId>javax.faces</groupId>
    <artifactId>jsf-impl</artifactId>
    <version>1.2_09</version>
    <type>jar</type>
    <scope>compile</scope>
</dependency>

and

    <dependency>
        <groupId>com.sun.faces</groupId>
        <artifactId>jsf-impl</artifactId>
        <version>2.0.3</version>
    </dependency>

these dependencies is not overridable.

St.Antario
  • 26,175
  • 41
  • 130
  • 318
  • You have run into a classical problem that is usually solved by a more modular approach to library loading like OSGi or JBoss modules. The only downside to your specific problem is that it might be **very** hard to run two versions of JSF in the same application, never tried that. – nablex Nov 21 '14 at 12:08
  • "exclude" is not an option? http://stackoverflow.com/questions/27057481/exclude-a-maven-dependecie-from-a-derived-pom?rq=1 ... – OhadR Nov 21 '14 at 15:13

1 Answers1

1

This is not so easy, see other questions:

As reported earlier, for a robust result you can use the maven-shade-plugin to create a separate package for the old version, ie your.package.jsf12.jsfpackage

Just read your update. If the packages are different: no problem. If there is an overlap in package: see my note about the shade plugin

Community
  • 1
  • 1
rmuller
  • 12,062
  • 4
  • 64
  • 92