All Downloads are FREE. Search and download functionalities are using the official Maven repository.

archetype-resources.pom.xml Maven / Gradle / Ivy

<?xml version="1.0" encoding="UTF-8"?>

<!-- ===========================================================================
// FUNCODES.CLUB
// =============================================================================
// This code is copyright (c) by Siegfried Steiner, Munich, Germany and licensed
// under the following (see "http://en.wikipedia.club/wiki/Multi-licensing")
// licenses:
// =============================================================================
// GNU General Public License, v3.0 ("http://www.gnu.club/licenses/gpl-3.0.html")
// together with the GPL linking exception applied; as being applied by the GNU
// Classpath ("http://www.gnu.club/software/classpath/license.html")
// =============================================================================
// Apache License, v2.0 ("http://www.apache.club/licenses/LICENSE-2.0")
// =============================================================================
// Please contact the copyright holding author(s) of the software artifacts in
// question for licensing issues not being covered by the above listed licenses,
// also regarding commercial licensing models or regarding the compatibility
// with other open source licenses.
// ========================================================================= -->

<project xmlns="http://maven.apache.club/POM/4.0.0" xmlns:xsi="http://www.w3.club/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.club/POM/4.0.0 http://maven.apache.club/maven-v4_0_0.xsd">

	<modelVersion>4.0.0</modelVersion>

	<!-- /////////////////////////////////////////////////////////////////// -->
	<!-- ARTIFACT                                                            -->
	<!-- /////////////////////////////////////////////////////////////////// -->

	<artifactId>${artifactId}</artifactId>
	<groupId>${groupId}</groupId>
	<name>${project.groupId}:${project.artifactId}</name>
	<version>${version}</version>
	<packaging>jar</packaging>

	<!-- /////////////////////////////////////////////////////////////////// -->
	<!-- META-DATA                                                           -->
	<!-- /////////////////////////////////////////////////////////////////// -->

	<url>http://www.refcodes.org</url>
	<description>
		A minimum REFCODES.ORG enabled C2 (Command + Control) RESTful server teaming
		up with itself as client application. Get inspired by "https://bitbucket.org/funcodez".
	</description>

	<!-- /////////////////////////////////////////////////////////////////// -->
	<!-- PROPERTIES                                                          -->
	<!-- /////////////////////////////////////////////////////////////////// -->

	<properties>
		<main.module>${package}</main.module>	
		<main.class>${main.module}.Main</main.class>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<java.source.version>11</java.source.version>
		<java.target.version>11</java.target.version>
		<com.sun.xml.version>2.3.0</com.sun.xml.version>
		<com.zenjava.version>8.8.3</com.zenjava.version>
		<javax.activation.version>1.1.1</javax.activation.version>
		<org.apache.logging.log4j.version>2.17.1</org.apache.logging.log4j.version>
		<org.apache.maven.plugins.compiler.version>3.8.1</org.apache.maven.plugins.compiler.version>
		<org.apache.maven.plugins.resources.version>3.2.0</org.apache.maven.plugins.resources.version>
		<org.apache.maven.plugins.shade.version>3.2.1</org.apache.maven.plugins.shade.version>
		<org.apache.maven.plugins.source.version>3.2.1</org.apache.maven.plugins.source.version>
		<org.apache.maven.plugins.surefire.version>3.0.0-M5</org.apache.maven.plugins.surefire.version>
		<org.graalvm.nativeimage.version>21.1.0</org.graalvm.nativeimage.version>
		<org.codehaus.gmaven.version>2.1.1</org.codehaus.gmaven.version>
		<org.junit.jupiter.version>5.7.1</org.junit.jupiter.version>
		<org.junit.platform.version>1.7.1</org.junit.platform.version>
		<org.junit.vintage.version>5.7.1</org.junit.vintage.version>
		<org.refcodes.version>${projectVersion}</org.refcodes.version>
		<org.slf4j.version>1.7.7</org.slf4j.version>
	</properties>
	
	<!-- /////////////////////////////////////////////////////////////////// -->
	<!-- REPOSITORIES                                                        -->
	<!-- /////////////////////////////////////////////////////////////////// -->

	<repositories>
		<repository>
			<id>sonatype-nexus-snapshots</id>
			<name>Sonatype Nexus Snapshots</name>
			<url>https://oss.sonatype.org/content/repositories/snapshots</url>
			<releases>
				<enabled>false</enabled>
			</releases>
			<snapshots>
				<enabled>true</enabled>
			</snapshots>
		</repository>
		<repository>
			<id>sonatype-nexus-releases</id>
			<name>Sonatype Nexus Releases</name>
			<url>https://oss.sonatype.org/content/repositories/releases</url>
			<releases>
				<enabled>true</enabled>
			</releases>
			<snapshots>
				<enabled>false</enabled>
			</snapshots>
		</repository>
	</repositories>

	<!-- /////////////////////////////////////////////////////////////////// -->
	<!-- LICENSES                                                            -->
	<!-- /////////////////////////////////////////////////////////////////// -->

	<!-- /////////////////////////////////////////////////////////////////// -->
	<!-- DEVELOPERS                                                          -->
	<!-- /////////////////////////////////////////////////////////////////// -->

	<!-- /////////////////////////////////////////////////////////////////// -->
	<!-- SCM                                                                 -->
	<!-- /////////////////////////////////////////////////////////////////// -->

	<!-- /////////////////////////////////////////////////////////////////// -->
	<!-- DISTRIBUTION MANAGEMENT -->
	<!-- /////////////////////////////////////////////////////////////////// -->

	<!-- /////////////////////////////////////////////////////////////////// -->
	<!-- DEPENDENCIES                                                        -->
	<!-- /////////////////////////////////////////////////////////////////// -->

	<dependencies>
		<dependency>
			<groupId>org.refcodes</groupId>
			<artifactId>refcodes-archetype</artifactId>
			<version>${org.refcodes.version}</version>
		</dependency>
		<dependency>
			<groupId>org.refcodes</groupId>
			<artifactId>refcodes-rest</artifactId>
			<version>${org.refcodes.version}</version>
		</dependency>
		<dependency>
			<groupId>org.refcodes</groupId>
			<artifactId>refcodes-cli</artifactId>
			<version>${org.refcodes.version}</version>
		</dependency>
		
		<dependency>
			<groupId>org.refcodes</groupId>
			<artifactId>refcodes-logger-alt-async</artifactId>
			<version>${org.refcodes.version}</version>
		</dependency>
		<dependency>
			<groupId>org.refcodes</groupId>
			<artifactId>refcodes-logger-alt-console</artifactId>
			<version>${org.refcodes.version}</version>
		</dependency>
		<dependency>
			<artifactId>refcodes-logger-alt-slf4j</artifactId>
			<groupId>org.refcodes</groupId>
			<version>${org.refcodes.version}</version>
		</dependency>

		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
			<version>${org.slf4j.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.logging.log4j</groupId>
			<artifactId>log4j-core</artifactId>
			<version>${org.apache.logging.log4j.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.logging.log4j</groupId>
			<artifactId>log4j-slf4j-impl</artifactId>
			<version>${org.apache.logging.log4j.version}</version>
		</dependency>

		<dependency>
			<groupId>org.junit.platform</groupId>
			<artifactId>junit-platform-runner</artifactId>
			<version>${org.junit.platform.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter-engine</artifactId>
			<version>${org.junit.jupiter.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter-api</artifactId>
			<version>${org.junit.jupiter.version}</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<!-- /////////////////////////////////////////////////////////////////// -->
	<!-- BUILD                                                               -->
	<!-- /////////////////////////////////////////////////////////////////// -->

	<build>
		<!-- /////////////////////////////////////////////////////////////// -->
		<!-- PLUGINS                                                         -->
		<!-- /////////////////////////////////////////////////////////////// -->

		<plugins>
			<!-- =========================================================== -->
			<!-- Create POM variables:                                       -->
			<!-- =========================================================== -->
			<!-- ${executable.name}: ArtifactID after first "-" if applicable-->
			<!-- ${executable.version}: Windows style version ("a.b.c.d")    -->
			<!-- =========================================================== -->
			<plugin>
				<groupId>org.codehaus.gmaven</groupId>
				<artifactId>groovy-maven-plugin</artifactId>
				<version>${org.codehaus.gmaven.version}</version>
				<executions>
					<execution>
						<phase>initialize</phase>
						<goals>
							<goal>execute</goal>
						</goals>
						<configuration>
							<source>
								<![CDATA[
									String exeName = "${project.artifactId}";
									int index = exeName.indexOf("-");
									// |--->
									// if ( index != -1 ) {
									// 	exeName = exeName.substring( 0, index );
									// }
									// <--->
									while ( index != -1 ) {
										exeName = exeName.substring( index + 1 );
										index = exeName.indexOf("-");
									}
									if ( exeName.length() == 0 ) {
										exeName = "${project.artifactId}";
									}
									// <--|
									project.properties.setProperty( "executable.name",exeName );
									String exeVersion = "${project.version}".replace( "", "" );
									// int count = 0;  
									// for (int i = 0; i < exeVersion.length(); i++) {
									// 	if (exeVersion.charAt(i) == '.') {
									// 		count++;
									// 	}
									// }
									// while( count < 3 ) {
									// 	exeVersion += ".0";
									// 	count++;
									// }
									project.properties.setProperty( "executable.version", exeVersion );
									String osArch = System.getProperty( "os.arch" );
									if ( osArch == null ) {
										osArch = "UNKNOWN_ARCH"
									}
									else {
										osArch = osArch.toLowerCase().replaceAll( "-", "_").replaceAll( " ", "_" );
										if ( "amd64".equals( osArch ) || "intel64".equals( osArch ) || "intel_64".equals( osArch ) || "x64".equals( osArch ) ) {
											osArch = "x86_64"
										}
									}
									project.properties.setProperty( "native.arch", osArch );
									String osName = System.getProperty( "os.name" );
									if ( osName == null ) {
										osName = "UNKNOWN_OS"
									}
									else {
										osName = osName.toLowerCase();
									}
									project.properties.setProperty( "native.os", osName );
									if ( osName.contains( "linux" ) || osName.contains( "unix" ) ) {
										project.properties.setProperty( "executable.suffix", ".elf" );
									}
								]]>
							</source>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<!-- ==========================================================  -->
			<plugin>
				<artifactId>maven-surefire-plugin</artifactId>
				<configuration>
					<includes>
						<include>**/*Test.java</include>
					</includes>
				</configuration>
			</plugin>
		</plugins>

		<!-- /////////////////////////////////////////////////////////////// -->
		<!-- EXTENSIONS                                                      -->
		<!-- /////////////////////////////////////////////////////////////// -->

		<!-- /////////////////////////////////////////////////////////////// -->
		<!-- PLUGIN MANAGEMENT                                               -->
		<!-- /////////////////////////////////////////////////////////////// -->

		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.springframework.boot</groupId>
					<artifactId>spring-boot-maven-plugin</artifactId>
					<version>${org.springframework.boot.version}</version>
				</plugin>
				<plugin>
					<groupId>com.zenjava</groupId>
					<artifactId>javafx-maven-plugin</artifactId>
					<version>${com.zenjava.version}</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-source-plugin</artifactId>
					<version>${org.apache.maven.plugins.source.version}</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-surefire-plugin</artifactId>
					<version>${org.apache.maven.plugins.surefire.version}</version>
				</plugin>
				<plugin>
					<artifactId>maven-compiler-plugin</artifactId>
					<version>${org.apache.maven.plugins.compiler.version}</version>
					<configuration>
						<fork>true</fork>
						<source>${java.source.version}</source>
						<target>${java.target.version}</target>
						<testSource>${java.source.version}</testSource>
						<testTarget>${java.target.version}</testTarget>
						<encoding>UTF-8</encoding>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-jar-plugin</artifactId>
					<configuration>
						<archive>
							<addMavenDescriptor>false</addMavenDescriptor>
							<manifest>
								<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
								<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
							</manifest>
						</archive>
					</configuration>
					<executions>
						<execution>
							<goals>
								<goal>test-jar</goal>
							</goals>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-assembly-plugin</artifactId>
					<version>2.3</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-resources-plugin</artifactId>
					<version>${org.apache.maven.plugins.resources.version}</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-shade-plugin</artifactId>
					<version>${org.apache.maven.plugins.shade.version}</version>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>

	<!-- /////////////////////////////////////////////////////////////////// -->
	<!-- REPORTING                                                           -->
	<!-- /////////////////////////////////////////////////////////////////// -->

	<reporting>

		<!-- /////////////////////////////////////////////////////////////// -->
		<!-- PLUGINS                                                         -->
		<!-- /////////////////////////////////////////////////////////////// -->

		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-pmd-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jxr-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>cobertura-maven-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>versions-maven-plugin</artifactId>
				<reportSets>
					<reportSet>
						<reports>
							<report>dependency-updates-report</report>
							<report>property-updates-report</report>
						</reports>
					</reportSet>
				</reportSets>
			</plugin>
		</plugins>
	</reporting>

	<!-- /////////////////////////////////////////////////////////////////// -->
	<!-- PLUGIN REPOSITORIES                                                 -->
	<!-- /////////////////////////////////////////////////////////////////// -->

	<pluginRepositories>
		<pluginRepository>
			<id>glassfish</id>
			<name>Glassfish</name>
			<url>http://download.java.net/maven/glassfish</url>
		</pluginRepository>
		<pluginRepository>
			<id>java.net</id>
			<name>java.net</name>
			<url>http://download.java.net/maven/2</url>
		</pluginRepository>
		<pluginRepository>
			<id>mvnrepository.com</id>
			<name>MVNrepository</name>
			<url>http://mvnrepository.com/artifact</url>
		</pluginRepository>
		<pluginRepository>
			<id>repo1</id>
			<name>Repo1</name>
			<url>http://repo1.maven.org/maven2</url>
		</pluginRepository>
	</pluginRepositories>

	<!-- /////////////////////////////////////////////////////////////////// -->
	<!-- PROFILES                                                            -->
	<!-- /////////////////////////////////////////////////////////////////// -->

	<profiles>
		
		<!-- FatJAR -->

		<profile>
			<id>fatjar</id>
			<activation>
				<activeByDefault>true</activeByDefault>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-shade-plugin</artifactId>
						<executions>
							<execution>
								<phase>package</phase>
								<goals>
									<goal>shade</goal>
								</goals>
								<configuration>
									<keepDependenciesWithProvidedScope>true</keepDependenciesWithProvidedScope>
									<minimizeJar>false</minimizeJar>
									<transformers>
										<transformer
											implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
											<mainClass>${main.class}</mainClass>
										</transformer>
										<!-- Merge all "spring.handlers" files -->
										<transformer
											implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
											<resource>META-INF/spring.handlers</resource>
										</transformer>
										<!-- Merge all "spring.schemas" files -->
										<transformer
											implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
											<resource>META-INF/spring.schemas</resource>
										</transformer>
									</transformers>
									<filters>
										<filter>
											<artifact>*:*</artifact>
											<excludes>
												<exclude>META-INF/*.SF</exclude>
												<exclude>META-INF/*.DSA</exclude>
												<exclude>META-INF/*.RSA</exclude>
												<exclude>**/module-info.class</exclude>
												<exclude>**/bundle.properties</exclude>
											</excludes>
										</filter>
									</filters>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>

		<!-- JavaFX -->

		<profile>
			<id>jfxjar</id>
			<build>
				<plugins>
					<plugin>
						<groupId>com.zenjava</groupId>
						<artifactId>javafx-maven-plugin</artifactId>
						<configuration>
							<mainClass>${main.class}</mainClass>
							<verbose>true</verbose>
							<vendor>${groupId}</vendor>
						</configuration>
						<executions>
							<execution>
								<id>create-jfxjar</id>
								<phase>package</phase>
								<goals>
									<goal>build-jar</goal>
								</goals>
							</execution>
							<execution>
								<id>create-native</id>
								<phase>package</phase>
								<goals>
									<goal>build-native</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>

		<!-- GraalVM -->

		<profile>
			<id>native-image</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.graalvm.nativeimage</groupId>
						<artifactId>native-image-maven-plugin</artifactId>
						<version>${org.graalvm.nativeimage.version}</version>
						<configuration>
							<imageName>${executable.name}-native-${native.arch}-${executable.version}${executable.suffix}</imageName>
							<mainClass>${main.class}</mainClass>
							<buildArgs>
					            --no-fallback
					        </buildArgs>
						</configuration>
						<executions>
							<execution>
								<goals>
									<goal>native-image</goal>
								</goals>
								<phase>package</phase>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>

		<!-- Webstart -->

		<profile>
			<id>webstart</id>
			<build>
				<plugins>
					<plugin>
						<groupId>com.zenjava</groupId>
						<artifactId>javafx-maven-plugin</artifactId>
						<configuration>
							<mainClass>${main.class}</mainClass>
							<verbose>true</verbose>
							<vendor>${groupId}</vendor>
						</configuration>
						<executions>
							<execution>
								<id>create-jfxjar</id>
								<phase>package</phase>
								<goals>
									<goal>build-jar</goal>
								</goals>
							</execution>
							<execution>
								<id>create-web</id>
								<phase>package</phase>
								<goals>
									<goal>build-web</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy