| | |
| | | |
| | | <properties> |
| | | <bladex.project.version>3.0.1.RELEASE</bladex.project.version> |
| | | |
| | | <java.version>1.8</java.version> |
| | | <maven.plugin.version>3.8.0</maven.plugin.version> |
| | | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
| | |
| | | <docker.password>Harbor12345</docker.password> |
| | | <docker.namespace>ubcs</docker.namespace> |
| | | <docker.plugin.version>1.4.13</docker.plugin.version> |
| | | <server.lib.path>../../target/libs</server.lib.path> |
| | | </properties> |
| | | |
| | | <modules> |
| | |
| | | <module>ubcs-plugin-api</module> |
| | | <module>ubcs-service</module> |
| | | <module>ubcs-service-api</module> |
| | | <!--<module>ubcs-codeApply</module>--> |
| | | </modules> |
| | | |
| | | <dependencyManagement> |
| | |
| | | <resources> |
| | | <resource> |
| | | <directory>src/main/resources</directory> |
| | | <excludes> |
| | | <!--<exclude>bootstrap.yml</exclude> |
| | | <exclude>application.yml</exclude> |
| | | <exclude>application-dev.yml</exclude> |
| | | <exclude>application-test.yml</exclude> |
| | | <exclude>application-prop.yml</exclude>--> |
| | | </excludes> |
| | | </resource> |
| | | <resource> |
| | | <directory>src/main/java</directory> |
| | |
| | | <plugin> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-maven-plugin</artifactId> |
| | | <version>${spring.boot.version}</version> |
| | | <version>${spring.boot.version}</version> <!-- 如果 spring.boot.version 版本修改,则这里也要跟着修改 --> |
| | | <configuration> |
| | | <fork>true</fork> |
| | | <finalName>${project.build.finalName}</finalName> |
| | | <!--解决windows命令行窗口中文乱码--> |
| | | <jvmArguments>-Dfile.encoding=UTF-8</jvmArguments> |
| | | <!-- 拆开依赖--> |
| | | <layout>ZIP</layout> |
| | | <outputDirectory>../../target</outputDirectory> |
| | | <includes> |
| | | <include> |
| | | <!-- 排除所有Jar --> |
| | | <groupId>nothing</groupId> |
| | | <artifactId>nothing</artifactId> |
| | | </include> |
| | | </includes> |
| | | </configuration> |
| | | <executions> |
| | | <execution> |
| | | <goals> |
| | | <goal>repackage</goal> |
| | | <goal>repackage</goal> <!-- 将引入的 jar 打入其中 --> |
| | | </goals> |
| | | </execution> |
| | | </executions> |
| | | </plugin> |
| | | <plugin> |
| | | <groupId>com.spotify</groupId> |
| | | <artifactId>dockerfile-maven-plugin</artifactId> |
| | | <version>${docker.plugin.version}</version> |
| | | <configuration> |
| | | <username>${docker.username}</username> |
| | | <password>${docker.password}</password> |
| | | <repository>${docker.registry.url}/${docker.namespace}/${project.artifactId}</repository> |
| | | <tag>${project.version}</tag> |
| | | <useMavenSettingsForAuth>true</useMavenSettingsForAuth> |
| | | <buildArgs> |
| | | <JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE> |
| | | </buildArgs> |
| | | </configuration> |
| | | <!--子服务添加如下配置,运行 mvn deploy 命令便会自动打包镜像--> |
| | | <!--<executions> |
| | | <execution> |
| | | <id>default</id> |
| | | <goals> |
| | | <goal>build</goal> |
| | | <goal>push</goal> |
| | | </goals> |
| | | </execution> |
| | | </executions>--> |
| | | </plugin> |
| | | <!--此插件用于将依赖包抽出--> |
| | | <plugin> |
| | | <groupId>org.apache.maven.plugins</groupId> |
| | | <artifactId>maven-antrun-plugin</artifactId> |
| | | <artifactId>maven-dependency-plugin</artifactId> |
| | | <executions> |
| | | <execution> |
| | | <id>copy-dependencies</id> |
| | | <phase>package</phase> |
| | | <goals> |
| | | <goal>run</goal> |
| | | <goal>copy-dependencies</goal> |
| | | </goals> |
| | | <configuration> |
| | | <tasks> |
| | | <!--suppress UnresolvedMavenProperty --> |
| | | <copy overwrite="true" |
| | | tofile="${session.executionRootDirectory}/target/${project.artifactId}.jar" |
| | | file="${project.build.directory}/${project.artifactId}.jar" /> |
| | | </tasks> |
| | | <outputDirectory>${server.lib.path}</outputDirectory> |
| | | <excludeTransitive>false</excludeTransitive> |
| | | <stripVersion>false</stripVersion> |
| | | <includeScope>runtime</includeScope> |
| | | </configuration> |
| | | </execution> |
| | | </executions> |
| | | </plugin> |
| | | <plugin> |
| | | <artifactId>maven-surefire-plugin</artifactId> |
| | | <configuration> |
| | | <skip>true</skip> |
| | | </configuration> |
| | | </plugin> |
| | | <plugin> |
| | | <artifactId>maven-compiler-plugin</artifactId> |
| | | <version>${maven.plugin.version}</version> |
| | | <configuration> |
| | | <source>${java.version}</source> |
| | | <target>${java.version}</target> |
| | | <encoding>UTF-8</encoding> |
| | | <compilerArgs> |
| | | <arg>-parameters</arg> |
| | | </compilerArgs> |
| | | </configuration> |
| | | </plugin> |
| | | <!-- 基于maven-jar-plugin插件实现把依赖jar定义写入输出jar的META-INFO/MANIFEST文件 --> |
| | | <plugin> |
| | | <groupId>org.apache.maven.plugins</groupId> |
| | | <artifactId>maven-jar-plugin</artifactId> |
| | | <configuration> |
| | | <archive> |
| | | <manifest> |
| | | <addClasspath>true</addClasspath> |
| | | <!--<classpathPrefix>./libs</classpathPrefix>--> |
| | | <classpathPrefix>/data1/ubcs/ubcs-server/libs</classpathPrefix> |
| | | <useUniqueVersions>false</useUniqueVersions> |
| | | </manifest> |
| | | </archive> |
| | | <excludes> |
| | | <exclude>application-dev.yml</exclude> |
| | | <exclude>application-prod.yml</exclude> |
| | | <exclude>application.yml</exclude> |
| | | <exclude>lib/*</exclude> |
| | | </excludes> |
| | | </configuration> |
| | | </plugin> |
| | | </plugins> |
| | | </pluginManagement> |
| | | <plugins> |
| | | <plugin> |
| | | <groupId>com.spotify</groupId> |
| | | <artifactId>dockerfile-maven-plugin</artifactId> |
| | | <configuration> |
| | | <skip>true</skip> |
| | | </configuration> |
| | | </plugin> |
| | | <plugin> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-maven-plugin</artifactId> |
| | | </plugin> |
| | | <plugin> |
| | | <artifactId>maven-compiler-plugin</artifactId> |
| | | <version>${maven.plugin.version}</version> |
| | | <configuration> |
| | | <source>${java.version}</source> |
| | | <target>${java.version}</target> |
| | | <encoding>UTF-8</encoding> |
| | | <compilerArgs> |
| | | <arg>-parameters</arg> |
| | | </compilerArgs> |
| | | </configuration> |
| | | </plugin> |
| | | </plugins> |
| | | </build> |
| | | |
| | | <repositories> |