[java-idp-plugin-archetype] 01/01: Initial commit from Phil's example + changes.
Scott Cantor
cantor.2 at osu.edu
Wed Aug 30 20:02:24 UTC 2023
This is an automated email from the git hooks/post-receive script.
scantor pushed a commit to branch main
in repository java-idp-plugin-archetype.
View the commit online:
http://git.shibboleth.net/view/?p=java-idp-plugin-archetype.git;a=commit;h=58579132e62547f3b4ae337b232425b470621b27
commit 58579132e62547f3b4ae337b232425b470621b27
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Wed Aug 30 14:07:43 2023 -0400
Initial commit from Phil's example + changes.
---
.gitignore | 5 +
pom.xml | 21 ++++
.../META-INF/archetype-post-generate.groovy | 123 ++++++++++++++++++
.../META-INF/maven/archetype-metadata.xml | 59 +++++++++
.../archetype-resources/plugin-api/pom.xml | 33 +++++
.../plugin-api/src/main/java/Version.java | 32 +++++
.../archetype-resources/plugin-dist/pom.xml | 48 +++++++
.../plugin-dist/src/main/assembly/assembly.xml | 72 +++++++++++
.../src/main/resources/bootstrap/keys.txt | 1 +
.../archetype-resources/plugin-impl/pom.xml | 81 ++++++++++++
.../plugin-impl/src/main/java/ExampleModule.java | 24 ++++
.../plugin-impl/src/main/java/ExamplePlugin.java | 27 ++++
.../META-INF/net.shibboleth.idp/postconfig.xml | 44 +++++++
.../idp/flows/myplugin/myplugin-beans.xml | 15 +++
.../idp/flows/myplugin/myplugin-flow.xml | 5 +
.../services/net.shibboleth.idp.module.IdPModule | 1 +
.../services/net.shibboleth.idp.plugin.IdPPlugin | 2 +
.../src/main/resources/module.properties | 14 +++
.../src/main/resources/plugin.properties | 9 ++
src/main/resources/archetype-resources/pom.xml | 139 +++++++++++++++++++++
.../resources/checkstyle/checkstyle.xml | 122 ++++++++++++++++++
21 files changed, 877 insertions(+)
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..2f82dd9
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+target/
+.DS_Store
+.classpath
+.project
+.settings/
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..454af09
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,21 @@
+<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>
+ <groupId>net.shibboleth.idp.plugin</groupId>
+ <artifactId>plugin-archetype</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <name>Shibboleth IdP :: Plugins :: Archetype</name>
+ <description>Maven archetype for a Shibboleth IdP plugin</description>
+ <packaging>maven-archetype</packaging>
+
+ <build>
+ <extensions>
+ <extension>
+ <groupId>org.apache.maven.archetype</groupId>
+ <artifactId>archetype-packaging</artifactId>
+ <version>3.1.1</version>
+ </extension>
+ </extensions>
+ </build>
+
+</project>
diff --git a/src/main/resources/META-INF/archetype-post-generate.groovy b/src/main/resources/META-INF/archetype-post-generate.groovy
new file mode 100644
index 0000000..5752208
--- /dev/null
+++ b/src/main/resources/META-INF/archetype-post-generate.groovy
@@ -0,0 +1,123 @@
+println 'Running groovy post generate script for artifact:'+request.getArtifactId();
+
+
+println 'Renaming module directories to include pluginBase...'
+
+/**
+ * First step is to rename the modules to the pluginBase variable, as that
+ * cannot be templated.
+ */
+def outputDirectory = new File( request.getOutputDirectory() );
+def implDir = new File(outputDirectory,request.getArtifactId()+"/plugin-impl");
+def apiDir = new File(outputDirectory,request.getArtifactId()+"/plugin-api");
+def distDir = new File(outputDirectory,request.getArtifactId()+"/plugin-dist");
+
+println 'Impl directory:'+implDir;
+println 'API directory:'+apiDir;
+println 'Dist directory:'+distDir;
+
+def implRenameDir = new File(outputDirectory,request.getArtifactId()+"/"+System.getProperty("pluginBase")+"-impl");
+def apiRenameDir = new File(outputDirectory,request.getArtifactId()+"/"+System.getProperty("pluginBase")+"-api");
+def distRenameDir = new File(outputDirectory,request.getArtifactId()+"/"+System.getProperty("pluginBase")+"-dist");
+
+implDir.renameTo(implRenameDir);
+apiDir.renameTo(apiRenameDir);
+distDir.renameTo(distRenameDir);
+println 'Renaming module directories to include pluginBase...done'
+
+/**
+ * Create a bin, doc and views directory in the impl module
+ */
+println 'Creating a bin, doc and views directory in the impl module...'
+def implResourceDir = new File(outputDirectory,request.getArtifactId()+"/"+System.getProperty("pluginBase")+
+ "-impl/src/main/resources/"+request.getGroupId().replaceAll('\\.','/'));
+println 'Impl resources dir:'+implResourceDir;
+def implResourceDirBin = new File(outputDirectory,request.getArtifactId()+"/"+System.getProperty("pluginBase")+
+ "-impl/src/main/resources/"+request.getGroupId().replaceAll('\\.','/')+"/bin");
+def implResourceDirDoc = new File(outputDirectory,request.getArtifactId()+"/"+System.getProperty("pluginBase")+
+ "-impl/src/main/resources/"+request.getGroupId().replaceAll('\\.','/')+"/doc");
+def implResourceDirViews = new File(outputDirectory,request.getArtifactId()+"/"+System.getProperty("pluginBase")+
+ "-impl/src/main/resources/"+request.getGroupId().replaceAll('\\.','/')+"/views");
+
+implResourceDir.mkdirs();
+implResourceDirBin.mkdirs();
+implResourceDirDoc.mkdirs();
+implResourceDirViews.mkdirs();
+
+println 'Creating a bin, doc and views directory in the impl module...done'
+
+/**
+ * Move the templated plugin and module properties files into the correct resources location
+ */
+println 'Moving the plugin and module properties templates into place...'
+
+def implModulePropsToMove = new File(outputDirectory,request.getArtifactId()+"/"+System.getProperty("pluginBase")+
+ "-impl/src/main/resources/module.properties");
+def implResourceDirModuleProps= new File(outputDirectory,request.getArtifactId()+"/"+System.getProperty("pluginBase")+
+ "-impl/src/main/resources/"+request.getGroupId().replaceAll('\\.','/')+"/module.properties");
+
+implModulePropsToMove.renameTo(implResourceDirModuleProps);
+
+def implPluginPropsToMove = new File(outputDirectory,request.getArtifactId()+"/"+System.getProperty("pluginBase")+
+ "-impl/src/main/resources/plugin.properties");
+def implResourceDirPluginProps= new File(outputDirectory,request.getArtifactId()+"/"+System.getProperty("pluginBase")+
+ "-impl/src/main/resources/"+request.getGroupId().replaceAll('\\.','/')+"/plugin.properties");
+
+
+implPluginPropsToMove.renameTo(implResourceDirPluginProps);
+
+println 'Moving the plugin and module properties templates into place...done'
+
+
+
+/**
+ * Now change the module names in the parent pom to match.
+ */
+println 'Updating parent pom to match new module directories...'
+def parentPomSrc = new File(outputDirectory,request.getArtifactId()+"/pom.xml");
+//read and write to the same file
+def parentPomDest = new File(outputDirectory,request.getArtifactId()+"/pom.xml");
+println 'Parent Pom: '+parentPomSrc;
+
+def pomText = parentPomSrc.text;
+
+def newLines = []
+
+parentPomSrc.eachLine { line ->
+ def lineWasBlank = false;
+ if(line.contains("plugin-impl")) {
+ println line
+ line = line.replace("plugin-impl", System.getProperty("pluginBase")+"-impl")
+ } else if(line.contains("plugin-api")) {
+ println line
+ line = line.replace("plugin-api", System.getProperty("pluginBase")+"-api")
+ } else if(line.contains("plugin-dist")) {
+ println line
+ newLines << "<!-- All DIST modules must come after the -api and -impl modules -->"
+ line = line.replace("plugin-dist", System.getProperty("pluginBase")+"-dist")
+ } else if(line.trim().equals("")) {
+ /**
+ * For some reason the parent pom is expanded with empty lines
+ * so remove here until understand this issue.
+ */
+ lineWasBlank = true;
+ }
+ if (lineWasBlank==false) {
+ newLines << line
+ }
+}
+
+parentPomDest.withWriter { out ->
+ newLines.each { out.println it }
+}
+println 'Updating parent pom to match new module directories...done'
+
+/**
+ * Add a basic gitignore
+ */
+ println 'Add a basic gitignore'
+def gitIgnore = new File(outputDirectory,request.getArtifactId()+"/.gitignore");
+gitIgnore.write "*/target\n*/test-output\n*~\n*/.classpath\n*/.project\n*/.settings\n/.project\n/.settings\ntarget"
+println 'Add a basic gitignore...done'
+
+println 'Finished running groovy post generate script...';
diff --git a/src/main/resources/META-INF/maven/archetype-metadata.xml b/src/main/resources/META-INF/maven/archetype-metadata.xml
new file mode 100644
index 0000000..e6d12c6
--- /dev/null
+++ b/src/main/resources/META-INF/maven/archetype-metadata.xml
@@ -0,0 +1,59 @@
+<archetype-descriptor
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.1.0
+ https://maven.apache.org/xsd/archetype-descriptor-1.1.0.xsd"
+ xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="idp-plugin">
+
+ <requiredProperties>
+ <requiredProperty key="pluginBase">
+ <defaultValue>idp-plugin</defaultValue>
+ </requiredProperty>
+ <requiredProperty key="vendor">
+ <defaultValue>FIXME-VENDOR</defaultValue>
+ </requiredProperty>
+ </requiredProperties>
+
+
+ <fileSets>
+ <fileSet filtered="false" packaged="false">
+ <directory></directory>
+ <includes>
+ <include>resources/checkstyle/checkstyle.xml</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+
+
+ <modules>
+ <module id="${rootArtifactId}-impl" dir="plugin-impl" name="${rootArtifactId}-impl">
+ <fileSets>
+ <fileSet filtered="true" packaged="true">
+ <directory>src/main/java</directory>
+ </fileSet>
+ <fileSet filtered="true">
+ <directory>src/main/resources</directory>
+ </fileSet>
+ </fileSets>
+ </module>
+ <module id="${rootArtifactId}-api" dir="plugin-api" name="${rootArtifactId}-api">
+ <fileSets>
+ <fileSet filtered="true" packaged="true">
+ <directory>src/main/java</directory>
+ </fileSet>
+ <!-- <fileSet> <directory>src/test/java</directory> </fileSet> -->
+ </fileSets>
+ </module>
+ <module id="${rootArtifactId}-dist" dir="plugin-dist" name="${rootArtifactId}-dist">
+ <fileSets>
+ <fileSet filtered="true" packaged="false">
+ <directory>src/main/assembly</directory>
+ </fileSet>
+ <fileSet filtered="true" packaged="false">
+ <directory>src/main/resources</directory>
+ </fileSet>
+ </fileSets>
+
+ </module>
+ </modules>
+
+</archetype-descriptor>
diff --git a/src/main/resources/archetype-resources/plugin-api/pom.xml b/src/main/resources/archetype-resources/plugin-api/pom.xml
new file mode 100644
index 0000000..6eeafa4
--- /dev/null
+++ b/src/main/resources/archetype-resources/plugin-api/pom.xml
@@ -0,0 +1,33 @@
+<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}-parent</artifactId>
+ <version>${version}</version>
+ </parent>
+
+ <artifactId>idp-plugin-${pluginBase}-api</artifactId>
+ <packaging>jar</packaging>
+ <name>Shibboleth IdP :: Plugins :: ${pluginBase} API</name>
+ <description>IdP ${pluginBase} plugin API.</description>
+
+ <properties>
+ <checkstyle.configLocation>${project.basedir}/../resources/checkstyle/checkstyle.xml</checkstyle.configLocation>
+ <automatic.module.name>${groupId}.${pluginBase}.api</automatic.module.name>
+ </properties>
+
+ <dependencies>
+ <!-- NOTE: Only use compile scope for net-new dependencies needed in the distribution. -->
+
+ <!-- Provided dependencies -->
+ <dependency>
+ <groupId>com.google.code.findbugs</groupId>
+ <artifactId>jsr305</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+</project>
diff --git a/src/main/resources/archetype-resources/plugin-api/src/main/java/Version.java b/src/main/resources/archetype-resources/plugin-api/src/main/java/Version.java
new file mode 100644
index 0000000..962b177
--- /dev/null
+++ b/src/main/resources/archetype-resources/plugin-api/src/main/java/Version.java
@@ -0,0 +1,32 @@
+package ${package};
+
+import javax.annotation.Nullable;
+
+/** Class for getting and printing the version of the plugin. */
+public final class Version {
+
+ /** IdP version. */
+ @Nullable private static final String VERSION = Version.class.getPackage().getImplementationVersion();
+
+ /** Constructor. */
+ private Version() {
+ }
+
+ /**
+ * Main entry point to program.
+ *
+ * @param args command line arguments
+ */
+ public static void main(final String[] args) {
+ System.out.println(VERSION);
+ }
+
+ /**
+ * Get the version of the plugin.
+ *
+ * @return version of the plugin
+ */
+ @Nullable public static String getVersion() {
+ return VERSION;
+ }
+}
diff --git a/src/main/resources/archetype-resources/plugin-dist/pom.xml b/src/main/resources/archetype-resources/plugin-dist/pom.xml
new file mode 100644
index 0000000..93c6079
--- /dev/null
+++ b/src/main/resources/archetype-resources/plugin-dist/pom.xml
@@ -0,0 +1,48 @@
+<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}-parent</artifactId>
+ <version>${version}</version>
+ </parent>
+
+ <artifactId>idp-plugin-${pluginBase}-dist</artifactId>
+ <name>Shibboleth IdP :: Plugins :: ${pluginBase} Distribution</name>
+ <description>IdP ${pluginBase} plugin packaging.</description>
+ <packaging>pom</packaging>
+
+
+ <properties>
+ <checkstyle.configLocation>${project.basedir}/../resources/checkstyle/checkstyle.xml</checkstyle.configLocation>
+ <dist.plugin.finalName>idp-plugin-${pluginBase}-${project.version}</dist.plugin.finalName>
+ </properties>
+
+ <build>
+ <plugins>
+ <!-- Assemble -->
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>make-assembly</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <configuration>
+ <appendAssemblyId>false</appendAssemblyId>
+ <descriptors>
+ <descriptor>src/main/assembly/assembly.xml</descriptor>
+ </descriptors>
+ <finalName>${dist.plugin.finalName}</finalName>
+ <tarLongFileMode>gnu</tarLongFileMode>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/src/main/resources/archetype-resources/plugin-dist/src/main/assembly/assembly.xml b/src/main/resources/archetype-resources/plugin-dist/src/main/assembly/assembly.xml
new file mode 100644
index 0000000..464c296
--- /dev/null
+++ b/src/main/resources/archetype-resources/plugin-dist/src/main/assembly/assembly.xml
@@ -0,0 +1,72 @@
+<assembly
+ xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
+ <id>bin</id>
+ <formats>
+ <format>tar.gz</format>
+ </formats>
+
+ <fileSets>
+ <fileSet>
+ <directory>src/main/resources/</directory>
+ <outputDirectory></outputDirectory>
+ </fileSet>
+
+ <!-- The plugin property file -->
+ <fileSet>
+ <directory>../plugin-impl/target/classes/FIXME</directory>
+ <outputDirectory>bootstrap</outputDirectory>
+ <includes>
+ <include>plugin.properties</include>
+ </includes>
+ </fileSet>
+
+ <!-- The implementation jar -->
+ <fileSet>
+ <directory>../plugin-impl/target</directory>
+ <outputDirectory>webapp/WEB-INF/lib</outputDirectory>
+ <includes>
+ <include>plugin-impl-*.jar</include>
+ </includes>
+ <excludes>
+ <exclude>*test*.jar</exclude>
+ <exclude>*javadoc.jar</exclude>
+ <exclude>*sources.jar</exclude>
+ </excludes>
+ </fileSet>
+
+ <!-- The API jar -->
+ <fileSet>
+ <directory>../plugin-api/target</directory>
+ <outputDirectory>webapp/WEB-INF/lib</outputDirectory>
+ <includes>
+ <include>plugin-api-*.jar</include>
+ </includes>
+ <excludes>
+ <exclude>*test*.jar</exclude>
+ <exclude>*javadoc.jar</exclude>
+ <exclude>*sources.jar</exclude>
+ </excludes>
+ </fileSet>
+
+ <!-- The dependencies -->
+ <fileSet>
+ <directory>../plugin-impl/target/dependency</directory>
+ <outputDirectory>webapp/WEB-INF/lib</outputDirectory>
+ <includes>
+ <include>*.jar</include>
+ </includes>
+ </fileSet>
+
+ <!-- The signing certificates -->
+ <fileSet>
+ <directory>src/main/resources/bootstrap</directory>
+ <outputDirectory>bootstrap</outputDirectory>
+ <includes>
+ <include>keys.txt</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+
+</assembly>
diff --git a/src/main/resources/archetype-resources/plugin-dist/src/main/resources/bootstrap/keys.txt b/src/main/resources/archetype-resources/plugin-dist/src/main/resources/bootstrap/keys.txt
new file mode 100644
index 0000000..921c030
--- /dev/null
+++ b/src/main/resources/archetype-resources/plugin-dist/src/main/resources/bootstrap/keys.txt
@@ -0,0 +1 @@
+FIXME: Plugin keys
\ No newline at end of file
diff --git a/src/main/resources/archetype-resources/plugin-impl/pom.xml b/src/main/resources/archetype-resources/plugin-impl/pom.xml
new file mode 100644
index 0000000..086c892
--- /dev/null
+++ b/src/main/resources/archetype-resources/plugin-impl/pom.xml
@@ -0,0 +1,81 @@
+<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}-parent</artifactId>
+ <version>${version}</version>
+ </parent>
+
+ <artifactId>idp-plugin-${pluginBase}-impl</artifactId>
+ <packaging>jar</packaging>
+ <name>Shibboleth IdP :: Plugins :: ${pluginBase} Impl</name>
+ <description>IdP ${pluginBase} plugin implementation.</description>
+
+ <properties>
+ <checkstyle.configLocation>${project.basedir}/../resources/checkstyle/checkstyle.xml</checkstyle.configLocation>
+ <automatic.module.name>${groupId}.${pluginBase}.impl</automatic.module.name>
+ </properties>
+
+ <dependencies>
+ <!-- Compile time intra-project dependencies -->
+ <dependency>
+ <groupId>${groupId}</groupId>
+ <artifactId>idp-plugin-${pluginBase}-api</artifactId>
+ </dependency>
+ <!-- Service API and Plugin Description dependencies -->
+ <dependency>
+ <groupId>${idp.groupId}</groupId>
+ <artifactId>idp-admin-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>${shib.groupId}</groupId>
+ <artifactId>shib-profile-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifestSections>
+ <manifestSection>
+ <name>org/example/com/${pluginBase}/</name>
+ <manifestEntries>
+ <Implementation-Title>${project.artifactId}</Implementation-Title>
+ <Implementation-Version>${project.version}</Implementation-Version>
+ <Implementation-Vendor>${vendor}</Implementation-Vendor>
+ </manifestEntries>
+ </manifestSection>
+ </manifestSections>
+ </archive>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-dependencies-test</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>copy-dependencies</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${project.target.directory}</outputDirectory>
+ <includeScope>runtime</includeScope>
+ <excludeTransitive>true</excludeTransitive>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/src/main/resources/archetype-resources/plugin-impl/src/main/java/ExampleModule.java b/src/main/resources/archetype-resources/plugin-impl/src/main/java/ExampleModule.java
new file mode 100644
index 0000000..5e894f3
--- /dev/null
+++ b/src/main/resources/archetype-resources/plugin-impl/src/main/java/ExampleModule.java
@@ -0,0 +1,24 @@
+package ${package};
+
+import java.io.IOException;
+
+import net.shibboleth.idp.module.IdPModule;
+import net.shibboleth.idp.module.PropertyDrivenIdPModule;
+import net.shibboleth.profile.module.ModuleException;
+
+/**
+ * {@link IdPModule IdP Module} implementation.
+ */
+public class ExampleModule extends PropertyDrivenIdPModule{
+
+ /**
+ * Constructor.
+ *
+ * @throws ModuleException on error
+ * @throws IOException on error
+ */
+ public ExampleModule() throws IOException, ModuleException {
+ super(ExampleModule.class);
+ }
+
+}
diff --git a/src/main/resources/archetype-resources/plugin-impl/src/main/java/ExamplePlugin.java b/src/main/resources/archetype-resources/plugin-impl/src/main/java/ExamplePlugin.java
new file mode 100644
index 0000000..e6ed0a7
--- /dev/null
+++ b/src/main/resources/archetype-resources/plugin-impl/src/main/java/ExamplePlugin.java
@@ -0,0 +1,27 @@
+package ${package};
+
+import java.io.IOException;
+import javax.annotation.Nonnull;
+
+import net.shibboleth.idp.plugin.IdPPlugin;
+import net.shibboleth.idp.plugin.PropertyDrivenIdPPlugin;
+import net.shibboleth.profile.plugin.PluginException;
+
+/**
+ * Plugin description about the webauthn plugin.
+ */
+public class ExamplePlugin extends PropertyDrivenIdPPlugin {
+
+ /**
+ * Constructor.
+ *
+ * @param claz type of plugin
+ *
+ * @throws IOException if properties can't be loaded
+ * @throws PluginException if another error occurs
+ */
+ public ExamplePlugin(@Nonnull final Class<? extends IdPPlugin> claz) throws IOException, PluginException {
+ super(claz);
+ }
+
+}
diff --git a/src/main/resources/archetype-resources/plugin-impl/src/main/resources/META-INF/net.shibboleth.idp/postconfig.xml b/src/main/resources/archetype-resources/plugin-impl/src/main/resources/META-INF/net.shibboleth.idp/postconfig.xml
new file mode 100644
index 0000000..2a12cdc
--- /dev/null
+++ b/src/main/resources/archetype-resources/plugin-impl/src/main/resources/META-INF/net.shibboleth.idp/postconfig.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xmlns:util="http://www.springframework.org/schema/util" xmlns:p="http://www.springframework.org/schema/p"
+ xmlns:c="http://www.springframework.org/schema/c" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
+ http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"
+
+ default-init-method="initialize" default-destroy-method="destroy">
+
+ <!--
+ System beans needed for extension to function, loaded after global.xml.
+ The default template shows an incomplete example authentication flow descriptor which can be
+ removed if not needed
+ -->
+
+ <bean id="authn/${pluginBase}" parent="shibboleth.AuthenticationFlow"
+ p:order="%{xxx.order:1000}"
+ p:nonBrowserSupported="%{xxx.nonBrowserSupported:true}"
+ p:passiveAuthenticationSupported="%{xxx.passiveAuthenticationSupported:true}"
+ p:forcedAuthenticationSupported="%{xxx.forcedAuthenticationSupported:true}"
+ p:proxyRestrictionsEnforced="%{xxx.proxyRestrictionsEnforced:%{idp.authn.enforceProxyRestrictions:true}}"
+ p:proxyScopingEnforced="%{xxx.proxyScopingEnforced:false}"
+ p:discoveryRequired="%{xxx.discoveryRequired:false}"
+ p:lifetime="%{xxx.lifetime:%{idp.authn.defaultLifetime:PT1H}}"
+ p:inactivityTimeout="%{xxx.inactivityTimeout:%{idp.authn.defaultTimeout:PT30M}}"
+ p:reuseCondition-ref="#{'%{xxx.reuseCondition:shibboleth.Conditions.TRUE}'.trim()}"
+ p:activationCondition-ref="#{'%{xxx.activationCondition:shibboleth.Conditions.TRUE}'.trim()}">
+ <property name="supportedPrincipals">
+ <list>
+ <bean parent="shibboleth.SAML2AuthnContextClassRef"
+ c:classRef="class-ref" />
+ <bean parent="shibboleth.SAML1AuthenticationMethod"
+ c:method="auth-ref" />
+ </list>
+ </property>
+ <property name="supportedPrincipalsByString">
+ <bean parent="shibboleth.CommaDelimStringArray"
+ c:_0="#{'%{xxx.supportedPrincipals:}'.trim()}" />
+ </property>
+ </bean>
+
+</beans>
\ No newline at end of file
diff --git a/src/main/resources/archetype-resources/plugin-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/myplugin/myplugin-beans.xml b/src/main/resources/archetype-resources/plugin-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/myplugin/myplugin-beans.xml
new file mode 100644
index 0000000..3dd79d0
--- /dev/null
+++ b/src/main/resources/archetype-resources/plugin-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/myplugin/myplugin-beans.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xmlns:util="http://www.springframework.org/schema/util"
+ xmlns:p="http://www.springframework.org/schema/p"
+ xmlns:c="http://www.springframework.org/schema/c"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
+ http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"
+
+ default-init-method="initialize"
+ default-destroy-method="destroy">
+
+</beans>
diff --git a/src/main/resources/archetype-resources/plugin-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/myplugin/myplugin-flow.xml b/src/main/resources/archetype-resources/plugin-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/myplugin/myplugin-flow.xml
new file mode 100644
index 0000000..d8cec3f
--- /dev/null
+++ b/src/main/resources/archetype-resources/plugin-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/myplugin/myplugin-flow.xml
@@ -0,0 +1,5 @@
+<flow xmlns="http://www.springframework.org/schema/webflow" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/webflow http://www.springframework.org/schema/webflow/spring-webflow.xsd">
+
+
+</flow>
diff --git a/src/main/resources/archetype-resources/plugin-impl/src/main/resources/META-INF/services/net.shibboleth.idp.module.IdPModule b/src/main/resources/archetype-resources/plugin-impl/src/main/resources/META-INF/services/net.shibboleth.idp.module.IdPModule
new file mode 100644
index 0000000..40d2294
--- /dev/null
+++ b/src/main/resources/archetype-resources/plugin-impl/src/main/resources/META-INF/services/net.shibboleth.idp.module.IdPModule
@@ -0,0 +1 @@
+${package}.impl.ExampleModule
diff --git a/src/main/resources/archetype-resources/plugin-impl/src/main/resources/META-INF/services/net.shibboleth.idp.plugin.IdPPlugin b/src/main/resources/archetype-resources/plugin-impl/src/main/resources/META-INF/services/net.shibboleth.idp.plugin.IdPPlugin
new file mode 100644
index 0000000..34dd1f9
--- /dev/null
+++ b/src/main/resources/archetype-resources/plugin-impl/src/main/resources/META-INF/services/net.shibboleth.idp.plugin.IdPPlugin
@@ -0,0 +1,2 @@
+${package}.impl.ExamplePlugin
+
diff --git a/src/main/resources/archetype-resources/plugin-impl/src/main/resources/module.properties b/src/main/resources/archetype-resources/plugin-impl/src/main/resources/module.properties
new file mode 100644
index 0000000..733774f
--- /dev/null
+++ b/src/main/resources/archetype-resources/plugin-impl/src/main/resources/module.properties
@@ -0,0 +1,14 @@
+# Example Properties defining a module.
+
+# Class to Module ID mappings
+${package}.impl.ExampleModule = org.example.${pluginBase}
+
+# Module Owner
+org.example.${pluginBase}.plugin = ${package}
+
+org.example.${pluginBase}.name = ${pluginBase} Module
+org.example.${pluginBase}.desc = Module for ${pluginBase}
+org.example.${pluginBase}.url = /${pluginBase}Configuration
+org.example.${pluginBase}.1.src = somefile
+org.example.${pluginBase}.1.dest = conf/to-somefile
+org.example.${pluginBase}.1.replace = true
diff --git a/src/main/resources/archetype-resources/plugin-impl/src/main/resources/plugin.properties b/src/main/resources/archetype-resources/plugin-impl/src/main/resources/plugin.properties
new file mode 100644
index 0000000..3900f31
--- /dev/null
+++ b/src/main/resources/archetype-resources/plugin-impl/src/main/resources/plugin.properties
@@ -0,0 +1,9 @@
+# Example properties defining this plugin
+
+plugin.id = ${package}
+# Only used when package manifest is not available
+plugin.version = 0.0.1
+plugin.license = licence.txt
+
+# No prereqs
+#plugin.modules.required =
diff --git a/src/main/resources/archetype-resources/pom.xml b/src/main/resources/archetype-resources/pom.xml
new file mode 100644
index 0000000..fbcde34
--- /dev/null
+++ b/src/main/resources/archetype-resources/pom.xml
@@ -0,0 +1,139 @@
+<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>
+
+ <!-- Use your own parent if this is not a Shibboleth Project artifact. -->
+ <parent>
+ <groupId>net.shibboleth</groupId>
+ <artifactId>parent</artifactId>
+ <version>17.0.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>${groupId}</groupId>
+ <artifactId>${artifactId}-parent</artifactId>
+ <version>${version}</version>
+ <name>Shibboleth IdP :: Plugins :: ${pluginBase}</name>
+ <packaging>pom</packaging>
+ <description>${pluginBase} plugin for the Shibboleth IdP.</description>
+
+ <properties>
+ <idp.groupId>net.shibboleth.idp</idp.groupId>
+ <idp.version>5.0.0-SNAPSHOT</idp.version>
+ <opensaml.groupId>org.opensaml</opensaml.groupId>
+ <opensaml.version>5.0.0-SNAPSHOT</opensaml.version>
+ <shib.groupId>net.shibboleth</shib.groupId>
+ <shib-profile.version>5.0.0-SNAPSHOT</shib-profile.version>
+ <shib-attribute.version>5.0.0-SNAPSHOT</shib-attribute.version>
+ <shib-metadata.version>5.0.0-SNAPSHOT</shib-metadata.version>
+ <shib-shared.version>9.0.0-SNAPSHOT</shib-shared.version>
+ <checkstyle.configLocation>${project.basedir}/resources/checkstyle/checkstyle.xml</checkstyle.configLocation>
+ </properties>
+
+ <distributionManagement>
+ <site>
+ <id>site</id>
+ <url>dav:...</url>
+ </site>
+ </distributionManagement>
+
+ <scm>
+ <connection>scm:git:...</connection>
+ <developerConnection>scm:git:...</developerConnection>
+ <url>...</url>
+ </scm>
+
+ <dependencies>
+ <!-- Project wide Dependencies -->
+ <dependency>
+ <groupId>${slf4j.groupId}</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <dependencyManagement>
+ <!-- ${pluginBase} project dependencies -->
+ <dependencies>
+ <dependency>
+ <groupId>${groupId}</groupId>
+ <artifactId>idp-plugin-${pluginBase}-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${groupId}</groupId>
+ <artifactId>idp-plugin-${pluginBase}-impl</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <!-- BOMs for importing IdP dependencies -->
+ <dependency>
+ <groupId>${idp.groupId}</groupId>
+ <artifactId>idp-bom</artifactId>
+ <version>${idp.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ <dependency>
+ <groupId>${shib.groupId}</groupId>
+ <artifactId>shib-profile-bom</artifactId>
+ <version>${shib-profile.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ <dependency>
+ <groupId>${shib.groupId}</groupId>
+ <artifactId>shib-attribute-bom</artifactId>
+ <version>${shib-attribute.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ <dependency>
+ <groupId>${shib.groupId}</groupId>
+ <artifactId>shib-metadata-bom</artifactId>
+ <version>${shib-metadata.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ <dependency>
+ <groupId>${opensaml.groupId}</groupId>
+ <artifactId>opensaml-bom</artifactId>
+ <version>${opensaml.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ <dependency>
+ <groupId>${shib.groupId}</groupId>
+ <artifactId>shib-shared-bom</artifactId>
+ <version>${shib-shared.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <index>true</index>
+ <manifestEntries>
+ <Automatic-Module-Name>${automatic.module.name}</Automatic-Module-Name>
+ <Sealed>true</Sealed>
+ </manifestEntries>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/src/main/resources/archetype-resources/resources/checkstyle/checkstyle.xml b/src/main/resources/archetype-resources/resources/checkstyle/checkstyle.xml
new file mode 100644
index 0000000..f456c13
--- /dev/null
+++ b/src/main/resources/archetype-resources/resources/checkstyle/checkstyle.xml
@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
+
+<!--
+ This configuration file was written by the eclipse-cs plugin configuration editor
+-->
+<!--
+ Checkstyle-Configuration: Shibboleth Checkstyle
+ Description: none
+-->
+<module name="Checker">
+ <property name="severity" value="warning"/>
+ <module name="SuppressWithPlainTextCommentFilter">
+ <property name="offCommentFormat" value="\bCheck[Ss]tyle:\s*([\w|]+)\s+OFF\b"/>
+ <property name="onCommentFormat" value="\bCheck[Ss]tyle:\s*([\w|]+)\s+ON\b"/>
+ <property name="checkFormat" value="$1"/>
+ </module>
+ <module name="TreeWalker">
+ <property name="tabWidth" value="4"/>
+ <module name="JavadocMethod"/>
+ <module name="JavadocType">
+ <property name="allowUnknownTags" value="true"/>
+ </module>
+ <module name="JavadocVariable"/>
+ <module name="JavadocStyle">
+ <property name="checkEmptyJavadoc" value="true"/>
+ </module>
+ <module name="ConstantName"/>
+ <module name="LocalFinalVariableName"/>
+ <module name="LocalVariableName"/>
+ <module name="MemberName"/>
+ <module name="MethodName"/>
+ <module name="PackageName"/>
+ <module name="ParameterName"/>
+ <module name="StaticVariableName"/>
+ <module name="TypeName"/>
+ <module name="AvoidStarImport"/>
+ <module name="IllegalImport"/>
+ <module name="RedundantImport"/>
+ <module name="UnusedImports"/>
+ <module name="MethodLength">
+ <property name="max" value="70"/>
+ </module>
+ <module name="ParameterNumber">
+ <property name="max" value="5"/>
+ </module>
+ <module name="EmptyForIteratorPad"/>
+ <module name="MethodParamPad"/>
+ <module name="ModifierOrder"/>
+ <module name="AvoidNestedBlocks"/>
+ <module name="LeftCurly"/>
+ <module name="NeedBraces"/>
+ <module name="RightCurly"/>
+ <module name="EmptyStatement"/>
+ <module name="EqualsHashCode"/>
+ <module name="HiddenField"/>
+ <module name="IllegalInstantiation"/>
+ <module name="InnerAssignment"/>
+ <module name="MissingSwitchDefault"/>
+ <module name="SimplifyBooleanExpression"/>
+ <module name="SimplifyBooleanReturn"/>
+ <module name="FinalClass"/>
+ <module name="HideUtilityClassConstructor"/>
+ <module name="VisibilityModifier"/>
+ <module name="ArrayTypeStyle"/>
+ <module name="UpperEll"/>
+ <module name="AnonInnerLength"/>
+ <module name="EmptyForInitializerPad"/>
+ <module name="CovariantEquals"/>
+ <module name="DefaultComesLast"/>
+ <module name="DeclarationOrder"/>
+ <module name="ExplicitInitialization"/>
+ <module name="FallThrough"/>
+ <module name="IllegalThrows"/>
+ <module name="MultipleVariableDeclarations"/>
+ <module name="PackageDeclaration"/>
+ <module name="ParameterAssignment"/>
+ <module name="ReturnCount">
+ <property name="max" value="8"/>
+ <property name="maxForVoid" value="8"/>
+ </module>
+ <module name="StringLiteralEquality"/>
+ <module name="SuperFinalize"/>
+ <module name="ArrayTrailingComma"/>
+ <module name="UnnecessaryParentheses"/>
+ <module name="MutableException"/>
+ <module name="ThrowsCount">
+ <property name="max" value="3"/>
+ </module>
+ <module name="CyclomaticComplexity"/>
+ <module name="TrailingComment"/>
+ <module name="EqualsAvoidNull"/>
+ <module name="ModifiedControlVariable"/>
+ <module name="FinalParameters">
+ <property name="tokens" value="METHOD_DEF,CTOR_DEF,LITERAL_CATCH"/>
+ </module>
+ <module name="FinalLocalVariable">
+ <property name="tokens" value="PARAMETER_DEF,VARIABLE_DEF"/>
+ <property name="validateEnhancedForLoopVariable" value="true"/>
+ </module>
+ <module name="SuppressionCommentFilter">
+ <property name="offCommentFormat" value="\bCheck[Ss]tyle:\s*([\w|]+)\s+OFF\b"/>
+ <property name="onCommentFormat" value="\bCheck[Ss]tyle:\s*([\w|]+)\s+ON\b"/>
+ <property name="checkFormat" value="$1"/>
+ </module>
+ <module name="MissingJavadocMethod"/>
+ <module name="MissingJavadocPackage"/>
+ <module name="MissingJavadocType"/>
+ <module name="InvalidJavadocPosition"/>
+ </module>
+ <module name="FileTabCharacter"/>
+ <module name="FileLength">
+ <property name="max" value="1000"/>
+ </module>
+ <module name="Header">
+ <property name="header" value="/*\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, eit [...]
+ </module>
+ <module name="JavadocPackage"/>
+ <module name="LineLength">
+ <property name="max" value="120"/>
+ </module>
+</module>
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list