Run mvn install command skipping selected jar

272 views Asked by At

What I need to do is to build a jar without one huuuge dependency, which is a fellow below

    <dependency>
        <groupId>com.groupdocs</groupId>
        <artifactId>groupdocs-conversion</artifactId>
        <version>21.1</version>
    </dependency>

The system scope is one of solutions, but not in this case. None of my teammates would be happy to download a jar dependency manually.

Building a project including mentioned dependency creates a jar of 515 MBs or 251 MBs without it (system scope).

1

There are 1 answers

0
Robert Gardziński On

Thanks tgdavies for a hint with plugin. The thing that helped me was adding excludeGroupIds like below:

        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <configuration>
                <mainClass>SECRET</mainClass>
                <excludeGroupIds>com.groupdocs</excludeGroupIds>
            </configuration>
        </plugin>