user321068
user321068

Reputation:

Exclude whole parent dependency

The parent pom has got the following dependencies

<dependencies>
    <dependency>
        <groupId>tv.my</groupId>
        <artifactId>cable</artifactId>
    </dependency>
    <dependency>
        <groupId>tv.my</groupId>
        <artifactId>sat</artifactId>
    </dependency>
</dependencies>

In the child's pom I want to exclude the whole tv.my:sat dependency. Maybe with something like this:

<dependencies>
    <excludes>
        <exlude>
            <dependency>
                <groupId>tv.my</groupId>
                <artifactId>cable</artifactId>
            </dependency>
        <exlude>
    <excludes>
</dependencies>

Is this somehow possible?

Upvotes: 4

Views: 6396

Answers (1)

bmargulies
bmargulies

Reputation: 100196

You have no choice but to repair the parent POM to use dependencyManagement correctly. Dependencies in parent poms are almost never a good idea, and once you use a parent that has them, you are stuck.

Upvotes: 2

Related Questions