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

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

<?xml version='1.0'?>
<!--
  - Copyright (C) 2005 - 2019 Schlichtherle IT Services.
  - All rights reserved. Use is subject to license terms.
  -->
#if($ftpKeyStoreFile == "-")
#set($ftpKeyStoreFile = $publicKeyStoreFile)
#end
#set($dollar = '$')
<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>

    <parent>
        <groupId>$groupId</groupId>
        <artifactId>$rootArtifactId</artifactId>
        <version>$version</version>
    </parent>

    <artifactId>$artifactId</artifactId>

#if($artifactName != "-")
    <name>$artifactName Key Manager</name>
#end
    <description>The license consumer application.</description>

    <properties>
        <mainClass>${package}.keymgr.Main</mainClass>
    </properties>

    <dependencies>
        <dependency>
            <groupId>${dollar}{project.groupId}</groupId>
            <artifactId>${rootArtifactId}-keygen</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>global.namespace.truelicense</groupId>
            <artifactId>${dollar}{trueLicenseArtifactId}</artifactId>
        </dependency>
#if($disableWizard == false)
        <!-- This dependency is only required for the "wizard" command of the
             Main class. -->
        <dependency>
            <groupId>global.namespace.truelicense</groupId>
            <artifactId>truelicense-swing</artifactId>
            <optional>true</optional>
        </dependency>
#end
#if($licenseKeyFormat == "V2/XML")
        <dependency>
            <groupId>org.glassfish.jaxb</groupId>
            <artifactId>jaxb-runtime</artifactId>
            <scope>runtime</scope>
        </dependency>
#end
    </dependencies>

    <profiles>
        <profile>
            <id>generate-keymgr-guarded-jar</id>
            <activation>
                <property>
                    <name>skipStandaloneJars</name>
                    <value>!true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>global.namespace.truelicense</groupId>
                        <artifactId>truelicense-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>proguard</id>
                                <goals>
                                    <goal>proguard</goal>
                                </goals>
                                <configuration>
                                    <injars>
                                        <injar>
                                            ${dollar}{project.build.finalName}-standalone.jar($package.replace('.', '/')/**,de/schlichtherle/**,global/namespace/truelicense/**)
                                        </injar>
                                    </injars>
                                    <options>
                                        <!-- The following options are specific to this sample project.
                                             You may need to edit them when customizing this sample project: -->
                                        <option>
                                            -printseeds proguard_seed.txt
                                            -printmapping proguard_map.txt
                                            -dontnote
                                            -optimizationpasses 3
                                            -overloadaggressively
                                            -repackageclasses
                                            -allowaccessmodification
                                            -keepclasseswithmembers public class * {
                                                public static void main(java.lang.String[]);
                                            }
                                        </option>

                                        <!-- This option excludes the secret FTP marker class from byte code obfuscation.
                                             You can remove this option if you do not want to provide auto-generated FTP license
                                             keys; -->
#if($freeTrialPeriod != 0)
                                        <option>
#else
                                        <!--option>
#end
                                            -keep class $ftpSecretMarkerClass
#if($freeTrialPeriod == 0)
                                        <option-->
#else
                                        </option>
#end

                                        <!-- The following options are required for TrueLicense 4: -->
#if($licenseKeyFormat == "V1")
                                        <option>
#else
                                        <!--option>
#end
                                            -keepnames class de.schlichtherle.license.LicenseContent
                                            -keepclassmembers class de.schlichtherle.license.LicenseContent {
                                                public *** get*();
                                                public void set*(***);
                                            }
                                            -keepnames class de.schlichtherle.xml.GenericCertificate
                                            -keepclassmembers class de.schlichtherle.xml.GenericCertificate {
                                                public *** get*();
                                                public void set*(***);
                                            }
#if($licenseKeyFormat != "V1")
                                        </option-->
#else
                                        </option>
#end
#if($licenseKeyFormat.startsWith("V2/"))
                                        <option>
#else
                                        <!--option>
#end
                                            -keepclassmembers class global.namespace.truelicense.v2.core.auth.V2RepositoryModel {
                                                *;
                                            }
#if(!$licenseKeyFormat.startsWith("V2/"))
                                        </option-->
#else
                                        </option>
#end
#if($licenseKeyFormat == "V4")
                                        <option>
#else
                                        <!--option>
#end
                                            -keepclassmembers class global.namespace.truelicense.v4.auth.V4RepositoryModel {
                                                *;
                                            }
#if($licenseKeyFormat != "V4")
                                        </option-->
#else
                                        </option>
#end

                                        <option>
                                            -adaptresourcefilenames
                                            -keepclassmembers class * extends global.namespace.truelicense.api.License {
                                                public *** get*();
                                                public void set*(***);
                                            }
                                            -keep,allowobfuscation class global.namespace.truelicense.api.codec.X500PrincipalXmlAdapter
                                            -keepclassmembers class global.namespace.truelicense.jax.rs.dto.*DTO {
                                                *;
                                            }
                                            -keepclassmembers enum * {
                                                public static **[] values();
                                                public static ** valueOf(java.lang.String);
                                            }
                                            -keepattributes *Annotation*,EnclosingMethod,InnerClasses,Signature
                                        </option>
                                    </options>
                                </configuration>
                            </execution>
                        </executions>
                        <dependencies>
                            <dependency>
                                <groupId>net.sf.proguard</groupId>
                                <artifactId>proguard-base</artifactId>
                                <version>6.1.1</version>
                            </dependency>
                        </dependencies>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>generate-public-key-store</id>
            <activation>
                <file>
                    <missing>${dollar}{basedir}/src/main/resources/${publicKeyStoreFile}</missing>
                </file>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.soebes.maven.plugins</groupId>
                        <artifactId>iterator-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>iterator</goal>
                                </goals>
                                <configuration>
                                    <content>${dollar}{editions}</content>
                                    <pluginExecutors>
                                        <pluginExecutor>
                                            <plugin>
                                                <groupId>org.codehaus.mojo</groupId>
                                                <artifactId>keytool-maven-plugin</artifactId>
                                            </plugin>
                                            <goal>exportCertificate</goal>
                                            <configuration>
                                                <alias>${dollar}{@item@KeyEntryAlias}</alias>
                                                <file>${dollar}{project.build.directory}/@[email protected]</file>
                                                <keystore>${dollar}{basedir}/../keygen/src/main/resources/${dollar}{privateKeyStoreFile}</keystore>
                                                <storepass>${dollar}{privateKeyStorePassword}</storepass>
                                                <storetype>${dollar}{privateKeyStoreType}</storetype>
                                            </configuration>
                                        </pluginExecutor>
                                        <pluginExecutor>
                                            <plugin>
                                                <groupId>org.codehaus.mojo</groupId>
                                                <artifactId>keytool-maven-plugin</artifactId>
                                            </plugin>
                                            <goal>importCertificate</goal>
                                            <configuration>
                                                <alias>${dollar}{@item@KeyEntryAlias}</alias>
                                                <file>${dollar}{project.build.directory}/@[email protected]</file>
                                                <keystore>${dollar}{basedir}/src/main/resources/${dollar}{publicKeyStoreFile}</keystore>
                                                <noprompt>true</noprompt>
                                                <storepass>${dollar}{publicKeyStorePassword}</storepass>
                                                <storetype>${dollar}{publicKeyStoreType}</storetype>
                                            </configuration>
                                        </pluginExecutor>
                                    </pluginExecutors>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <!-- This profile generates the keystore for use with auto-generated
             free trial period (FTP) license keys.
             You can remove this profile or skip the plugin if you do not
             want to provide auto-generated FTP license keys. -->
        <profile>
            <id>generate-ftp-key-store</id>
            <activation>
                <file>
                    <missing>${dollar}{basedir}/src/main/resources/${ftpKeyStoreFile}</missing>
                </file>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>keytool-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>generateKeyPair</goal>
                                </goals>
                                <configuration>
                                    <alias>${dollar}{ftpKeyEntryAlias}</alias>
                                    <dname>${dollar}{distinguishedName}</dname>
#if($keyPairAlgorithm != "auto")
                                    <keyalg>${dollar}{keyPairAlgorithm}</keyalg>
#end
                                    <keypass>${dollar}{ftpKeyEntryPassword}</keypass>
#if($keyPairSize != 0)
                                    <keysize>${dollar}{keyPairSize}</keysize>
#end
                                    <keystore>${dollar}{basedir}/src/main/resources/${dollar}{ftpKeyStoreFile}</keystore>
#if($signatureAlgorithm != "auto")
                                    <sigalg>${dollar}{signatureAlgorithm}</sigalg>
#end
#if($freeTrialPeriod == 0)
                                    <skip>true</skip>
#end
                                    <storepass>${dollar}{ftpKeyStorePassword}</storepass>
                                    <storetype>${dollar}{ftpKeyStoreType}</storetype>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy