Y
Y
Yasuro2019-04-25 13:15:02
Java
Yasuro, 2019-04-25 13:15:02

How to not include some dependencies in maven build?

Hello.
There is a training project written in sprigBoot, in which I use my libraries (I include them in project stricture->modules). When I build using maven install, one large jar file appears with all the dependencies (dependencies of the spring itself + my libraries).
Now I want to make it so that only one jar with the dependencies of the spring itself appears, I don’t want to see my libraries in it, I want to add them separately to the lib folder and let the spring pull them from there.
If this were the simplest application, then I would use a jar in which I have a MAIN file MANIFEST.MF and specify the class-path there.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
mystifier, 2019-04-25
@mystifier

You can use scope provided in pom.xml.
Example:

<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>javax.servlet-api</artifactId>
    <version>3.0.1</version>
    <scope>provided</scope>
</dependency>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question