Home > Software engineering >  Exlude package from maven dependency
Exlude package from maven dependency

Time:05-28

I have error java: module com.example.learningfx reads package jfxtras.labs.util.event from both vworkflows.fx and jfxtras.labs and I think I need to exclude package from jfxtras.labs or vworkflow.fx. Jow can I not include some packages from dependency? Do I need to make this in pom.xml or module-info.java? I use maven and IntelliJ. I think there is already some questions like this but I don't find it

CodePudding user response:

See https://maven.apache.org/pom.html#Exclusions

You do not provide complete groupId:artifactId:version coordinates, so the example cannot be exact:

<dependencies>
  <dependency>
    <groupId>...</groupId>
    <artifactId>com.example.learningfx</artifactId>
    <version>...</version>
    <exclusions>
      <exclusion>
        <groupId>...</groupId>
        <artifactId>vworkflow.fx</artifactId>
      </exclusion>
    </exclusions>
  </dependency>
...

CodePudding user response:

You can only include/exclude whole dependencies, not packages from dependencies.

  • Related