Guidance for building POMs


It is expected that this will end up in the Plugin documentation – for now this is just for discussion

When building the POM for a plugin there are multiple goals.

  1. We want the POM to represent dependency on a consistent state of an IdP (this would usually be the minimum IdP version the plugin supports).
  2. We want to avoid any dependency leakage from the IdP into the plugin (and any projects deriving from the IdP).
  3. We want to avoid the project or plugin developer from accidentally shipping jars in the plugin which are subject to restrictive licenses that do not allow us to ship them. Such Jars need to be downloaded by the deployer and there is an infrastructure that deploys this.

We, therefore, have come up with the following guidance:

Project Naming

Just sketching out and recording some plausible naming conventions for the project's own plugins...

The examples are based on a plugin providing a "feature".

Git Repo: java-idp-plugin-feature

Parent POM coordinates:

    <name>Shibboleth IdP :: Plugins :: Feature</name>
    <groupId>net.shibboleth.idp.plugin</groupId>
    <artifactId>idp-plugin-feature</artifactId>

Typical submodules:

    <modules>
        <module>feature-api</module> <!-- perhaps, many plugins won't have an API -->
        <module>feature-impl</module>
        <module>feature-dist</module>
    </modules>

Implementation POM:

    <name>Shibboleth IdP :: Plugins :: Feature Impl</name>
    <artifactId>idp-plugin-feature-impl</artifactId>

    <properties>
        <automatic.module.name>net.shibboleth.idp.plugin.feature.impl</automatic.module.name>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-dependencies</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.target.directory}</outputDirectory>
                            <includeScope>runtime</includeScope>
                            <excludeTransitive>true</excludeTransitive>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId> 
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifestEntries>
                            <Automatic-Module-Name>${automatic.module.name}</Automatic-Module-Name>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>
        </plugins>
    </build>

Distribution POM:

    <name>Shibboleth IdP :: Plugins :: Feature Distribution</name>
    <artifactId>idp-plugin-feature-dist</artifactId>
    <packaging>pom</packaging>

    <properties>
        <dist.finalName>shibboleth-idp-plugin-feature-${project.version}</dist.finalName>
    </properties>