Skip to content

Commit

Permalink
Maven packaging profiles.
Browse files Browse the repository at this point in the history
Fixed line endings for distribution packages.
Dependencies updated.
  • Loading branch information
kausandr committed Jul 31, 2019
1 parent 9d976fd commit 3f3f9e6
Show file tree
Hide file tree
Showing 7 changed files with 171 additions and 28 deletions.
67 changes: 55 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<product.vendor>jKool, LLC</product.vendor>

<project.java.version>1.7</project.java.version>
<project.java.version>1.8</project.java.version>
<java.source.version>${project.java.version}</java.source.version>
<java.target.version>${project.java.version}</java.target.version>
<java.compiler.version>${project.java.version}</java.compiler.version>
Expand All @@ -54,10 +54,16 @@
<release.deploy.dir>../build/${release.deploy.name}</release.deploy.dir>
<release.deploy.finalName>${release.deploy.name}-${project.version}</release.deploy.finalName>
<release.deploy.zip.assembly>src/assembly/zipDeployAssembly.xml</release.deploy.zip.assembly>
<release.deploy.gz.assembly>src/assembly/gzDeployAssembly.xml</release.deploy.gz.assembly>
<release.deploy.dir.assembly>src/assembly/dirDeployAssembly.xml</release.deploy.dir.assembly>

<skipTests>true</skipTests>
<gpg.skip.sign>true</gpg.skip.sign>
<assembly.line.endings>unix</assembly.line.endings>

<skip.source.pack>true</skip.source.pack>
<skip.javadoc.pack>true</skip.javadoc.pack>
<skip.assembly.pack>true</skip.assembly.pack>
<skip.gpg.sign>true</skip.gpg.sign>

<build.assemblies.attach>false</build.assemblies.attach>
</properties>

Expand Down Expand Up @@ -102,7 +108,7 @@
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-client</artifactId>
<version>3.0.26.Final</version>
<version>4.1.1.Final</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.swagger/swagger-annotations -->
<dependency>
Expand All @@ -123,13 +129,42 @@
</dependency>
</dependencies>

<profiles>
<profile>
<id>win-ln</id>
<activation>
<os>
<family>windows</family>
</os>
</activation>
<properties>
<assembly.line.endings>crlf</assembly.line.endings>
</properties>
</profile>

<profile>
<id>pack-bin</id>
<properties>
<skip.assembly.pack>false</skip.assembly.pack>
</properties>
</profile>
<profile>
<id>pack-all</id>
<properties>
<skip.source.pack>false</skip.source.pack>
<skip.javadoc.pack>false</skip.javadoc.pack>
<skip.assembly.pack>false</skip.assembly.pack>
</properties>
</profile>
</profiles>

<build>
<defaultGoal>clean install</defaultGoal>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<version>3.8.1</version>
<configuration>
<verbose>${java.compiler.verbose}</verbose>
<compilerVersion>${java.compiler.version}</compilerVersion>
Expand All @@ -142,7 +177,10 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
<version>3.1.0</version>
<configuration>
<skipSource>${skip.source.pack}</skipSource>
</configuration>
<executions>
<execution>
<id>attach-sources</id>
Expand All @@ -159,10 +197,11 @@
<configuration>
<failOnError>false</failOnError>
<doclint>all</doclint>
<skip>${skip.javadoc.pack}</skip>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<id>build-javadocs-module</id>
<goals>
<goal>jar</goal>
</goals>
Expand All @@ -173,6 +212,9 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<skipAssembly>${skip.assembly.pack}</skipAssembly>
</configuration>
<executions>
<execution>
<id>deploy-assembly</id>
Expand All @@ -185,6 +227,7 @@
<descriptors>
<descriptor>${release.deploy.dir.assembly}</descriptor>
<descriptor>${release.deploy.zip.assembly}</descriptor>
<descriptor>${release.deploy.gz.assembly}</descriptor>
</descriptors>
<attach>${build.assemblies.attach}</attach>
<outputDirectory>${release.deploy.dir}</outputDirectory>
Expand All @@ -209,7 +252,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.0</version>
<version>3.1.2</version>
<configuration>
<archive>
<!--<index>true</index>-->
Expand All @@ -229,16 +272,16 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<configuration>
<skip>${skip.gpg.sign}</skip>
</configuration>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
<configuration>
<skip>${gpg.skip.sign}</skip>
</configuration>
</execution>
</executions>
</plugin>
Expand All @@ -249,4 +292,4 @@
</plugin>
</plugins>
</build>
</project>
</project>
42 changes: 42 additions & 0 deletions src/assembly/deployComponentDir.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<component xmlns="http://maven.apache.org/ASSEMBLY-COMPONENT/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY-COMPONENT/2.0.0 http://maven.apache.org/xsd/assembly-component-2.0.0.xsd">
<dependencySets>
<dependencySet>
<useProjectArtifact>false</useProjectArtifact>
<useTransitiveDependencies>true</useTransitiveDependencies>
<outputDirectory>lib</outputDirectory>
<unpack>false</unpack>
</dependencySet>
</dependencySets>

<fileSets>
<!-- user defined property files -->
<fileSet>
<directory>.</directory>
<includes>
<include>cmd.properties</include>
</includes>
<outputDirectory></outputDirectory>
<lineEnding>${assembly.line.endings}</lineEnding>
</fileSet>
<!-- static content -->
<fileSet>
<directory>.</directory>
<includes>
<include>README*</include>
<include>LICENSE*</include>
<include>NOTICE*</include>
</includes>
<outputDirectory></outputDirectory>
<lineEnding>${assembly.line.endings}</lineEnding>
</fileSet>
<fileSet>
<directory>${project.build.directory}</directory>
<includes>
<include>*.jar</include>
</includes>
<outputDirectory></outputDirectory>
</fileSet>
</fileSets>
</component>
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<component xmlns="http://maven.apache.org/ASSEMBLY-COMPONENT/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY-COMPONENT/2.0.0 http://maven.apache.org/xsd/assembly-component-2.0.0.xsd">
<dependencySets>
<dependencySet>
<useProjectArtifact>false</useProjectArtifact>
<useTransitiveDependencies>true</useTransitiveDependencies>
<outputDirectory>lib</outputDirectory>
<unpack>false</unpack>
</dependencySet>
</dependencySets>

<fileSets>
<!-- user defined property files -->
<fileSet>
Expand All @@ -9,16 +18,18 @@
<include>cmd.properties</include>
</includes>
<outputDirectory></outputDirectory>
<lineEnding>unix</lineEnding>
</fileSet>
<!-- static content -->
<fileSet>
<directory>.</directory>
<includes>
<include>LICENSE*</include>
<include>README*</include>
<include>LICENSE*</include>
<include>NOTICE*</include>
</includes>
<outputDirectory></outputDirectory>
<lineEnding>unix</lineEnding>
</fileSet>
<fileSet>
<directory>${project.build.directory}</directory>
Expand All @@ -28,12 +39,4 @@
<outputDirectory></outputDirectory>
</fileSet>
</fileSets>
<dependencySets>
<dependencySet>
<useProjectArtifact>false</useProjectArtifact>
<useTransitiveDependencies>true</useTransitiveDependencies>
<outputDirectory>lib</outputDirectory>
<unpack>false</unpack>
</dependencySet>
</dependencySets>
</component>
42 changes: 42 additions & 0 deletions src/assembly/deployComponentWin.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<component xmlns="http://maven.apache.org/ASSEMBLY-COMPONENT/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY-COMPONENT/2.0.0 http://maven.apache.org/xsd/assembly-component-2.0.0.xsd">
<dependencySets>
<dependencySet>
<useProjectArtifact>false</useProjectArtifact>
<useTransitiveDependencies>true</useTransitiveDependencies>
<outputDirectory>lib</outputDirectory>
<unpack>false</unpack>
</dependencySet>
</dependencySets>

<fileSets>
<!-- user defined property files -->
<fileSet>
<directory>.</directory>
<includes>
<include>cmd.properties</include>
</includes>
<outputDirectory></outputDirectory>
<lineEnding>crlf</lineEnding>
</fileSet>
<!-- static content -->
<fileSet>
<directory>.</directory>
<includes>
<include>README*</include>
<include>LICENSE*</include>
<include>NOTICE*</include>
</includes>
<outputDirectory></outputDirectory>
<lineEnding>${assembly.line.endings}</lineEnding>
</fileSet>
<fileSet>
<directory>crlf</directory>
<includes>
<include>*.jar</include>
</includes>
<outputDirectory></outputDirectory>
</fileSet>
</fileSets>
</component>
6 changes: 3 additions & 3 deletions src/assembly/dirDeployAssembly.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
<id>${project.build.finalName}-dir_deploy</id>
<formats>
<format>dir</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<baseDirectory>${release.deploy.finalName}</baseDirectory>
<componentDescriptors>
<componentDescriptor>src/assembly/deployComponent.xml</componentDescriptor>
<componentDescriptor>src/assembly/deployComponentDir.xml</componentDescriptor>
</componentDescriptors>
</assembly>
14 changes: 14 additions & 0 deletions src/assembly/gzDeployAssembly.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
<id>${project.build.finalName}-gz_deploy</id>
<formats>
<format>tar.gz</format>
</formats>
<includeBaseDirectory>true</includeBaseDirectory>
<baseDirectory>${release.deploy.finalName}</baseDirectory>
<componentDescriptors>
<componentDescriptor>src/assembly/deployComponentUnix.xml</componentDescriptor>
</componentDescriptors>
</assembly>
7 changes: 3 additions & 4 deletions src/assembly/zipDeployAssembly.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
<id>${project.build.finalName}-zip_deploy</id>
<formats>
<format>zip</format>
<format>tar.gz</format>
</formats>
<includeBaseDirectory>true</includeBaseDirectory>
<baseDirectory>${release.deploy.finalName}</baseDirectory>
<componentDescriptors>
<componentDescriptor>src/assembly/deployComponent.xml</componentDescriptor>
<componentDescriptor>src/assembly/deployComponentWin.xml</componentDescriptor>
</componentDescriptors>
</assembly>

0 comments on commit 3f3f9e6

Please sign in to comment.