<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.cysbml</groupId>
    <artifactId>cy3sbml</artifactId>
    <version>0.9.0</version>
    <packaging>bundle</packaging>
    <name>${bundle.symbolicName}</name>
    <description>A Cytoscape app for SBML.</description>
    <url>https://github.com/matthiaskoenig/cy3sbml</url>

    <properties>
        <bundle.symbolicName>cy3sbml</bundle.symbolicName>
        <bundle.namespace>org.cy3sbml</bundle.namespace>
        <cytoscape.api.version>3.10.0</cytoscape.api.version>
        <maven.compiler.release>17</maven.compiler.release>
        <error-prone.version>2.50.0</error-prone.version>
        <maven-bundle-plugin.version>6.2.0</maven-bundle-plugin.version>
        <osgi.api.version>7.0.0</osgi.api.version>
        <slf4j.version>2.0.20</slf4j.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <org.osgi.framework.bootdelegation>netscape.javascript</org.osgi.framework.bootdelegation>
        <enforcer.skipReleaseDeps>false</enforcer.skipReleaseDeps>
        <!-- JSBML jars in lib/cy3sbml-dep, built from one sbmlteam/jsbml commit:
            <JSBML version>-<commit date>-<short sha>. Both properties are set by
            scripts/update_jsbml.py, see docs/development/dependencies.md. -->
        <jsbml.version>1.7-20260929-7b28ca71</jsbml.version>
        <!-- The same JSBML version as an OSGi version, used for the exported
            org.sbml.jsbml packages. -->
        <jsbml.osgi.version>1.7.0.20260929-7b28ca71</jsbml.osgi.version>
        <!-- biojava-ontology, embedded as a nested jar for JSBML (org.sbml.jsbml.SBO);
            also passed to BundleJarContentIT, which checks the nested jar by name -->
        <biojava.version>7.3.0</biojava.version>
        <!-- JUnit tag-based test selection. By default the "network" (hits web
            services) and "models" (long-running model test suites) tagged tests
            are excluded. Run with -Pall-tests for everything, or select the
            network tests with -Dtest.groups=network -Dtest.excludedGroups= -->
        <test.excludedGroups>network,models</test.excludedGroups>
        <test.groups/>
        <!-- set by the JaCoCo agent; empty when JaCoCo is skipped (-Djacoco.skip) -->
        <argLine/>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.junit</groupId>
                <artifactId>junit-bom</artifactId>
                <version>6.1.3</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <!-- Cytoscape 3 dependency -->
        <dependency>
            <groupId>org.cytoscape</groupId>
            <artifactId>model-api</artifactId>
            <version>${cytoscape.api.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.cytoscape</groupId>
            <artifactId>application-api</artifactId>
            <version>${cytoscape.api.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.cytoscape</groupId>
            <artifactId>swing-application-api</artifactId>
            <version>${cytoscape.api.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.cytoscape</groupId>
            <artifactId>swing-util-api</artifactId>
            <version>${cytoscape.api.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.cytoscape</groupId>
            <artifactId>viewmodel-api</artifactId>
            <version>${cytoscape.api.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.cytoscape</groupId>
            <artifactId>io-api</artifactId>
            <version>${cytoscape.api.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.cytoscape</groupId>
            <artifactId>work-api</artifactId>
            <version>${cytoscape.api.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.cytoscape</groupId>
            <artifactId>work-swing-api</artifactId>
            <version>${cytoscape.api.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.cytoscape</groupId>
            <artifactId>service-api</artifactId>
            <version>${cytoscape.api.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.cytoscape</groupId>
            <artifactId>session-api</artifactId>
            <version>${cytoscape.api.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.cytoscape</groupId>
            <artifactId>vizmap-api</artifactId>
            <version>${cytoscape.api.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.cytoscape</groupId>
            <artifactId>core-task-api</artifactId>
            <version>${cytoscape.api.version}</version>
            <scope>provided</scope>
        </dependency>
        <!-- NodeList arguments of the automation commands -->
        <dependency>
            <groupId>org.cytoscape</groupId>
            <artifactId>command-executor-api</artifactId>
            <version>${cytoscape.api.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.cytoscape</groupId>
            <artifactId>layout-api</artifactId>
            <version>${cytoscape.api.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.cytoscape</groupId>
            <artifactId>property-api</artifactId>
            <version>${cytoscape.api.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.cytoscape</groupId>
            <artifactId>group-api</artifactId>
            <version>${cytoscape.api.version}</version>
            <scope>provided</scope>
        </dependency>

        <!-- JavaFX: javafx-web (WebView) and javafx-swing (JFXPanel) bring the other
            modules (base, graphics, controls, media) with the platform-specific jars. -->
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-swing</artifactId>
            <version>17.0.20</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-web</artifactId>
            <version>17.0.20</version>
            <scope>provided</scope>
        </dependency>

        <!-- OSGi core dependency -->
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>osgi.core</artifactId>
            <version>${osgi.api.version}</version>
            <scope>provided</scope>
        </dependency>
        <!-- The OSGi package above is annotated with @Version; without this
            jar javac warns that it cannot find the annotation (fails -Werror). -->
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.annotation.versioning</artifactId>
            <version>1.1.2</version>
            <scope>provided</scope>
        </dependency>

        <!-- REST clients (org.cy3sbml.ols.OlsClient, org.cy3sbml.uniprot.UniprotAccess,
            org.cy3sbml.chebi.ChebiAccess) -->
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>2.22.3</version>
        </dependency>

        <!-- Logging -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${slf4j.version}</version>
        </dependency>

        <!-- slf4j runtime binding (app: src/main/resources/logback.xml, tests: src/test/resources/logback-test.xml) -->
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>1.6.4</version>
        </dependency>
        <!-- JSBML logs with the log4j 1.x API (org.apache.log4j.Logger); log4j-over-slf4j
            implements that API on top of slf4j, so JSBML logs through logback with the
            cy3sbml configuration (logback.xml, logback-test.xml). -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>log4j-over-slf4j</artifactId>
            <version>${slf4j.version}</version>
        </dependency>

        <dependency>
            <groupId>cy3sbml-dep</groupId>
            <artifactId>jsbml</artifactId>
            <version>${jsbml.version}</version>
        </dependency>
        <dependency>
            <groupId>cy3sbml-dep</groupId>
            <artifactId>jsbml-qual</artifactId>
            <version>${jsbml.version}</version>
        </dependency>
        <dependency>
            <groupId>cy3sbml-dep</groupId>
            <artifactId>jsbml-layout</artifactId>
            <version>${jsbml.version}</version>
        </dependency>
        <dependency>
            <groupId>cy3sbml-dep</groupId>
            <artifactId>jsbml-comp</artifactId>
            <version>${jsbml.version}</version>
        </dependency>
        <dependency>
            <groupId>cy3sbml-dep</groupId>
            <artifactId>jsbml-fbc</artifactId>
            <version>${jsbml.version}</version>
        </dependency>
        <dependency>
            <groupId>cy3sbml-dep</groupId>
            <artifactId>jsbml-groups</artifactId>
            <version>${jsbml.version}</version>
        </dependency>
        <dependency>
            <groupId>cy3sbml-dep</groupId>
            <artifactId>jsbml-distrib</artifactId>
            <version>${jsbml.version}</version>
        </dependency>
        <dependency>
            <groupId>cy3sbml-dep</groupId>
            <artifactId>jsbml-tidy</artifactId>
            <version>${jsbml.version}</version>
        </dependency>
        <dependency>
            <groupId>cy3sbml-dep</groupId>
            <artifactId>jtidy</artifactId>
            <version>r938</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.woodstox</groupId>
            <artifactId>woodstox-core</artifactId>
            <version>7.3.0</version>
        </dependency>
        <!-- Used by org.sbml.jsbml.xml.parsers.SBMLRDFAnnotationParser (org.w3c.util.DateParser
            and InvalidDateException, for RDF annotation dates), loaded via
            annotationParsers.xml whenever an SBML file with RDF annotations is read; removing
            it breaks every SBML model read (confirmed by running the model tests). -->
        <dependency>
            <groupId>org.w3c.jigsaw</groupId>
            <artifactId>jigsaw</artifactId>
            <version>2.2.6</version>
        </dependency>
        <!-- Used by org.sbml.jsbml.validator.offline.factory.SBMLErrorFactory, which creates the
            errors JSBML throws for invalid values (e.g. an undefined unit), see
            JsbmlDependenciesTest. -->
        <dependency>
            <groupId>com.googlecode.json-simple</groupId>
            <artifactId>json-simple</artifactId>
            <version>1.1.1</version>
            <exclusions>
                <exclusion>
                    <groupId>junit</groupId>
                    <artifactId>junit</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <!-- Used by org.sbml.jsbml.xml.stax.SBMLWriter and
            org.sbml.jsbml.util.compilers.MathMLXMLStreamCompiler; confirmed with jdeps. -->
        <dependency>
            <groupId>com.fasterxml.staxmate</groupId>
            <artifactId>staxmate</artifactId>
            <version>2.4.2</version>
        </dependency>

        <dependency>
            <groupId>org.biojava</groupId>
            <artifactId>biojava-ontology</artifactId>
            <version>${biojava.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.logging.log4j</groupId>
                    <artifactId>log4j-slf4j-impl</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.logging.log4j</groupId>
                    <artifactId>log4j-slf4j2-impl</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.logging.log4j</groupId>
                    <artifactId>log4j-core</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.logging.log4j</groupId>
                    <artifactId>log4j-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <!-- Testing -->
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>5.24.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-junit-jupiter</artifactId>
            <version>5.24.0</version>
            <scope>test</scope>
        </dependency>

        <!-- version managed by the org.junit:junit-bom import above -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>
        <!-- LauncherSessionListener (JsbmlSetupListener) -->
        <dependency>
            <groupId>org.junit.platform</groupId>
            <artifactId>junit-platform-launcher</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.cytoscape</groupId>
            <artifactId>event-api</artifactId>
            <version>${cytoscape.api.version}</version>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.cytoscape</groupId>
            <artifactId>model-impl</artifactId>
            <version>${cytoscape.api.version}</version>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.cytoscape</groupId>
            <artifactId>model-impl</artifactId>
            <version>${cytoscape.api.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.cytoscape</groupId>
            <artifactId>group-impl</artifactId>
            <version>${cytoscape.api.version}</version>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.cytoscape</groupId>
            <artifactId>group-impl</artifactId>
            <version>${cytoscape.api.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.cytoscape</groupId>
            <artifactId>ding-presentation-impl</artifactId>
            <version>${cytoscape.api.version}</version>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.cytoscape</groupId>
            <artifactId>ding-presentation-impl</artifactId>
            <version>${cytoscape.api.version}</version>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <repositories>
        <!-- Cytoscape -->
        <repository>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <id>cytoscape_releases</id>
            <name>Cytoscape Releases</name>
            <url>https://nrnb-nexus.ucsd.edu/repository/cytoscape_releases/</url>
        </repository>
        <repository>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <id>cytoscape_thirdparty</id>
            <name>Cytoscape Thirdparty</name>
            <url>https://nrnb-nexus.ucsd.edu/repository/cytoscape_thirdparty/</url>
        </repository>
        <!-- JSBML  -->
        <repository>
            <id>in-project</id>
            <name>In project repository</name>
            <url>file:${project.basedir}/lib</url>
        </repository>
    </repositories>

    <build>
        <plugins>
            <!-- bundle -->
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>${maven-bundle-plugin.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <!-- The BND instructions for the bundle -->
                    <instructions>
                        <Bundle-SymbolicName>${bundle.symbolicName}</Bundle-SymbolicName>
                        <Bundle-Version>${project.version}</Bundle-Version>
                        <Export-Package>${bundle.namespace}.*;version="${project.version}"</Export-Package>
                        <!-- The JSBML types are part of the API of the SBMLManager service, so
                            org.sbml.jsbml.* (inlined from the jsbml jars, see Embed-Dependency) is
                            exported, with the JSBML version instead of the app version. -->
                        <_exportcontents>org.sbml.jsbml.*;version="${jsbml.osgi.version}"</_exportcontents>
                        <Private-Package>${bundle.namespace}.*</Private-Package>
                        <Bundle-Activator>${bundle.namespace}.CyActivator</Bundle-Activator>
                        <!-- The jsbml/jsbml-* jars (built without their test classes by
                            scripts/update_jsbml.py) are inlined, i.e. their org/** classes and
                            resources are copied into the bundle, so that org.sbml.jsbml.* can be
                            exported; their META-INF (manifest and the ServiceLoader files, which
                            would overwrite each other) is left out, JSBML falls back to its
                            built-in parser list without them. All other dependencies, jtidy
                            included, are embedded as nested jars. -->
                        <Embed-Dependency>*;scope=!provided|test;groupId=!org.cytoscape;artifactId=!jsbml*,
                            jsbml*;groupId=cy3sbml-dep;scope=!provided|test;inline=org/**</Embed-Dependency>
                        <Embed-Transitive>true</Embed-Transitive>
                        <DynamicImport-Package>netscape.javascript</DynamicImport-Package>
                        <!-- do not turn the bnd @ServiceProvider annotations of embedded jars
                            (woodstox 7) into an osgi.serviceloader.registrar requirement, which
                            Cytoscape does not provide; see BundleJarContentIT -->
                        <_metainf-services>none</_metainf-services>
                        <!-- biojava-ontology 7.x ships a stray package-info.class in the
                            default package; bnd rejects a reference to the default package even
                            though that class is never loaded, so the error is downgraded -->
                        <_fixupmessages>"The default package '.' is not permitted";is:=warning</_fixupmessages>
                        <Import-Package>javax.xml.namespace, *;resolution:=optional</Import-Package>
                    </instructions>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.16.0</version>
                <inherited>true</inherited>
                <configuration>
                    <encoding>UTF-8</encoding>
                    <showWarnings>true</showWarnings>
                    <showDeprecation>true</showDeprecation>
                    <compilerArgs>
                        <arg>-Xmaxwarns</arg>
                        <arg>10000</arg>
                        <arg>-Xmaxerrs</arg>
                        <arg>10000</arg>
                    </compilerArgs>
                </configuration>
            </plugin>

            <!-- resources -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>3.5.0</version>
            </plugin>
            <!-- jar -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.5.1</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-install-plugin</artifactId>
                <version>3.2.0</version>
            </plugin>
            <!-- pinned: the bundle packaging does not bind a version, so Maven
                resolves the newest one and warns about the Maven 4 betas -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>3.2.0</version>
            </plugin>
            <!-- javadoc: the javadoc jar is built by the javadoc profile (CI and
                releases), the configuration also applies to `javadoc:javadoc` -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.12.0</version>
                <configuration>
                    <quiet>true</quiet>
                    <!-- all checks except missing comments, and warnings fail the build -->
                    <doclint>all,-missing</doclint>
                    <failOnWarnings>true</failOnWarnings>
                    <doctitle>cy3sbml ${project.version} API</doctitle>
                    <windowtitle>cy3sbml ${project.version} API</windowtitle>
                </configuration>
            </plugin>

            <!-- testing -->
            <!-- sets the property org.mockito:mockito-core:jar (path of the jar) for the
                surefire argLine -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>3.11.0</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>properties</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.6.0</version>
                <configuration>
                    <!-- @{argLine} is the JaCoCo agent. Mockito's inline mock maker is loaded
                        as an agent at startup instead of attaching itself at runtime, which
                        newer JDKs warn about and will disallow. With an agent on the boot class
                        path the JVM warns that class data sharing is limited, so it is off.
                        The tests run headless, so AWT never connects to a display: with a
                        DISPLAY that cannot be opened, the Cytoscape visual lexicons fail to
                        initialize. -->
                    <argLine>@{argLine} -javaagent:${org.mockito:mockito-core:jar} -Xshare:off -Djava.awt.headless=true</argLine>
                    <groups>${test.groups}</groups>
                    <excludedGroups>${test.excludedGroups}</excludedGroups>
                    <!-- The large model corpora (BiGG, BioModels, SBML test suite, about
                        1.2 GB) are read from the classpath (/models/...) but are not test
                        resources, so they are not copied to target/test-classes on every
                        build; the directory is added to the test classpath as it is. -->
                    <additionalClasspathElements>
                        <additionalClasspathElement>${project.basedir}/src/test/corpora</additionalClasspathElement>
                    </additionalClasspathElements>
                </configuration>

            </plugin>

            <!-- packaged-bundle integration tests (*IT.java), run in the integration-test/
                verify phases against the already-packaged target/cy3sbml-<version>.jar, e.g.
                BundleJarContentIT checks the jar itself has the resources the app needs at
                runtime (a resource missing from the packaged jar aborts CyActivator.start and
                hands SBML imports to Cytoscape's own bundled SBML app; a unit test running
                against target/classes cannot catch that, since target/classes still has
                everything). -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>3.6.0</version>
                <configuration>
                    <systemPropertyVariables>
                        <cy3sbml.bundle.jar>${project.build.directory}/${project.build.finalName}.jar</cy3sbml.bundle.jar>
                        <biojava.version>${biojava.version}</biojava.version>
                    </systemPropertyVariables>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- coverage -->
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.8.15</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>report</id>
                        <goals>
                            <goal>report</goal>
                        </goals>
                        <phase>test</phase>
                    </execution>
                </executions>
            </plugin>

            <!-- enforce build environment and dependency hygiene -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>3.6.3</version>
                <dependencies>
                    <dependency>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>extra-enforcer-rules</artifactId>
                        <version>1.12.1</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <id>enforce-build-environment</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireJavaVersion>
                                    <version>[17,)</version>
                                </requireJavaVersion>
                                <requireMavenVersion>
                                    <version>[3.9,)</version>
                                </requireMavenVersion>
                                <banDuplicatePomDependencyVersions/>
                                <banDuplicateClasses>
                                    <scopes>
                                        <scope>compile</scope>
                                        <scope>runtime</scope>
                                    </scopes>
                                    <findAllDuplicates>true</findAllDuplicates>
                                    <ignoreWhenIdentical>true</ignoreWhenIdentical>
                                </banDuplicateClasses>
                            </rules>
                            <fail>true</fail>
                        </configuration>
                    </execution>
                    <execution>
                        <id>enforce-release-dependencies</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <skip>${enforcer.skipReleaseDeps}</skip>
                            <rules>
                                <requireReleaseDeps/>
                            </rules>
                            <fail>true</fail>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- formatting -->
            <plugin>
                <groupId>com.diffplug.spotless</groupId>
                <artifactId>spotless-maven-plugin</artifactId>
                <version>3.10.3</version>
                <configuration>
                    <java>
                        <palantirJavaFormat>
                            <version>2.99.0</version>
                        </palantirJavaFormat>
                        <removeUnusedImports/>
                        <importOrder/>
                        <trimTrailingWhitespace/>
                        <endWithNewline/>
                    </java>
                    <pom>
                        <sortPom>
                            <nrOfIndentSpace>4</nrOfIndentSpace>
                            <expandEmptyElements>false</expandEmptyElements>
                        </sortPom>
                    </pom>
                </configuration>
            </plugin>

        </plugins>
    </build>

    <profiles>
        <!-- Run all tests, including the network and models tagged tests. -->
        <profile>
            <id>all-tests</id>
            <properties>
                <test.excludedGroups/>
            </properties>
        </profile>
        <!-- Check the code with Error Prone and fail on compiler warnings.
            Error Prone needs JDK 21 or newer to run, the code still compiles with
            release 17. The JVM flags Error Prone needs are in .mvn/jvm.config. -->
        <profile>
            <id>lint</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <configuration>
                            <compilerArgs combine.children="append">
                                <arg>-XDcompilePolicy=simple</arg>
                                <!-- required by Error Prone on JDK 21 -->
                                <arg>-XDaddTypeAnnotationsToSymbol=true</arg>
                                <arg>--should-stop=ifError=FLOW</arg>
                                <arg>-Xplugin:ErrorProne</arg>
                                <arg>-Xlint:all,-processing,-serial</arg>
                                <arg>-Werror</arg>
                            </compilerArgs>
                            <annotationProcessorPaths>
                                <path>
                                    <groupId>com.google.errorprone</groupId>
                                    <artifactId>error_prone_core</artifactId>
                                    <version>${error-prone.version}</version>
                                </path>
                            </annotationProcessorPaths>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <!-- Build the javadoc jar (target/cy3sbml-<version>-javadoc.jar) in the
            package phase. Used by CI and the release workflow; needs a full JDK
            (the javadoc tool). -->
        <profile>
            <id>javadoc</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-javadoc</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
