spring-boot-maven-plugin

This commit is contained in:
dzj 2024-02-23 09:15:45 +08:00
parent 31b8a17e65
commit 4609cb3d25
1 changed files with 135 additions and 111 deletions

246
pom.xml
View File

@ -1,112 +1,136 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <project
<modelVersion>4.0.0</modelVersion> xmlns="http://maven.apache.org/POM/4.0.0"
<groupId>net.risesoft.demo</groupId> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<artifactId>demo-car</artifactId> <modelVersion>4.0.0</modelVersion>
<version>1.0</version> <groupId>net.risesoft.demo</groupId>
<dependencies> <artifactId>demo-car</artifactId>
<dependency> <version>1.0</version>
<groupId>net.risesoft.demo</groupId> <dependencies>
<artifactId>demo-merceds</artifactId> <dependency>
<version>1.0</version> <groupId>net.risesoft.demo</groupId>
</dependency> <artifactId>demo-merceds</artifactId>
<version>1.0</version>
<dependency> </dependency>
<groupId>net.risesoft.demo</groupId> <dependency>
<artifactId>demo-audi</artifactId> <groupId>net.risesoft.demo</groupId>
<version>1.0</version> <artifactId>demo-audi</artifactId>
</dependency> <version>1.0</version>
</dependency>
</dependencies> </dependencies>
<build>
<build> <plugins>
<plugins> <plugin>
<plugin> <groupId>org.apache.maven.plugins</groupId>
<groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId>
<artifactId>maven-jar-plugin</artifactId> <version>3.12.1</version>
<version>3.3.0</version> <configuration>
<configuration> <parameters>true</parameters>
<archive> </configuration>
<manifest> </plugin>
<mainClass>net.risesoft.demo.Example</mainClass> <plugin>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries> <groupId>org.apache.maven.plugins</groupId>
<addClasspath>flase</addClasspath> <artifactId>maven-jar-plugin</artifactId>
<classpathPrefix>lib/</classpathPrefix> <version>3.3.0</version>
</manifest> <configuration>
<manifestEntries> <archive>
<Class-Path>./</Class-Path> <manifest>
</manifestEntries> <mainClass>net.risesoft.demo.Example</mainClass>
</archive> <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</configuration> <addClasspath>true</addClasspath>
</plugin> <classpathPrefix>lib/</classpathPrefix>
<plugin> </manifest>
<groupId>org.apache.maven.plugins</groupId> <manifestEntries>
<artifactId>maven-dependency-plugin</artifactId> <Class-Path>./</Class-Path>
<version>2.10</version> </manifestEntries>
<executions> </archive>
<execution> </configuration>
<id>copy-dependencies</id> </plugin>
<phase>package</phase> <plugin>
<goals> <groupId>org.apache.maven.plugins</groupId>
<goal>copy-dependencies</goal> <artifactId>maven-dependency-plugin</artifactId>
</goals> <version>2.10</version>
<configuration> <executions>
<outputDirectory>${project.build.directory}/lib</outputDirectory> <execution>
</configuration> <id>copy-dependencies</id>
</execution> <phase>package</phase>
</executions> <goals>
</plugin> <goal>copy-dependencies</goal>
</goals>
<!--<plugin> <configuration>
<groupId>org.apache.maven.plugins</groupId> <outputDirectory>${project.build.directory}/lib</outputDirectory>
<artifactId>maven-assembly-plugin</artifactId> </configuration>
<version>3.6.0</version> </execution>
<configuration> </executions>
<archive> </plugin>
<manifest>
<mainClass>net.risesoft.demo.Example</mainClass> <!--<plugin>
</manifest> <groupId>org.apache.maven.plugins</groupId>
</archive> <artifactId>maven-assembly-plugin</artifactId>
<descriptorRefs> <version>3.6.0</version>
<descriptorRef>jar-with-dependencies</descriptorRef> <configuration>
</descriptorRefs> <archive>
</configuration> <manifest>
<executions> <mainClass>net.risesoft.demo.Example</mainClass>
<execution> </manifest>
<id>make-assembly</id> </archive>
<phase>package</phase> <descriptorRefs>
<goals> <descriptorRef>jar-with-dependencies</descriptorRef>
<goal>single</goal> </descriptorRefs>
</goals> </configuration>
</execution> <executions>
</executions> <execution>
</plugin>--> <id>make-assembly</id>
<phase>package</phase>
<!--<plugin> <goals>
<groupId>org.apache.maven.plugins</groupId> <goal>single</goal>
<artifactId>maven-shade-plugin</artifactId> </goals>
<version>3.5.2</version> </execution>
<executions> </executions>
<execution> </plugin>-->
<phase>package</phase>
<goals> <!--<plugin>
<goal>shade</goal> <groupId>org.apache.maven.plugins</groupId>
</goals> <artifactId>maven-shade-plugin</artifactId>
<configuration> <version>3.5.2</version>
<transformers> <executions>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> <execution>
<mainClass>net.risesoft.demo.Example</mainClass> <phase>package</phase>
</transformer> <goals>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> <goal>shade</goal>
<resource>META-INF/spring.handlers</resource> </goals>
</transformer> <configuration>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> <transformers>
<resource>META-INF/spring.schemas</resource> <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
</transformer> <mainClass>net.risesoft.demo.Example</mainClass>
</transformers> </transformer>
</configuration> <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
</execution> <resource>META-INF/spring.handlers</resource>
</executions> </transformer>
</plugin>--> <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
</plugins> <resource>META-INF/spring.schemas</resource>
</build> </transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>-->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>3.2.3</version>
<configuration>
<mainClass>net.risesoft.demo.Example</mainClass>
</configuration>
<executions>
<execution>
<id>repackage</id>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project> </project>