正在显示
3 个修改的文件
包含
101 行增加
和
2 行删除
| @@ -31,4 +31,57 @@ | @@ -31,4 +31,57 @@ | ||
| 31 | <artifactId>lh-domain</artifactId> | 31 | <artifactId>lh-domain</artifactId> |
| 32 | </dependency> | 32 | </dependency> |
| 33 | </dependencies> | 33 | </dependencies> |
| 34 | + | ||
| 35 | + | ||
| 36 | + <build> | ||
| 37 | + <finalName>lh-admin</finalName> | ||
| 38 | + <plugins> | ||
| 39 | + <plugin> | ||
| 40 | + <groupId>org.apache.maven.plugins</groupId> | ||
| 41 | + <artifactId>maven-jar-plugin</artifactId> | ||
| 42 | + <version>2.4</version> | ||
| 43 | + <configuration> | ||
| 44 | + <archive> | ||
| 45 | + <!-- | ||
| 46 | + 生成的jar中,不要包含pom.xml和pom.properties这两个文件 | ||
| 47 | + --> | ||
| 48 | + <addMavenDescriptor>false</addMavenDescriptor> | ||
| 49 | + <manifest> | ||
| 50 | + <!-- | ||
| 51 | + 是否要把第三方jar放到manifest的classpath中 | ||
| 52 | + --> | ||
| 53 | + <addClasspath>true</addClasspath> | ||
| 54 | + | ||
| 55 | + <!-- | ||
| 56 | + 生成的manifest中classpath的前缀,因为要把第三方jar放到lib目录下,所以classpath的前缀是lib/ | ||
| 57 | + --> | ||
| 58 | + <classpathPrefix>lib/</classpathPrefix> | ||
| 59 | + <mainClass>com.zhonglai.luhui.admin.LhAdminApplication</mainClass> | ||
| 60 | + </manifest> | ||
| 61 | + </archive> | ||
| 62 | + </configuration> | ||
| 63 | + </plugin> | ||
| 64 | + | ||
| 65 | + <!-- The configuration of maven-assembly-plugin --> | ||
| 66 | + <plugin> | ||
| 67 | + <groupId>org.apache.maven.plugins</groupId> | ||
| 68 | + <artifactId>maven-assembly-plugin</artifactId> | ||
| 69 | + <version>2.4</version> | ||
| 70 | + <configuration> | ||
| 71 | + <descriptors> | ||
| 72 | + <descriptor>src/main/resources/package.xml</descriptor> | ||
| 73 | + </descriptors> | ||
| 74 | + </configuration> | ||
| 75 | + <executions> | ||
| 76 | + <execution> | ||
| 77 | + <id>make-assembly</id> | ||
| 78 | + <phase>package</phase> | ||
| 79 | + <goals> | ||
| 80 | + <goal>single</goal> | ||
| 81 | + </goals> | ||
| 82 | + </execution> | ||
| 83 | + </executions> | ||
| 84 | + </plugin> | ||
| 85 | + </plugins> | ||
| 86 | + </build> | ||
| 34 | </project> | 87 | </project> |
| 1 | package com.zhonglai.luhui.admin; | 1 | package com.zhonglai.luhui.admin; |
| 2 | 2 | ||
| 3 | -import com.ruoyi.RuoYiApplication; | ||
| 4 | import org.springframework.boot.SpringApplication; | 3 | import org.springframework.boot.SpringApplication; |
| 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; | 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| 6 | import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; | 5 | import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; |
| 7 | -import org.springframework.boot.builder.SpringApplicationBuilder; | ||
| 8 | import org.springframework.context.annotation.ComponentScan; | 6 | import org.springframework.context.annotation.ComponentScan; |
| 9 | 7 | ||
| 10 | @ComponentScan(basePackages = { | 8 | @ComponentScan(basePackages = { |
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | + | ||
| 3 | +<assembly> | ||
| 4 | + <id>bin</id> | ||
| 5 | + <!-- 最终打包成一个用于发布的zip文件 --> | ||
| 6 | + <formats> | ||
| 7 | + <format>zip</format> | ||
| 8 | + </formats> | ||
| 9 | + | ||
| 10 | + <fileSets> | ||
| 11 | + <!-- 把项目的配置文件,打包进zip文件的config目录 --> | ||
| 12 | + <fileSet> | ||
| 13 | + <directory>${project.basedir}/src/main/resources</directory> | ||
| 14 | + <outputDirectory>/configs</outputDirectory> | ||
| 15 | + <includes> | ||
| 16 | + <include>*.properties</include> | ||
| 17 | + </includes> | ||
| 18 | + </fileSet> | ||
| 19 | + | ||
| 20 | + <!-- 把项目的脚本文件目录( src/main/scripts )中的启动脚本文件,打包进zip文件的跟目录 --> | ||
| 21 | + <fileSet> | ||
| 22 | + <directory>${project.basedir}/bin</directory> | ||
| 23 | + <outputDirectory></outputDirectory> | ||
| 24 | + <fileMode>0777</fileMode> <!-- 所有文件文件权限为777 --> | ||
| 25 | + </fileSet> | ||
| 26 | + | ||
| 27 | + <!-- 把项目自己编译出来的jar文件,打包进zip文件的根目录 --> | ||
| 28 | + <fileSet> | ||
| 29 | + <directory>${project.build.directory}</directory> | ||
| 30 | + <outputDirectory></outputDirectory> | ||
| 31 | + <includes> | ||
| 32 | + <include>*.jar</include> | ||
| 33 | + </includes> | ||
| 34 | + </fileSet> | ||
| 35 | + </fileSets> | ||
| 36 | + | ||
| 37 | + <!-- Adds dependencies to zip package under lib directory --> | ||
| 38 | + <dependencySets> | ||
| 39 | + <dependencySet> | ||
| 40 | + <!-- | ||
| 41 | + 不使用项目的artifact,第三方jar不要解压,打包进zip文件的lib目录 | ||
| 42 | + --> | ||
| 43 | + <useProjectArtifact>false</useProjectArtifact> | ||
| 44 | + <outputDirectory>lib</outputDirectory> | ||
| 45 | + <unpack>false</unpack> | ||
| 46 | + </dependencySet> | ||
| 47 | + </dependencySets> | ||
| 48 | +</assembly> |
-
请 注册 或 登录 后发表评论