Skip to content

Commit

Permalink
build: Add flatten-maven-plugin (#1000)
Browse files Browse the repository at this point in the history
* build: Add flatten-maven-plugin

Signed-off-by: unknowIfGuestInDream <[email protected]>

* build: Add exec-maven-plugin

Signed-off-by: unknowIfGuestInDream <[email protected]>

* build: Add maven.deploy.skip

Signed-off-by: unknowIfGuestInDream <[email protected]>

* build: Add maven-resources-plugin

Signed-off-by: unknowIfGuestInDream <[email protected]>

---------

Signed-off-by: unknowIfGuestInDream <[email protected]>
  • Loading branch information
unknowIfGuestInDream authored Dec 16, 2023
1 parent 2beef2c commit 3ccd563
Show file tree
Hide file tree
Showing 11 changed files with 154 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ data/
out/
qodana.sarif.json
**/integration-test-screenshots/**
.flattened-pom.xml

### NetBeans ###
/nbproject/private/
Expand Down
8 changes: 7 additions & 1 deletion cg/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2023 unknowIfGuestInDream
~ Copyright (c) 2023 unknowIfGuestInDream.
~ All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -40,9 +40,11 @@
<name>javafxTool-cg</name>
<packaging>jar</packaging>
<description>cg开发工具组件</description>
<url>https://javafxtool.tlcsdm.com</url>

<properties>
<maven.install.skip>true</maven.install.skip>
<maven.deploy.skip>true</maven.deploy.skip>
</properties>

<dependencies>
Expand Down Expand Up @@ -132,6 +134,10 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>license-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
Expand Down
3 changes: 2 additions & 1 deletion common/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2023 unknowIfGuestInDream
~ Copyright (c) 2023 unknowIfGuestInDream.
~ All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -40,6 +40,7 @@
<name>javafxTool-common</name>
<packaging>jar</packaging>
<description>common组件</description>
<url>https://javafxtool.tlcsdm.com</url>

<dependencies>
<dependency>
Expand Down
1 change: 1 addition & 0 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
<name>javafxTool-core</name>
<packaging>jar</packaging>
<description>javafxTool 核心组件</description>
<url>https://javafxtool.tlcsdm.com</url>

<dependencies>
<dependency>
Expand Down
60 changes: 60 additions & 0 deletions demo/pom.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2023 unknowIfGuestInDream.
~ All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
~ modification, are permitted provided that the following conditions are met:
~ * Redistributions of source code must retain the above copyright
~ notice, this list of conditions and the following disclaimer.
~ * Redistributions in binary form must reproduce the above copyright
~ notice, this list of conditions and the following disclaimer in the
~ documentation and/or other materials provided with the distribution.
~ * Neither the name of unknowIfGuestInDream, any associated website, nor the
~ names of its contributors may be used to endorse or promote products
~ derived from this software without specific prior written permission.
~
~ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
~ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
~ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
~ DISCLAIMED. IN NO EVENT SHALL UNKNOWIFGUESTINDREAM BE LIABLE FOR ANY
~ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
~ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
~ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
~ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
~ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
~ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->

<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
Expand All @@ -15,6 +42,7 @@

<properties>
<maven.install.skip>true</maven.install.skip>
<maven.deploy.skip>true</maven.deploy.skip>
</properties>

<dependencies>
Expand All @@ -33,7 +61,39 @@
</dependencies>

<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>com.tlcsdm.demo.ControlsFXSampler</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<!-- 绑定生命周期 -->
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<!-- 设置依赖的存放路径 -->
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<includeScope>runtime</includeScope>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
Expand Down
3 changes: 2 additions & 1 deletion frame/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2023 unknowIfGuestInDream
~ Copyright (c) 2023 unknowIfGuestInDream.
~ All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -40,6 +40,7 @@
<name>javafxTool-frame</name>
<packaging>jar</packaging>
<description>javafx 基本框架</description>
<url>https://javafxtool.tlcsdm.com</url>

<dependencies>
<dependency>
Expand Down
4 changes: 2 additions & 2 deletions jenkins/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ $M2_HOME/bin/mvn -f pom.xml -s $M2_HOME/conf/settings.xml clean

for mod in smc qe cg
do
$M2_HOME/bin/mvn -f ${mod}/pom.xml -s $M2_HOME/conf/settings.xml -Djavafx.platform=win -Dmaven.test.skip=true -Dlicense.skipDownloadLicenses=true package
$M2_HOME/bin/mvn -f ${mod}/pom.xml -s $M2_HOME/conf/settings.xml -Djavafx.platform=win -Dmaven.test.skip=true package
cp ${mod}/target/javafxTool-${mod}.jar javafxTool-${mod}.jar
cp -r ${mod}/target/lib lib
cp -r ${mod}/target/apidocs apidocs
Expand All @@ -52,7 +52,7 @@ $M2_HOME/bin/mvn -f pom.xml -s $M2_HOME/conf/settings.xml -Djavafx.platform=mac
$M2_HOME/bin/mvn -f pom.xml -s $M2_HOME/conf/settings.xml clean
for mod in smc qe cg
do
$M2_HOME/bin/mvn -f ${mod}/pom.xml -s $M2_HOME/conf/settings.xml -Djavafx.platform=mac -Dmaven.test.skip=true -Dlicense.skipDownloadLicenses=true package
$M2_HOME/bin/mvn -f ${mod}/pom.xml -s $M2_HOME/conf/settings.xml -Djavafx.platform=mac -Dmaven.test.skip=true package
cp ${mod}/target/javafxTool-${mod}.jar javafxTool-${mod}.jar
cp -r ${mod}/target/lib lib
cp -r ${mod}/target/apidocs apidocs
Expand Down
3 changes: 2 additions & 1 deletion login/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2023 unknowIfGuestInDream
~ Copyright (c) 2023 unknowIfGuestInDream.
~ All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -40,6 +40,7 @@
<name>javafxTool-login</name>
<packaging>jar</packaging>
<description>javafxTool登录框架</description>
<url>https://javafxtool.tlcsdm.com</url>

<dependencies>
<dependency>
Expand Down
71 changes: 69 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,14 @@
<maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
<maven-source-plugin.version>3.3.0</maven-source-plugin.version>
<maven-dependency-plugin.version>3.6.1</maven-dependency-plugin.version>
<maven-resources-plugin.version>3.3.1</maven-resources-plugin.version>
<maven-help-plugin.version>3.4.0</maven-help-plugin.version>
<maven-assembly-plugin.version>3.6.0</maven-assembly-plugin.version>
<license-maven-plugin.version>2.3.0</license-maven-plugin.version>
<maven.wagon.http.ssl.insecure>true</maven.wagon.http.ssl.insecure>
<maven.wagon.http.ssl.allowall>true</maven.wagon.http.ssl.allowall>
<flatten-maven-plugin.version>1.5.0</flatten-maven-plugin.version>
<exec-maven-plugin.version>3.1.1</exec-maven-plugin.version>
<lifecycle-mapping.version>1.0.0</lifecycle-mapping.version>
<nexus-staging-maven-plugin.version>1.6.13</nexus-staging-maven-plugin.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down Expand Up @@ -870,6 +873,32 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>${maven-resources-plugin.version}</version>
<executions>
<execution>
<id>copy-licence</id>
<phase>process-sources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/license</outputDirectory>
<resources>
<resource>
<directory>${basedir}/../</directory>
<includes>
<include>LICENSE</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
Expand Down Expand Up @@ -899,6 +928,34 @@
<artifactId>maven-help-plugin</artifactId>
<version>${maven-help-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<version>${flatten-maven-plugin.version}</version>
<configuration>
<flattenMode>oss</flattenMode>
<pomElements>
<url>keep</url>
<scm>flatten</scm>
</pomElements>
</configuration>
<executions>
<execution>
<id>flatten</id>
<phase>process-resources</phase>
<goals>
<goal>flatten</goal>
</goals>
</execution>
<execution>
<id>flatten.clean</id>
<phase>clean</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<pluginManagement>
<plugins>
Expand Down Expand Up @@ -957,7 +1014,9 @@
<configuration>
<licensesOutputDirectory>${project.build.directory}/generated-resources/licenses
</licensesOutputDirectory>
<licensesOutputFile>${project.build.directory}/license/licenses.xml</licensesOutputFile>
<cleanLicensesOutputDirectory>true</cleanLicensesOutputDirectory>
<offline>true</offline>
</configuration>
</execution>
<execution>
Expand All @@ -967,8 +1026,8 @@
<goal>add-third-party</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/generated-sources/license</outputDirectory>
<thirdPartyFilename>THIRD-PARTY.txt</thirdPartyFilename>
<outputDirectory>${project.build.directory}/license</outputDirectory>
<thirdPartyFilename>third-party.txt</thirdPartyFilename>
<force>true</force>
<licenseMerges>
<licenseMerge>Apache 2.0|The Apache Software License, Version 2.0
Expand All @@ -985,9 +1044,17 @@
<goals>
<goal>third-party-report</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/license/third-party</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>${exec-maven-plugin.version}</version>
</plugin>
</plugins>
</pluginManagement>
</build>
Expand Down
6 changes: 6 additions & 0 deletions qe/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,11 @@
<name>javafxTool-qe</name>
<packaging>jar</packaging>
<description>qe开发工具组件</description>
<url>https://javafxtool.tlcsdm.com</url>

<properties>
<maven.install.skip>true</maven.install.skip>
<maven.deploy.skip>true</maven.deploy.skip>
</properties>

<dependencies>
Expand Down Expand Up @@ -160,6 +162,10 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>license-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
Expand Down
2 changes: 2 additions & 0 deletions smc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,11 @@
<name>javafxTool-smc</name>
<packaging>jar</packaging>
<description>smc开发工具组件</description>
<url>https://javafxtool.tlcsdm.com</url>

<properties>
<maven.install.skip>true</maven.install.skip>
<maven.deploy.skip>true</maven.deploy.skip>
</properties>

<dependencies>
Expand Down

0 comments on commit 3ccd563

Please sign in to comment.