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

.main.appclient.acc-config.8.0.0-M7.source-code.pom.xml Maven / Gradle / Ivy

There is a newer version: 8.0.0-JDK17-M7
Show newest version
<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved.

    This program and the accompanying materials are made available under the
    terms of the Eclipse Public License v. 2.0, which is available at
    http://www.eclipse.org/legal/epl-2.0.

    This Source Code may also be made available under the following Secondary
    Licenses when the conditions for such availability set forth in the
    Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
    version 2 with the GNU Classpath Exception, which is available at
    https://www.gnu.org/software/classpath/license.html.

    SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0

-->

<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.glassfish.main.appclient</groupId>
        <artifactId>client</artifactId>
        <version>8.0.0-M7</version>
    </parent>

    <artifactId>acc-config</artifactId>
    <packaging>glassfish-jar</packaging>

    <name>ACC Config Classes (JAXB)</name>

    <developers>
        <developer>
            <id>tjquinn</id>
            <name>Tim Quinn</name>
            <url>http://blogs.sun.com/quinn</url>
            <organization>Oracle, Inc.</organization>
            <roles>
                <role>lead</role>
                <role>developer</role>
            </roles>
        </developer>
    </developers>

    <!--
        This module contains classes for the app client configuration XML,
        generated using JAXB from sun-application-client-container_x_y.dtd.
    -->
    <properties>
        <extracted-dtd-root>target/extracted</extracted-dtd-root>
        <extracted-dtd-top-level-directory>${extracted-dtd-root}/glassfish</extracted-dtd-top-level-directory>
        <extracted-dtd-directory>${extracted-dtd-top-level-directory}/lib/dtds</extracted-dtd-directory>
        <dtd-for-jaxb-compilation>glassfish-application-client-container_1_3.dtd</dtd-for-jaxb-compilation>
        <config-dtd-file>*-application-client-container*.dtd</config-dtd-file>
        <added-test-classpath>${project.basedir}/${extracted-dtd-root}</added-test-classpath>
        <findbugs.exclude>${project.basedir}/exclude.xml</findbugs.exclude>
        <!-- We don't need it here and it would fail -->
        <glassfish.generate-injectors.skip>true</glassfish.generate-injectors.skip>
    </properties>

    <dependencies>
        <!--
            We depend on the deployment/dtds module which contains the sun-application-client-container_1_2.dtd
            and glassfish-application-client-container_1_3.dtd.

            We use that for generating JAXB classes but we do not want to package the DTD with the ACC module, nor
            do we want the ACC module depending on the deploymenet/dtds module at runtime.

            Note the scope is "provided" to indicate this.
        -->
        <dependency>
            <groupId>org.glassfish.main.deployment</groupId>
            <artifactId>appserver-dtds</artifactId>
            <version>${project.version}</version>
            <type>zip</type>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>jakarta.xml.bind</groupId>
            <artifactId>jakarta.xml.bind-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.sun.xml.bind</groupId>
            <artifactId>jaxb-osgi</artifactId>
        </dependency>

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest</artifactId>
        </dependency>
    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.properties</include>
                </includes>
            </resource>
        </resources>
        <plugins>
            <!-- Extracts the DTD(s) from the deployment/dtds module into
                a temp file. The "generate" phase will use it to create JAXB classes. Unit
                tests use both DTDs for parse testing. -->
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>unpack-dtd</id>
                        <phase>initialize</phase> <!-- make sure this is before generate -->
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>org.glassfish.main.deployment</groupId>
                                    <artifactId>appserver-dtds</artifactId>
                                    <version>${project.version}</version>
                                    <type>zip</type>
                                    <includes>**/${config-dtd-file}</includes>
                                    <overWrite>true</overWrite>
                                    <outputDirectory>${extracted-dtd-root}</outputDirectory>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- Generates JAXB classes based on the ACC configuration file
                DTD. -->
            <!--
                XXX: no maven plugin for jakarta xml binding impl exists,
                so we have to stick with Ant
                and attach source root to the build ourselves...
            -->
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <dependencies>
                    <dependency>
                        <groupId>com.sun.xml.bind</groupId>
                        <artifactId>jaxb-xjc</artifactId>
                        <version>${jakarta.jaxb-impl.version}</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <id>xjc-gen-for-glassfish-acc</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <target>
                                <taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask" classpathref="maven.plugin.classpath"/>
                                <property name="dest" location="${project.build.directory}/generated-sources/xjc"/>
                                <mkdir dir="${dest}"/>
                                <xjc destdir="${dest}" fork="true"
                                     schema="${project.basedir}/${extracted-dtd-directory}/${dtd-for-jaxb-compilation}"
                                     package="org.glassfish.appclient.client.acc.config">
                                    <binding dir="${project.basedir}/src/main/resources" includes="configBindings.xml"/>
                                    <arg value="-dtd"/>
                                    <jvmarg value="-DenableExternalEntityProcessing=true"/>
                                </xjc>
                            </target>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>add-sources</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${project.build.directory}/generated-sources/xjc</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <additionalClasspathElements>
                        <additionalClasspathElement>${added-test-classpath}</additionalClasspathElement>
                    </additionalClasspathElements>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy