mirror of https://github.com/halo-dev/halo
🍎 修改pom.xml的打包方式,新增dev和prod的配置
parent
ea7da172fd
commit
45438a90a3
|
@ -1,5 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
APP_NAME=halo-beta.jar
|
APP_NAME=halo-0.0.1.jar
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo "用法: sh halo.sh [start(启动)|stop(停止)|restart(重启)|status(状态)]"
|
echo "用法: sh halo.sh [start(启动)|stop(停止)|restart(重启)|status(状态)]"
|
||||||
|
|
154
pom.xml
154
pom.xml
|
@ -4,7 +4,7 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>cc.ryanc</groupId>
|
<groupId>cc.ryanc</groupId>
|
||||||
<artifactId>halo</artifactId>
|
<artifactId>halo</artifactId>
|
||||||
<version>beta</version>
|
<version>0.0.1</version>
|
||||||
<name>halo</name>
|
<name>halo</name>
|
||||||
|
|
||||||
<description>
|
<description>
|
||||||
|
@ -133,75 +133,93 @@
|
||||||
<version>18.0</version>
|
<version>18.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
<profiles>
|
||||||
|
<!-- 生产环境打包配置 -->
|
||||||
|
<profile>
|
||||||
|
<id>prod</id>
|
||||||
|
<build>
|
||||||
|
<finalName>halo</finalName>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>src/main/java</directory>
|
||||||
|
<filtering>false</filtering>
|
||||||
|
<excludes>
|
||||||
|
<exclude>**/*.java</exclude>
|
||||||
|
</excludes>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
<plugins>
|
||||||
|
<!-- 跳过单元测试,不然打包的时候会因为加载不了application.yaml报错 -->
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<skip>true</skip>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
<build>
|
<plugin>
|
||||||
<finalName>halo</finalName>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<resources>
|
<configuration>
|
||||||
<resource>
|
<source>1.8</source>
|
||||||
<directory>src/main/java</directory>
|
<target>1.8</target>
|
||||||
<filtering>false</filtering>
|
<encoding>UTF-8</encoding>
|
||||||
<excludes>
|
</configuration>
|
||||||
<exclude>**/*.java</exclude>
|
</plugin>
|
||||||
</excludes>
|
|
||||||
</resource>
|
|
||||||
</resources>
|
|
||||||
<plugins>
|
|
||||||
<!-- 跳过单元测试,不然打包的时候会因为加载不了application.yaml报错 -->
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<skip>true</skip>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-assembly-plugin</artifactId>
|
||||||
<configuration>
|
<configuration>
|
||||||
<source>1.8</source>
|
<appendAssemblyId>false</appendAssemblyId>
|
||||||
<target>1.8</target>
|
<descriptors>
|
||||||
<encoding>UTF-8</encoding>
|
<descriptor>assembly.xml</descriptor>
|
||||||
</configuration>
|
</descriptors>
|
||||||
</plugin>
|
<outputDirectory>${project.build.directory}/dist/</outputDirectory>
|
||||||
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>make-assembly</id>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>single</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
<plugin>
|
<!-- 打包成jar文件,并指定lib文件夹以及resources资源文件夹 -->
|
||||||
<artifactId>maven-assembly-plugin</artifactId>
|
<plugin>
|
||||||
<configuration>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<appendAssemblyId>false</appendAssemblyId>
|
<artifactId>maven-jar-plugin</artifactId>
|
||||||
<descriptors>
|
<version>2.4</version>
|
||||||
<descriptor>assembly.xml</descriptor>
|
<configuration>
|
||||||
</descriptors>
|
<archive>
|
||||||
<outputDirectory>${project.build.directory}/dist/</outputDirectory>
|
<manifest>
|
||||||
</configuration>
|
<mainClass>cc.ryanc.halo.Application</mainClass>
|
||||||
<executions>
|
<classpathPrefix>lib/</classpathPrefix>
|
||||||
<execution>
|
<addClasspath>true</addClasspath>
|
||||||
<id>make-assembly</id>
|
</manifest>
|
||||||
<phase>package</phase>
|
<manifestEntries>
|
||||||
<goals>
|
<Class-Path>resources/</Class-Path>
|
||||||
<goal>single</goal>
|
</manifestEntries>
|
||||||
</goals>
|
</archive>
|
||||||
</execution>
|
</configuration>
|
||||||
</executions>
|
</plugin>
|
||||||
</plugin>
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</profile>
|
||||||
|
|
||||||
<!-- 打包成jar文件,并指定lib文件夹以及resources资源文件夹 -->
|
<!-- 开发环境 -->
|
||||||
<plugin>
|
<profile>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<id>dev</id>
|
||||||
<artifactId>maven-jar-plugin</artifactId>
|
<build>
|
||||||
<version>2.4</version>
|
<plugins>
|
||||||
<configuration>
|
<plugin>
|
||||||
<archive>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<manifest>
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
<mainClass>cc.ryanc.halo.Application</mainClass>
|
</plugin>
|
||||||
<classpathPrefix>lib/</classpathPrefix>
|
</plugins>
|
||||||
<addClasspath>true</addClasspath>
|
</build>
|
||||||
</manifest>
|
</profile>
|
||||||
<manifestEntries>
|
</profiles>
|
||||||
<Class-Path>resources/</Class-Path>
|
|
||||||
</manifestEntries>
|
|
||||||
</archive>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
</project>
|
</project>
|
||||||
|
|
Loading…
Reference in New Issue