R
R
Risin02016-06-02 03:16:44
Java
Risin0, 2016-06-02 03:16:44

How to unpack Maven dependencies into target/classes?

Hello everyone!
The question arose, how, after building a maven project in INTELLIJ IDEA, unpack all dependencies into the output folder (target/classes)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Kosarev, 2016-06-02
@Risin0

Using a profile:

<profiles>
    <profile>
      <id>qa</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
              <execution>
                <phase>install</phase>
                <goals>
                  <goal>copy-dependencies</goal>
                </goals>
                <configuration>
                  <outputDirectory>${project.build.directory}/lib</outputDirectory>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

This profile, when built, will download all dependencies to the lib directory.
The Spring Boot Maven Plugin can also do this.
But in general, I also have a question: why?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question