Movatterモバイル変換


[0]ホーム

URL:



Built by Maven

Copying project dependencies

Project dependencies are the dependencies declared in your pom. To copy them with their transitive dependencies, use thedependency:copy-dependencies mojo and configure the plugin like the sample below:

<project>  [...]  <build>    <plugins>      <plugin>        <groupId>org.apache.maven.plugins</groupId>        <artifactId>maven-dependency-plugin</artifactId>        <version>3.9.0</version>        <executions>          <execution>            <id>copy-dependencies</id>            <phase>package</phase>            <goals>              <goal>copy-dependencies</goal>            </goals>            <configuration>              <outputDirectory>${project.build.directory}/alternateLocation</outputDirectory>              <overWriteReleases>false</overWriteReleases>              <overWriteSnapshots>false</overWriteSnapshots>              <overWriteIfNewer>true</overWriteIfNewer>            </configuration>          </execution>        </executions>      </plugin>    </plugins>  </build>  [...]</project>

Excluding transitive dependencies

As mentioned,transitive dependencies are copied by default. However, they can also be excluded by setting theexcludeTransitive property totrue.

<project>  [...]  <build>    <plugins>      <plugin>        <groupId>org.apache.maven.plugins</groupId>        <artifactId>maven-dependency-plugin</artifactId>        <version>3.9.0</version>        <executions>          <execution>            <id>copy-dependencies</id>            <phase>package</phase>            <goals>              <goal>copy-dependencies</goal>            </goals>            <configuration>              <outputDirectory>${project.build.directory}/alternateLocation</outputDirectory>              <overWriteReleases>false</overWriteReleases>              <overWriteSnapshots>true</overWriteSnapshots>              <excludeTransitive>true</excludeTransitive>            </configuration>          </execution>        </executions>      </plugin>    </plugins>  </build>  [...]</project>


[8]ページ先頭

©2009-2025 Movatter.jp