truelicense
Used in:
components
- OverviewOverview
- VersionsVersions
- DependentsDependents
- DependenciesDependencies
<dependency>
<groupId>global.namespace.truelicense</groupId>
<artifactId>truelicense</artifactId>
<version>4.1.4</version>
</dependency><?xml version='1.0'?>
<!--
~ Copyright (C) 2005 - 2021 Schlichtherle IT Services.
~ All rights reserved. Use is subject to license terms.
-->
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<!--
~ This POM has no parent, so that a release never waits on one.
~
~ <dependencyManagement> below is a published API: projects generated by truelicense-maven-archetype import
~ this POM as a BOM and declare junit, com.sun.activation:javax.activation and org.glassfish.jaxb:jaxb-runtime
~ with no version of their own. Check the archetype before removing an entry that looks unused here.
-->
<groupId>global.namespace.truelicense</groupId>
<artifactId>truelicense</artifactId>
<version>4.1.4</version>
<packaging>pom</packaging>
<name>TrueLicense</name>
<description>
TrueLicense is an open source engine for license management on the Java Virtual Machine.
Due to its functional and modular design TrueLicense scales from simple to complex licensing schemas.
TrueLicense features various interfaces for managing free trial periods, subscriptions, multiple editions,
internationalization, privacy protection and more.
</description>
<url>http://truelicense.net/</url>
<inceptionYear>2005</inceptionYear>
<organization>
<name>Schlichtherle IT Services</name>
<url>https://schlichtherle.de</url>
</organization>
<!-- Maven Central rejects a deployment without <licenses> and <developers>. -->
<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<developers>
<developer>
<name>Christian Schlichtherle</name>
<email>christian AT schlichtherle DOT de</email>
<timezone>1</timezone>
<roles>
<role>owner</role>
</roles>
<properties>
<picUrl>http://www.gravatar.com/avatar/e2f69ddc944f8891566fc4b18518e4e6.png</picUrl>
</properties>
</developer>
</developers>
<issueManagement>
<system>Github</system>
<url>https://github.com/christian-schlichtherle/truelicense/issues</url>
</issueManagement>
<scm>
<connection>scm:git:https://github.com/christian-schlichtherle/truelicense.git</connection>
<developerConnection>scm:git:https://github.com/christian-schlichtherle/truelicense.git</developerConnection>
<url>https://github.com/christian-schlichtherle/truelicense</url>
<tag>HEAD</tag>
</scm>
<!--
~ Snapshots only. Releases bypass distributionManagement entirely: central-publishing-maven-plugin replaces
~ maven-deploy-plugin and uploads a bundle to the Central Publisher Portal instead.
-->
<distributionManagement>
<snapshotRepository>
<id>central</id>
<name>Central Portal Snapshots</name>
<url>${centralSnapshotsRepository}</url>
</snapshotRepository>
</distributionManagement>
<properties>
<!-- maven-jar-plugin: JPMS automatic module name; overridden per module -->
<automatic.module.name>global.namespace.truelicense</automatic.module.name>
<!--
~ maven-enforcer-plugin: Maven 3.6.x silently drops a profile-injected <pluginManagement> execution, which
~ disables constant string obfuscation. Nothing below relies on that merge any more, but older versions
~ are untested.
-->
<maven.enforcer.requireMavenVersion>[3.9.16,)</maven.enforcer.requireMavenVersion>
<maven.enforcer.requireJavaVersion>${maven.compiler.target}</maven.enforcer.requireJavaVersion> <!-- forward reference -->
<!--
~ maven-compiler-plugin: source/target rather than the `release` flag, so that compiling on JDK 8 is what
~ proves no post-8 API crept in. The CI compile job exists for that.
-->
<maven.compiler.debug>false</maven.compiler.debug>
<maven.compiler.optimize>true</maven.compiler.optimize>
<maven.compiler.showDeprecation>true</maven.compiler.showDeprecation>
<maven.compiler.showWarnings>true</maven.compiler.showWarnings>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>${maven.compiler.source}</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>${project.build.sourceEncoding}</project.reporting.outputEncoding>
<!-- maven-javadoc-plugin -->
<header><b>${project.name} ${project.version}</b></header>
<maven.javadoc.failOnError>false</maven.javadoc.failOnError>
<nodeprecated>false</nodeprecated>
<notimestamp>true</notimestamp>
<quiet>true</quiet>
<splitindex>true</splitindex>
<centralSnapshotsRepository>https://central.sonatype.com/repository/maven-snapshots/</centralSnapshotsRepository>
<!-- truelicense-maven-plugin -->
<truelicense.obfuscate.intern>false</truelicense.obfuscate.intern>
<truelicense.obfuscate.scope>all</truelicense.obfuscate.scope>
<!-- Set to true in a module that legitimately has no constant strings to obfuscate. -->
<truelicense.obfuscate.verify.skip>false</truelicense.obfuscate.verify.skip>
<!--
~ Set to true in a module that obfuscates only named constants: the computation method then takes the name
~ of the field it replaces, so no synthesized "_string#N" or "_clinit@..." name appears and the weaker
~ "references ObfuscatedString" check has to stand in. Only safe where the module's own source does not
~ reference ObfuscatedString.
-->
<truelicense.obfuscate.verify.relaxed>false</truelicense.obfuscate.verify.relaxed>
<!--
~ dependencies
~
~ byte-buddy and scala are pinned purely to keep the build working on JDKs newer than 11; each
~ one blocks it outright, and each masked the next. See CLAUDE.md.
-->
<asm.version>9.10.1</asm.version>
<!-- Overrides the 1.10.20 that Mockito 3.9.0 resolves: it cannot read JDK 21+ class files. -->
<byte-buddy.version>1.18.11</byte-buddy.version>
<fun-io.version>2.4.1</fun-io.version>
<jackson.version>2.22.1</jackson.version>
<!-- Terminal release of the javax.xml.bind:jaxb-api GA - everything newer is the jakarta.* namespace. -->
<jaxb-api.version>2.3.1</jaxb-api.version>
<!-- Last of the JAXB 2.3 line, i.e. the newest runtime that still implements the javax.xml.bind packages. -->
<jaxb-runtime.version>2.3.9</jaxb-runtime.version>
<junit.version>4.13.2</junit.version>
<!-- Kept in lockstep with maven.enforcer.requireMavenVersion above. -->
<maven.version>3.9.16</maven.version>
<!-- maven-plugin-plugin and maven-plugin-annotations must stay on the same version. -->
<maven-plugin-tools.version>3.15.2</maven-plugin-tools.version>
<!--
~ Mockito 5 would remove the need for the byte-buddy pin above, but requires Java 11 and would drop JDK 8
~ from the test matrix. Re-run the matrix when bumping either.
-->
<mockito.version>3.9.0</mockito.version>
<plexus-utils.version>4.0.3</plexus-utils.version>
<proguard.version>7.9.1</proguard.version>
<scala.compat.version>2.13</scala.compat.version>
<!-- 2.13.5's Zinc compiler bridge fails to build on JDK 21+. -->
<scala.version>2.13.18</scala.version>
<scalatest.version>3.2.8</scalatest.version>
<slf4j.version>1.7.30</slf4j.version>
</properties>
<modules>
<module>api</module>
<module>build-tasks</module>
<module>core</module>
<module>jax-rs</module>
<module>jsf</module>
<module>maven-plugin</module>
<module>obfuscate</module>
<module>spi</module>
<module>swing</module>
<module>tests</module>
<module>ui</module>
<module>v1</module>
<module>v2-core</module>
<module>v2-json</module>
<module>v2-xml</module>
<module>v4</module>
</modules>
<!-- For consuming other projects' snapshots (fun-io, …), not for publishing ours. -->
<repositories>
<repository>
<id>central-snapshots</id>
<name>Central Portal Snapshots</name>
<url>${centralSnapshotsRepository}</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>truelicense-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>truelicense-build-tasks</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>truelicense-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>truelicense-jax-rs</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>truelicense-jsf</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>truelicense-obfuscate</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>truelicense-spi</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>truelicense-swing</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>truelicense-ui</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>truelicense-v1</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>truelicense-v2-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>truelicense-v2-json</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>truelicense-v2-xml</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>truelicense-v4</artifactId>
<version>${project.version}</version>
</dependency>
<!--
~ Imported rather than pinned per artifact: since 2.20, jackson-annotations no longer carries the patch
~ component of the release train version (2.22 vs 2.22.1), so a single ${jackson.version} property
~ cannot express the set. The BOM also aligns jackson-module-jaxb-annotations, which Jersey pulls in.
-->
<dependency>
<groupId>com.fasterxml.jackson</groupId>
<artifactId>jackson-bom</artifactId>
<version>${jackson.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey</groupId>
<artifactId>jersey-bom</artifactId>
<!-- Last of the Jersey 2.x line, i.e. the newest JAX-RS 2.1 (javax.ws.rs) implementation. -->
<version>2.48</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- BOM API: generated V2/XML projects declare this with no version. Unused in this reactor. -->
<dependency>
<groupId>com.sun.activation</groupId>
<artifactId>javax.activation</artifactId>
<version>1.2.0</version>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<!--
~ Was pinned to 1.9.3 because 1.9.4 broke `DisplayTool.capitalize` in velocity-tools-generic 3.0,
~ used by the TrueLicense Build Tool and (transitively) the TrueLicense Maven Plugin. That pin is
~ obsolete: velocity-tools-generic is on 3.1 now, and `capitalize`, `uncapitalize` and `truncate`
~ were verified to return identical results there on 1.9.3, 1.9.4 and 1.11.0. Unpinning also picks
~ up the fix for CVE-2019-10086, which 1.9.3 is subject to.
-->
<version>1.11.0</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.4.0</version>
</dependency>
<dependency>
<groupId>global.namespace.fun-io</groupId>
<artifactId>fun-io-api</artifactId>
<version>${fun-io.version}</version>
</dependency>
<dependency>
<groupId>global.namespace.fun-io</groupId>
<artifactId>fun-io-bios</artifactId>
<version>${fun-io.version}</version>
</dependency>
<dependency>
<groupId>global.namespace.fun-io</groupId>
<artifactId>fun-io-jackson</artifactId>
<version>${fun-io.version}</version>
</dependency>
<dependency>
<groupId>global.namespace.fun-io</groupId>
<artifactId>fun-io-jaxb</artifactId>
<version>${fun-io.version}</version>
</dependency>
<dependency>
<groupId>global.namespace.fun-io</groupId>
<artifactId>fun-io-scala-api_${scala.compat.version}</artifactId>
<version>${fun-io.version}</version>
</dependency>
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
<version>${byte-buddy.version}</version>
</dependency>
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy-agent</artifactId>
<version>${byte-buddy.version}</version>
</dependency>
<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
<version>1.3.5</version>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>8.0.1</version>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>2.1.1</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>${jaxb-api.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.20.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>${maven.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>${maven.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<version>${maven-plugin-tools.version}</version>
</dependency>
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity-engine-core</artifactId>
<version>2.4.1</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>${plexus-utils.version}</version>
</dependency>
<dependency>
<groupId>org.apache.velocity.tools</groupId>
<artifactId>velocity-tools-generic</artifactId>
<version>3.1</version>
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>${jaxb-runtime.version}</version>
</dependency>
<dependency>
<groupId>com.guardsquare</groupId>
<artifactId>proguard-base</artifactId>
<version>${proguard.version}</version>
</dependency>
<dependency>
<groupId>org.netbeans</groupId>
<artifactId>jemmy</artifactId>
<version>2.2.7.5</version>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm-tree</artifactId>
<version>${asm.version}</version>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
<version>${asm.version}</version>
</dependency>
<!-- Backs the test stack that the scala-test-sources profile pulls in. -->
<!-- BOM API: generated projects declare junit with no version. No test here uses it. -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${mockito.version}</version>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>${scala.version}</version>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-reflect</artifactId>
<version>${scala.version}</version>
</dependency>
<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_${scala.compat.version}</artifactId>
<version>${scalatest.version}</version>
</dependency>
<dependency>
<groupId>org.scalatestplus</groupId>
<artifactId>mockito-3-4_${scala.compat.version}</artifactId>
<version>${scalatest.version}.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4j.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<!-- Without these, src/*/filtered stops being a resource root. -->
<resources>
<resource>
<directory>src/main/filtered</directory>
<filtering>true</filtering>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
<testResources>
<testResource>
<directory>src/test/filtered</directory>
<filtering>true</filtering>
</testResource>
<testResource>
<directory>src/test/resources</directory>
</testResource>
</testResources>
<!--
~ Pin a plugin here once the build actually runs it, not before, and check that its descriptor declares
~ java>=1.8 and maven>=3.6.3. maven-help-plugin and versions-maven-plugin run no lifecycle goal but are
~ pinned anyway, so that verifying a POM refactor and surveying updates stay reproducible.
~
~ Declaration order is arbitrary.
-->
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>3.2.0</version>
</plugin>
<plugin>
<groupId>${project.groupId}</groupId>
<artifactId>truelicense-maven-plugin</artifactId>
<!-- Cannot use ${project.version} while bootstrapping! -->
<version>4.1.3</version>
</plugin>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.5.0</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.15.0</version>
<configuration>
<compilerArgs>
<arg>-Xlint:unchecked</arg>
</compilerArgs>
</configuration>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.1.4</version>
</plugin>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.6.3</version>
</plugin>
<plugin>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.2.8</version>
</plugin>
<plugin>
<artifactId>maven-help-plugin</artifactId>
<version>3.2.0</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>3.1.4</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<archive>
<manifestEntries>
<Automatic-Module-Name>${automatic.module.name}</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
<executions>
<execution>
<id>default-jar</id>
<configuration>
<skipIfEmpty>true</skipIfEmpty>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.12.0</version>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.5.0</version>
</plugin>
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.9.1</version>
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>3.4.0</version>
</plugin>
<!--
~ Surefire has no test to run anywhere: scala-test-sources sets default-test to phase `none` where
~ tests exist, and the remaining modules have none. Pin a current version before relying on it.
-->
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
</plugin>
<plugin>
<artifactId>maven-plugin-plugin</artifactId>
<version>${maven-plugin-tools.version}</version>
<executions>
<execution>
<id>default-helpmojo</id>
<goals>
<goal>helpmojo</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>4.9.10</version>
<configuration>
<args>
<arg>-deprecation</arg>
<arg>-explaintypes</arg>
<arg>-feature</arg>
</args>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.21.0</version>
</plugin>
<plugin>
<groupId>org.scalatest</groupId>
<artifactId>scalatest-maven-plugin</artifactId>
<version>2.2.0</version>
</plugin>
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.11.0</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>enforce-maven-and-java</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireMavenVersion>
<version>${maven.enforcer.requireMavenVersion}</version>
</requireMavenVersion>
<requireJavaVersion>
<version>${maven.enforcer.requireJavaVersion}</version>
</requireJavaVersion>
</rules>
</configuration>
</execution>
<!--
~ Preflight: fail at `validate` if any module grows a `src/test/java` directory.
~
~ `src/test/java` is maven-compiler's default test source root, so sources there compile and
~ then never run: scala-test-sources sets Surefire's default-test to phase `none`. A green
~ build with silently skipped tests is the failure this prevents.
~
~ Test sources in every language belong under `src/test/scala`, which scala-maven-plugin's
~ `add-source` registers as a test compile source root, so maven-compiler-plugin picks up the
~ .java files there and scalac picks up the .scala ones.
-->
<execution>
<id>enforce-no-java-test-sources</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireFilesDontExist>
<files>
<file>${project.basedir}/src/test/java</file>
</files>
<message>Put test sources under src/test/scala instead - in any language. Sources in src/test/java compile, but in any module with src/test/scala the scala-test-sources profile sets Surefire's default-test to phase "none", so they never run and the build stays green. See the comment on this execution in the root POM.</message>
</requireFilesDontExist>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<!--
~ Why `./mvnw test` and `./mvnw verify` run the same set: every test is a ScalaTest suite bound to the
~ `test` phase, and Surefire's default-test is switched off. Activation is per module, by directory.
-->
<profile>
<id>scala-test-sources</id>
<activation>
<file>
<exists>src/test/scala</exists>
</file>
</activation>
<dependencies>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_${scala.compat.version}</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.scalatestplus</groupId>
<artifactId>mockito-3-4_${scala.compat.version}</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<executions>
<execution>
<id>default-test</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<executions>
<execution>
<id>scala-add-source</id>
<goals>
<goal>add-source</goal>
</goals>
</execution>
<execution>
<id>scala-test-compile</id>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.scalatest</groupId>
<artifactId>scalatest-maven-plugin</artifactId>
<executions>
<execution>
<id>test</id>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<!--
~ What must hold for an artifact that gets published, as opposed to an ordinary `mvn install`. Activated
~ explicitly by the release and compile workflows; never by a local build.
-->
<profile>
<id>sonatype-oss-release</id>
<build>
<plugins>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-gpg-plugin</artifactId>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<!--
~ `publishingServerId` names a <server> in settings.xml holding a Central Portal user token.
~ autoPublish makes a valid deployment go live without a click in the UI, and waitUntil makes
~ a rejected one fail the build rather than sit half-finished. excludeArtifacts keeps
~ truelicense-tests out of the bundle; that module's maven.deploy.skip does not apply here.
-->
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<publishingServerId>central</publishingServerId>
<centralSnapshotsUrl>${centralSnapshotsRepository}</centralSnapshotsUrl>
<autoPublish>true</autoPublish>
<waitUntil>published</waitUntil>
<excludeArtifacts>
<excludeArtifact>truelicense-tests</excludeArtifact>
</excludeArtifacts>
</configuration>
</plugin>
<!--
~ Obfuscation failing is otherwise invisible: the goal simply does not run and the build stays
~ green. The primary signal is a method name synthesized by ObfuscateClassesTask - "_clinit@..."
~ from the <clinit> merger, or "_string#N" from an obfuscated ldc. Both contain characters that
~ are illegal in Java identifiers, so javac cannot produce them and there are no false passes.
~
~ Merely referencing ObfuscatedString is NOT sufficient evidence: obfuscate, build-tasks, core
~ and maven-plugin all reference that class from their own source, so such a check stays green
~ even when they are not obfuscated at all. It is only used as a fallback for the modules that
~ legitimately synthesize no method name (see truelicense.obfuscate.verify.relaxed).
-->
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>verify-obfuscate-main-classes</id>
<phase>prepare-package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<resourcecount property="synthesizedNameCount">
<fileset dir="${project.build.outputDirectory}" erroronmissingdir="false">
<include name="**/*.class"/>
<or>
<contains text="_clinit@"/>
<contains text="_string#"/>
</or>
</fileset>
</resourcecount>
<resourcecount property="obfuscatedStringRefCount">
<fileset dir="${project.build.outputDirectory}" erroronmissingdir="false">
<include name="**/*.class"/>
<contains text="truelicense/obfuscate/ObfuscatedString"/>
</fileset>
</resourcecount>
<!-- This profile has no src/main activation, so skip modules with no classes. -->
<resourcecount property="classFileCount">
<fileset dir="${project.build.outputDirectory}" erroronmissingdir="false">
<include name="**/*.class"/>
</fileset>
</resourcecount>
<fail message="Constant string obfuscation produced nothing in ${project.artifactId}: no class in ${project.build.outputDirectory} carries a method name synthesized by ObfuscateClassesTask. The obfuscate-main-classes goal did not run or did not apply. If this module genuinely has no constant strings, set truelicense.obfuscate.verify.skip=true; if it obfuscates only named constants and so synthesizes no method name, set truelicense.obfuscate.verify.relaxed=true.">
<condition>
<and>
<available file="${project.build.outputDirectory}" type="dir"/>
<not>
<equals arg1="${classFileCount}" arg2="0"/>
</not>
<not>
<istrue value="${truelicense.obfuscate.verify.skip}"/>
</not>
<equals arg1="${synthesizedNameCount}" arg2="0"/>
<or>
<not>
<istrue value="${truelicense.obfuscate.verify.relaxed}"/>
</not>
<equals arg1="${obfuscatedStringRefCount}" arg2="0"/>
</or>
</and>
</condition>
</fail>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>enable-obfuscate-main-classes</id>
<activation>
<file>
<exists>src/main</exists>
</file>
</activation>
<build>
<!--
~ Declared in <plugins>, NOT <pluginManagement>: pluginManagement binds nothing on its own, and
~ Maven 3.6.x silently fails to merge a profile-injected pluginManagement execution into a module's
~ bare <plugin> declaration. That is what shipped 4.0.1 and 4.0.3 without any obfuscation.
~ Declaring it here obfuscates every module with src/main, so modules must NOT repeat it.
-->
<plugins>
<plugin>
<groupId>${project.groupId}</groupId>
<artifactId>truelicense-maven-plugin</artifactId>
<executions>
<execution>
<id>obfuscate-main-classes</id>
<goals>
<goal>obfuscate-main-classes</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>