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

templates.j2ee.maven2.webservice.pom.xml.vsl Maven / Gradle / Ivy

The newest version!
<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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>$applicationPackage</groupId>
        <artifactId>$applicationId</artifactId>
        <version>$applicationVersion</version>
    </parent>
    <artifactId>${applicationId}-webservice</artifactId>
    <packaging>war</packaging>
    <name>${applicationName} Web Services</name>
    <dependencies>
#if (!$transactionPersistenceType.equals("none") || $cxf)
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>${applicationId}-core</artifactId>
            <version>${project.version}</version>
        </dependency>
#end
#if ($jaxws)
        <dependency>
            <groupId>com.sun.webservices</groupId>
            <artifactId>webservices-rt</artifactId>
            <version>2.1.2</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.sun.webservices</groupId>
            <artifactId>webservices-tools</artifactId>
            <version>2.1.2</version>
            <scope>runtime</scope>
        </dependency>
    </dependencies>
#elseif ($cxf)
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
        </dependency>
        <!-- Includes spring core, beans, and context -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context-support</artifactId>
        </dependency>
        <!-- Includes org.springframework.web.context.ContextLoaderListener -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <!-- Depending on your requirements you may need to exclude some dependencies from cxf, spring -->
        <!-- Uncomment if using JMS transport. Includes spring-tx >
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jms</artifactId>
            <version>${spring.version}</version>
        </dependency-->
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-bundle</artifactId>
            <exclusions>
                <!-- Spring components cause classloader issue with Jetty test, just include spring bundle -->
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring-core</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring-beans</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring-context</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring-context-support</artifactId>
                </exclusion>
#if ($spring)
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring-dao</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring-jms</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring-pool</artifactId>
                </exclusion>
#end
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring-tx</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring-web</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <!-- Jetty is needed for building/testing the CXFServlet (creates geronimo dependencies) -->
        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-server</artifactId>
            <version>${jetty.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-webapp</artifactId>
            <version>${jetty.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-continuation</artifactId>
            <version>${jetty.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-http</artifactId>
            <version>${jetty.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-io</artifactId>
            <version>${jetty.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-util</artifactId>
            <version>${jetty.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-security</artifactId>
            <version>${jetty.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <!-- If using Websphere or IBM JVM, uncomment JAXP dependencies >
        <dependency>
            <groupId>com.sun.xml</groupId>
            <artifactId>jaxp-ri</artifactId>
            <version>1.4.2</version>
        </dependency>
        <dependency>
            <groupId>javax.xml</groupId>
            <artifactId>jaxp-api</artifactId>
            <version>1.4.2</version>
        </dependency> -->
#end
    </dependencies>
    <build>
        <finalName>${application.id}-webservice</finalName>
        <!-- Change from default src/main/java and src/test/java>
        <sourceDirectory>src</sourceDirectory>
        <testSourceDirectory>src-test</testSourceDirectory -->
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.2</version>
                <configuration>
                    <!-- Default for maven is src/main/webapp. WebContent is Eclipse convention. -->
                    <warSourceDirectory>src/main/webapp</warSourceDirectory>
                    <warName>${project.artifactId}</warName>
                    <excludes>**/*.java</excludes>
                    <!-- Even though these dependencies are 'provided', they are still bundled with the war file. Modify as necessary.
                         Exclude everything not already included in the EAR. -->
                    <packagingExcludes>**/*.java,**/*.ref,**/andromda-*.jar,**/active*.jar,**/antlr*.jar,**/backport*.jar,**/bsh*.jar,**/*-pool.jar,**/cxf-rt*.jar,**/cxf-api*.jar,**/cxf-common*.jar,**/cxf-tools*.jar,**/dom4j*.jar,**/ehcache*.jar,**/geronimo-*.jar,**/groovy*.jar,**/jaxb-xjc*.jar,**/jetty*.jar,**/jaxen*.jar,**/jdom*.jar,**/oro-*.jar,**/qdox*.jar,**/saaj*.jar,**/spring-2.0.8.jar,**/stax*.jar,**/woodstox*.jar,**/xerces*.jar,**/xml-api*.jar,**/xmlbean*.jar</packagingExcludes>
                    <archive>
                        <manifest>
                          <addClasspath>true</addClasspath>
                          <useUniqueVersions>false</useUniqueVersions>
                          <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                          <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                        </manifest>
                        <manifestEntries>
                          <Implementation-Build>${maven.build.timestamp}</Implementation-Build>
                          <url>${project.url}</url>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>
            <!-- See http://wiki.eclipse.org/Jetty/Reference and http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin -->
            <!-- If you see ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
                and are running maven2, switch jetty.version to 7.x. v8 requires maven3 -->
#if ($embeddedJetty)
            <plugin>
#else
            <!--plugin>
#end
                <groupId>org.mortbay.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
                <configuration>
                    <connectors>
                       <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
                          <port>${service.port}</port>
                          <maxIdleTime>60000</maxIdleTime>
                       </connector>
                    </connectors>
                    <webAppSourceDirectory>${project.basedir}/src/main/webapp</webAppSourceDirectory>
                    <webAppConfig>
                        <overrideDescriptor>${project.basedir}/src/main/webapp/WEB-INF/web.xml</overrideDescriptor>
                        <contextPath>/${project.artifactId}</contextPath>
                    </webAppConfig>
                    <connectors>
                       <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
                          <port>${service.port}</port>
                          <maxIdleTime>60000</maxIdleTime>
                       </connector>
                     </connectors>
                    <useTestClasspath>true</useTestClasspath>
                    <scanIntervalSeconds>10</scanIntervalSeconds>
                    <stopKey>foo</stopKey>
                    <stopPort>9999</stopPort>
                </configuration>
                <executions>
                    <execution>
                        <id>start-jetty</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                           <scanIntervalSeconds>0</scanIntervalSeconds>
                           <daemon>true</daemon>
                        </configuration>
                    </execution>
                    <execution>
                        <id>stop-jetty</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>stop</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin#if (!$embeddedJetty)--#end>
            <plugin>
                <artifactId>maven-source-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
#if ($cxf)
    <properties>
        <!-- maven.test.skip>true</maven.test.skip -->
    </properties>
#end
</project>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy