Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9234663
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:50:35+00:00 2026-06-18T06:50:35+00:00

I have two dependencies in my pom called A and B. Both A and

  • 0

I have two dependencies in my pom called A and B. Both A and B have a transitive dependency on an artifact C (cassandra-all). A and B use difference versions of C. Dependency A is the artifact astyanax.

I want to keep the Version of C that comes with B. I accomplished by adding an exclusion in A (Astyanax) for C.

Unfortunately, I want the scope of B to be ‘test’. This means that with the exclusion in A, C will not be included outside of the test scope.

How can I resolve this? Can an exclusion be for a specific scope only? Alternatively, can I specify which version to use for a transitive dependency?


Example:
Here is what my pom looks like:

Artifact A (astyanax) with exclusion of dependency on Artifact C (called cassandra-all)

    <dependency>
        <groupId>com.netflix.astyanax</groupId>
        <artifactId>astyanax</artifactId>
        <version>1.0.4</version>
        <exclusions>
            <exclusion>
                <groupId>org.apache.cassandra</groupId>
                <artifactId>cassandra-all</artifactId>
            </exclusion>
        </exclusions>  
    </dependency>
    <dependency>
        <groupId>org.cassandraunit</groupId>
        <artifactId>cassandra-unit</artifactId>
        <version>1.1.1.1</version>
        <scope>test</scope>
    </dependency>

So concretely: how can I include cassandra-all when I run code outside of the test scope and still keep the scope of cassandraunit test only?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T06:50:36+00:00Added an answer on June 18, 2026 at 6:50 am

    I apologize if my question wasn’t as clear as it could have been. The way I resolved this wasn’t hard at all:

    • I added a separate dependency for C in my pom
    • I kept the exclusion of C in A

    Concretely here, I just added:

        <dependency>
            <groupId>org.apache.cassandra</groupId>
            <artifactId>cassandra-all</artifactId>
            <version>1.1.5</version>
        </dependency>
    

    and also the following dependency that was missing at runtime otherwise.

        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <version>2.6</version>
        </dependency>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two maven projects: project-api project-impl project-impl's POM specifies a dependency on project-api.
i have 3 maven project (starto.commons,starto.hibernate,starto.server) that use some same dependencies and two of
I have a project that use both dependencies independently: BoneCP and Hibernate. But thanks
I have two update panels on a page. And I want to update both
I have two queries that find both the Zip codes, and the States for
I have two tables in a database, one lists package and one lists dependencies:
I have two projects in one Visual Studio 2008 solution. I'd like to use
Just assume I have some class Foo, that has two dependencies: an ISerializer<T> and
I have a pom file in which version numbers of some dependencies rely on
Suppose we have two modules with cyclic dependencies: # a.py import b def f():

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.