0

Is it possible to exclude all dependencies starting with com.acme* in groupId?

Example:

<dependency>
        <groupId>com.myproject</groupId>
        <artifactId>test</artifactId>
        <version>0.0.1-SNAPSHOT</version>
        <exclusions>
            <exclusion>
                <groupId>com.acme*</groupId>
                <artifactId>*</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
Levent Tokmak
  • 339
  • 1
  • 6
  • 17
  • You can use wildcards yes. Have you tried your current example? See https://stackoverflow.com/questions/547805/exclude-all-transitive-dependencies-of-a-single-dependency or http://www.smartjava.org/content/maven-and-wildcard-exclusions/ – slindenau Sep 15 '22 at 09:49
  • Sure i tried the example, it doesn't exclude depedencies starting with "com.acme". – Levent Tokmak Sep 15 '22 at 11:56
  • Ok, so from the second link in my previous comment we can see the filter is implemented in maven with the following line: `"*".equals( pattern ) || pattern.equals( value );` This means you can use `*` as a wildcard, but not in combination with any other characters. So the answer to your question would currently be `no`. You need a full match on the `groupId`, and then you can ignore all `artifactId` values by using the wildcard. You would need to repeat this for each groupid. Posting this as a comment instead of an answer, because there might be other options i don't know of. – slindenau Sep 15 '22 at 12:32

0 Answers0