Java

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • Jar classpath order

    2 answers - 953 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    I've looking through the archives and haven't found the answer I am
    looking for.
    We have a scenario where we are using some older Spring Jars with one of
    our projects that we are converting to use Maven 2. We use the standard
    spring Jar and the spring sand box Jar. The problem is that there is an
    class in each of those Jars. However,
    those two Assert classes are different, specifically they have
    incompatible method signatures. The correct Assert class is the one in
    the spring jar, not the one in the spring sand box jar. It appears that
    Maven 2 has an arbitrary classpath order but the spring sand box Jar
    always seems to come first in the classpath and the wrong Assert class
    is loaded. This problem rears it's heading during unit testing so we
    keep getting NoSuchMethodError's. Can anyone confirm whether we are SL
    or if there is a solution that solves this?
    Marco
  • No.1 | | 1633 bytes | |

    Two quick off the top of my head options:
    1. depend on one of the jars, not both. Why are you using two
    versions of an artifact -- this smells wrong anyway.

    2. Create a third jar under your own groupId that does not include the
    overlapping Asset class (and any others you don't want included twice)
    and add it to your Corporate Repo. Add a dependency on this Jar rather
    than the "spring sand box" jar.

    Wayne

    12/8/06, Marco Di Cesare <mdicesare (AT) interac (DOT) orgwrote:
    I've looking through the archives and haven't found the answer I am
    looking for.

    We have a scenario where we are using some older Spring Jars with one of
    our projects that we are converting to use Maven 2. We use the standard
    spring Jar and the spring sand box Jar. The problem is that there is an
    class in each of those Jars. However,
    those two Assert classes are different, specifically they have
    incompatible method signatures. The correct Assert class is the one in
    the spring jar, not the one in the spring sand box jar. It appears that
    Maven 2 has an arbitrary classpath order but the spring sand box Jar
    always seems to come first in the classpath and the wrong Assert class
    is loaded. This problem rears it's heading during unit testing so we
    keep getting NoSuchMethodError's. Can anyone confirm whether we are SL
    or if there is a solution that solves this?
    --
    Marco
    --

    To unsubscribe, e-mail: users-unsubscribe (AT) maven (DOT) apache.org
    For additional commands, e-mail: users-help (AT) maven (DOT) apache.org
  • No.2 | | 1220 bytes | |

    08/12/06, Marco Di Cesare <mdicesare (AT) interac (DOT) orgwrote:
    I've looking through the archives and haven't found the answer I am
    looking for.

    We have a scenario where we are using some older Spring Jars with one of
    our projects that we are converting to use Maven 2. We use the standard
    spring Jar and the spring sand box Jar. The problem is that there is an
    class in each of those Jars. However,
    those two Assert classes are different, specifically they have
    incompatible method signatures. The correct Assert class is the one in
    the spring jar, not the one in the spring sand box jar. It appears that
    Maven 2 has an arbitrary classpath order but the spring sand box Jar
    always seems to come first in the classpath and the wrong Assert class
    is loaded. This problem rears it's heading during unit testing so we
    keep getting NoSuchMethodError's. Can anyone confirm whether we are SL
    or if there is a solution that solves this?

    You may be interested in this issue:

    Mark

    To unsubscribe, e-mail: users-unsubscribe (AT) maven (DOT) apache.org
    For additional commands, e-mail: users-help (AT) maven (DOT) apache.org

Re: Jar classpath order


max 4000 letters.
Your nickname that display:
In order to stop the spam: 6 + 5 =
QUESTION ON "Java"

EMSDN.COM