| POM: |
Show
hide
<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>org.rhq</groupId>
<artifactId>rhq-parent</artifactId>
<version>4.6.0</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
<artifactId>rhq-enterprise-server</artifactId>
<packaging>ejb</packaging>
<name>RHQ Enterprise Server JAR</name>
<description>RHQ enterprise server main JAR</description>
<properties>
<clean.db>true</clean.db>
<rhq.internal>false</rhq.internal>
</properties>
<dependencies>
<!-- Internal Deps -->
<!-- rhq-enterprise-comm pulls in the old version of jboss remoting. The old version of remoting
depends on jboss/jboss-common/1.2.1.GA/jboss-common-1.2.1.GA.jar, which includes on old
implementation of the org.jboss.logging package. Arquillian testing leverages AS7 modules
(xnio e.g.) that require the up to date logging impl. Since server jar depends on
rhq-enterprise-comm to run, and arquillian to test, place the current version jboss-logging
as a dependency before the rhq-comm dependency. This ensure the classpath is set up to use the
newer package impl. -->
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
<version>${jboss-logging.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-comm</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.rhq</groupId>
<artifactId>rhq-enterprise-server-xml-schemas</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-domain</artifactId>
<version>${project.version}</version>
<scope>provided</scope> <!-- by ear -->
</dependency>
<dependency>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-client-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-dbutils</artifactId>
<version>${project.version}</version>
<exclusions>
<exclusion>
<groupId>ant</groupId>
<artifactId>ant</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.rhq</groupId>
<artifactId>safe-invoker</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.rhq</groupId>
<artifactId>rhq-common-drift</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.googlecode.java-diff-utils</groupId>
<artifactId>diffutils</artifactId>
<version>1.2.1</version>
</dependency>
<dependency>
<groupId>org.rhq</groupId>
<artifactId>rhq-jboss-as-dmr-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-server</artifactId>
<scope>provided</scope> <!-- provided by AS7 -->
</dependency>
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-naming</artifactId>
<scope>provided</scope> <!-- provided by AS7 -->
</dependency>
<!--================ Test Deps ================-->
<!-- Note, the test deps are intentionally placed above the other scoped deps because of classpath
reasons. Maven orders the [test] classpath in the order listed in the pom. -->
<dependency>
<groupId>org.jboss.spec</groupId>
<artifactId>jboss-javaee-6.0</artifactId>
<version>${jboss.javaee6.spec.version}</version>
<scope>provided</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.rhq</groupId>
<artifactId>test-utils</artifactId>
<version>${project.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- 3rd Party Deps -->
<!-- do we really need this version, for now use the version provided by AS7, declare just below -->
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr-runtime</artifactId>
<version>3.2</version>
<exclusions>
<exclusion>
<groupId>antlr</groupId>
<artifactId>antlr</artifactId>
</exclusion>
<exclusion>
<groupId>org.antlr</groupId>
<artifactId>antlr</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>antlr</groupId>
<artifactId>antlr</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-core</artifactId>
<version>${infinispan.version}</version>
<scope>provided</scope>
</dependency>
<!-- Required by a couple APL and Lather classes - TODO: Remove this once APL and Lather have been excised. -->
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.6.1</version>
</dependency>
<!-- Required by a couple APL classes - TODO: Remove this once APL has been removed. -->
<!-- also required by EJB3 Embedded (test scope) -->
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2</version>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>${commons-httpclient.version}</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.4</version>
</dependency>
<!-- Required by a couple APL classes - TODO: Remove this once APL has been removed. -->
<dependency>
<groupId>commons-validator</groupId>
<artifactId>commons-validator</artifactId>
<version>1.1.4</version>
</dependency>
<dependency>
<groupId>gnu-getopt</groupId>
<artifactId>getopt</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jboss</groupId>
<artifactId>jboss-cache</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jboss</groupId>
<artifactId>jboss-common-core</artifactId>
<scope>provided</scope>
</dependency>
<!-- JBoss annotations like @TransactionTimeout -->
<dependency>
<groupId>org.jboss.ejb3</groupId>
<artifactId>jboss-ejb3-ext-api</artifactId>
<scope>provided</scope>
</dependency>
<!-- annotations like @ExcludeDefaultInterceptors -->
<dependency>
<groupId>org.jboss.spec.javax.interceptor</groupId>
<artifactId>jboss-interceptors-api_1.1_spec</artifactId>
<scope>provided</scope>
</dependency>
<!-- annotations @javax.transaction.TransactionManager -->
<dependency>
<groupId>org.jboss.spec.javax.transaction</groupId>
<artifactId>jboss-transaction-api_1.1_spec</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.spec.javax.annotation</groupId>
<artifactId>jboss-annotations-api_1.1_spec</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.spec.javax.ejb</groupId>
<artifactId>jboss-ejb-api_3.1_spec</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.spec.javax.jms</groupId>
<artifactId>jboss-jms-api_1.1_spec</artifactId>
<scope>provided</scope>
</dependency>
<!-- for some Jboss custom things like code to obfuscate passwords -->
<dependency>
<groupId>org.picketbox</groupId>
<artifactId>picketbox</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.jbossts</groupId>
<artifactId>jbossjts</artifactId>
<version>${jboss-jts.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.opensymphony.quartz</groupId>
<artifactId>quartz</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
<scope>provided</scope> <!-- by JBossAS itself, which the container build has packaged with 1.6.5 -->
</dependency>
<dependency>
<groupId>org.opensymphony.quartz</groupId>
<artifactId>quartz-oracle</artifactId>
<!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
<scope>provided</scope> <!-- by JBossAS itself, which the container build has packaged with 1.6.5 -->
</dependency>
<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymockclassextension</artifactId>
<version>2.2</version>
<scope>test</scope>
<!-- somehow this is needed otherwise the hibernate stuff doesn't initialize in our tests -->
</dependency>
<dependency>
<groupId>org.snmp4j</groupId>
<artifactId>snmp4j</artifactId>
<version>1.8.2</version>
</dependency>
<!-- required by RHQ server classes, as well as EJB3 Embedded -->
<dependency>
<groupId>oswego-concurrent</groupId>
<artifactId>concurrent</artifactId>
<version>1.3.4</version>
</dependency>
<dependency>
<groupId>rss4j</groupId>
<artifactId>rss4j</artifactId>
<version>0.92-on.2</version>
</dependency>
<dependency>
<groupId>tomcat</groupId>
<artifactId>catalina</artifactId>
<version>5.5.20</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>tomcat</groupId>
<artifactId>tomcat-jk</artifactId>
<version>4.1.31</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.jcraft</groupId>
<artifactId>jsch</artifactId>
<version>0.1.29</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId>
<version>${resteasy.version}</version>
<scope>provided</scope> <!-- by container -->
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jackson-provider</artifactId>
<version>${resteasy.version}</version>
<scope>provided</scope> <!-- by container -->
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-links</artifactId>
<version>${resteasy.version}</version>
<scope>provided</scope> <!-- by container -->
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-yaml-provider</artifactId>
<version>${resteasy.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxb-provider</artifactId>
<version>${resteasy.version}</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.xml.stream</groupId>
<artifactId>sjsxp</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.wordnik</groupId>
<artifactId>swagger-annotations_2.9.1</artifactId>
<version>1.1.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>1.8</version>
</dependency>
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>2.3.18</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-testng</artifactId>
<version>${powermock.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
<version>${powermock.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.rhq.helpers</groupId>
<artifactId>rest-docs-generator</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<resources>
<!-- Redefine which directories to treat like resources (which are filtered). -->
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<testResources>
<testResource>
<directory>src/test/resources</directory>
<filtering>true</filtering>
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ejb-plugin</artifactId>
<version>2.3</version>
<configuration>
<ejbVersion>3.0</ejbVersion>
<generateClient>true</generateClient>
<!-- We shoudn't need Class-Path manifest entry, at least when deployed in AS
but we might need it for CLI. If we don't need the manifest entry in CLI,
then we should uncomment this because we get annoying errors in AS7 logs
with the manifest entry.
<archive>
<manifest>
<addClasspath>false</addClasspath>
</manifest>
</archive>
-->
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>process-classes</phase>
<configuration>
<target>
<!-- generate the I18N resource bundles -->
<taskdef name="i18n" classpathref="maven.runtime.classpath" classname="mazz.i18n.ant.I18NAntTask"/>
<i18n outputdir="${project.build.outputDirectory}" defaultlocale="en" verbose="false" append="false"
verify="true">
<classpath refid="maven.runtime.classpath"/>
<classfileset dir="${project.build.outputDirectory}">
<include name="**/ServerI18NResourceKeys.class"/>
<include name="**/AlertI18NResourceKeys.class"/>
</classfileset>
</i18n>
<!-- create our rhq-server-version.properties file that goes in our jar -->
<tstamp>
<format property="build.time" pattern="dd.MMM.yyyy HH.mm.ss z"/>
</tstamp>
<echo file="${project.build.outputDirectory}/rhq-server-version.properties" append="false">Product-Name=${rhq.product.name}
Product-Version=${project.version}
Module-Name=${project.name}
Module-Version=${project.version}
Build-Number=${buildNumber}
Build-Date=${build.time}
Build-Jdk-Vendor=${java.vendor}
Build-Jdk=${java.version}
Build-OS-Name=${os.name}
Build-OS-Version=${os.version}
</echo>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<!-- Everything but the web service tests, this is the standard test execution -->
<configuration>
<skipTests>true</skipTests>
<excludedGroups>${rhq.testng.excludedGroups}</excludedGroups>
<groups>${rhq.testng.includedGroups}</groups>
<properties>
<property>
<name>listener</name>
<value>org.rhq.test.testng.StdoutReporter</value>
</property>
</properties>
<systemPropertyVariables>
<embeddedDeployment>true</embeddedDeployment>
<deploymentDirectory>target/classes</deploymentDirectory>
<hibernate.dialect>${rhq.test.ds.hibernate-dialect}</hibernate.dialect>
<clean.db>${clean.db}</clean.db>
<log4j.configDebug>false</log4j.configDebug>
</systemPropertyVariables>
<additionalClasspathElements>
<!-- The below is required for tests to run against Oracle. -->
<additionalClasspathElement>${settings.localRepository}/com/oracle/ojdbc6/${ojdbc6.version}/ojdbc6-${ojdbc6.version}.jar</additionalClasspathElement>
</additionalClasspathElements>
</configuration>
<executions>
<execution>
<id>allExceptDbTests</id>
<goals>
<goal>test</goal>
</goals>
<configuration>
<skipTests>${skipTests}</skipTests>
<excludes>
<exclude>com/**/*.java</exclude>
<exclude>org/rhq/**/performance/**/*.java</exclude>
<exclude>org/rhq/enterprise/server/db/**</exclude>
</excludes>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.antlr</groupId>
<artifactId>antlr3-maven-plugin</artifactId>
<version>3.2</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>antlr</goal>
</goals>
<configuration>
<conversionTimeout>30000</conversionTimeout>
<debug>false</debug>
<dfa>false</dfa>
<nfa>false</nfa>
<excludes>
</excludes>
<includes>
</includes>
<libDirectory>src/main/antlr3/imports</libDirectory>
<messageFormat>antlr</messageFormat>
<outputDirectory>target/generated-sources/antlr3</outputDirectory>
<printGrammar>false</printGrammar>
<profile>false</profile>
<report>false</report>
<sourceDirectory>src/main/antlr3</sourceDirectory>
<trace>false</trace>
<verbose>true</verbose>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>add-antlr-sources</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${basedir}/target/generated-sources/antlr3</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<!-- TODO change when the annotations are puplished. This is temporary for the swagger annotations for REST-docu -->
<id>sonatype-oss-snapshot</id>
<name>Sonatype OSS Snapshot repository</name>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>
</repositories>
<profiles>
<profile>
<!--
This profile has been created to avoid unnecessary resolution of test dependencies during a build that
does not run, compile or need tests.
More test dependencies are to be moved here if the set of sub-dependencies is complex, references project
test jars, or conflicts with changing the container version.
-->
<id>test.dependencies</id>
<activation>
<property>
<name>maven.test.skip</name>
<value>!true</value>
</property>
</activation>
<dependencies>
<dependency>
<groupId>org.rhq</groupId>
<artifactId>rhq-core-domain</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
</dependencies>
</profile>
<profile>
<!-- only if we are not running an individual set of tests via -Dtest do we do this -->
<id>no-individual-test</id>
<activation>
<property>
<name>!test</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<!-- Everything but the web service tests, this is the standard test execution -->
<configuration>
<skipTests>true</skipTests>
<excludedGroups>${rhq.testng.excludedGroups}</excludedGroups>
<groups>${rhq.testng.includedGroups}</groups>
<properties>
<property>
<name>listener</name>
<value>org.rhq.test.testng.StdoutReporter</value>
</property>
</properties>
<systemPropertyVariables>
<embeddedDeployment>true</embeddedDeployment>
<deploymentDirectory>target/classes</deploymentDirectory>
<hibernate.dialect>${rhq.test.ds.hibernate-dialect}</hibernate.dialect>
<clean.db>${clean.db}</clean.db>
<log4j.configDebug>false</log4j.configDebug>
</systemPropertyVariables>
<additionalClasspathElements>
<!-- The below is required for tests to run against Oracle. -->
<additionalClasspathElement>${settings.localRepository}/com/oracle/ojdbc6/${ojdbc6.version}/ojdbc6-${ojdbc6.version}.jar</additionalClasspathElement>
</additionalClasspathElements>
</configuration>
<executions>
<execution>
<id>dbTestsOnly</id>
<goals>
<goal>test</goal>
</goals>
<configuration>
<skipTests>${skipTests}</skipTests>
<includes>
<include>org/rhq/enterprise/server/db/**</include>
</includes>
<failIfNoTests>false</failIfNoTests>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>dev</id>
<properties>
<rhq.rootDir>../../../..</rhq.rootDir>
<rhq.containerDir>${rhq.rootDir}/${rhq.defaultDevContainerPath}</rhq.containerDir>
<rhq.deploymentName>${project.build.finalName}-ejb3.jar</rhq.deploymentName>
<rhq.deploymentDir>${rhq.containerDir}/${rhq.earDeployDir}/${rhq.deploymentName}</rhq.deploymentDir>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>deploy</id>
<phase>process-classes</phase>
<configuration>
<target>
<property name="deployment.dir" location="${rhq.deploymentDir}"/>
<echo>*** Copying updated files from target/classes to ${deployment.dir}...</echo>
<copy todir="${deployment.dir}" verbose="${rhq.verbose}">
<fileset dir="target/classes"/>
</copy>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<!--
NOTE: The below execution is necessary to make sure the META-INF/MANIFEST.MF and
META-INF/maven/** files, which get created by the ejb plugin during the package phase, get
copied over to the deployment dir.
-->
<execution>
<id>deploy-jar-meta-inf</id>
<phase>package</phase>
<configuration>
<target>
<unjar src="${project.build.directory}/${project.build.finalName}.jar" dest="${rhq.deploymentDir}"
overwrite="false">
<patternset>
<include name="META-INF/**"/>
</patternset>
</unjar>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<id>undeploy</id>
<phase>clean</phase>
<configuration>
<target>
<property name="deployment.dir" location="${rhq.deploymentDir}"/>
<echo>*** Deleting ${deployment.dir}${file.separator}...</echo>
<delete dir="${deployment.dir}"/>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>javadoc</id>
<activation>
<property>
<name>javadoc.outputDirectory</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>remote-api</id>
<phase>compile</phase>
<configuration>
<target>
<property name="javadoc.outputDirectory" value="${javadoc.outputDirectory}"/>
<property name="project.dir" value="./src/main/java/org/rhq/enterprise/server"/>
<property name="maven.compile.classpath" refid="maven.compile.classpath"/>
<mkdir dir="${javadoc.outputDirectory}/remote-api"/>
<javadoc destdir="${javadoc.outputDirectory}/remote-api" author="false" version="true"
windowtitle="RHQ ${project.version} Remote API" noindex="false">
<classpath>
<pathelement path="${maven.compile.classpath}"/>
</classpath>
<fileset dir="${project.dir}" defaultexcludes="yes">
<include name="**/*Remote.java"/>
</fileset>
<link href="../domain/"/>
<link href="http://download.oracle.com/javase/6/docs/api/"/>
<bottom><![CDATA[Copyright © 2005-2011 <a href="http://redhat.com/">Red Hat, Inc.</a>. All Rights Reserved.]]></bottom>
</javadoc>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>REST doc generation</id>
<activation>
<property>
<name>docgen</name>
</property>
</activation>
<dependencies>
<dependency>
<groupId>org.rhq.helpers</groupId>
<artifactId>rest-docs-generator</artifactId>
<version>${project.version}</version>
</dependency>
<!-- We need this, as otherwise processing fails completely with a class not found exception -->
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
<version>${jboss-logging.version}</version>
</dependency>
</dependencies>
<build>
<!-- Document generation from the Annotations on the REST-API. -->
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<annotationProcessors>
<processor>org.rhq.helpers.rest_docs_generator.ClassLevelProcessor</processor>
</annotationProcessors>
<proc>only</proc>
<compilerArguments>
<AtargetDirectory>${project.build.directory}/docs/xml</AtargetDirectory>
<AmodelPkg>org.rhq.enterprise.server.rest.domain</AmodelPkg>
<AskipPkg>org.rhq.enterprise.server.rest.reporting</AskipPkg>
<!-- enable the next line to have the output of the processor shown on console -->
<!--<Averbose>true</Averbose>-->
</compilerArguments>
<!-- set the next to true to enable verbose output of the compiler plugin; default from the evn is true, but this is too noisy -->
<verbose>false</verbose>
</configuration>
<executions>
<execution>
<id>create-rest-api-reports</id>
<phase>process-classes</phase>
<goals>
<!-- We want to process the classes in src/ -->
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>xml-maven-plugin</artifactId>
<executions>
<execution>
<phase>process-classes</phase>
<goals>
<goal>transform</goal>
</goals>
</execution>
</executions>
<configuration>
<transformationSets>
<transformationSet>
<!-- Generate a html rendering -->
<!-- org.rhq.helpers.rest_docs_generator.test plugin wrote to target/docs/xml (see -AtargetDirectory above) -->
<dir>target/docs/xml</dir>
<includes>
<include>rest-api-out.xml</include>
</includes>
<stylesheet>src/main/xsl/apiout2html.xsl</stylesheet>
<parameters>
<parameter>
<name>basePath</name>
<value>http://localhost:7080/rest</value>
</parameter>
</parameters>
<outputDir>${project.build.directory}/docs/html</outputDir>
<fileMappers>
<fileMapper implementation="org.codehaus.plexus.components.io.filemappers.FileExtensionMapper">
<targetExtension>.html</targetExtension>
</fileMapper>
</fileMappers>
</transformationSet>
<transformationSet>
<!-- Generate a docbook file as input to fop -->
<!-- org.rhq.helpers.rest_docs_generator.test plugin wrote to target/docs/xml (see -AtargetDirectory above) -->
<dir>target/docs/xml</dir>
<includes>
<include>rest-api-out.xml</include>
</includes>
<stylesheet>src/main/xsl/apiout2docbook.xsl</stylesheet>
<parameters>
<parameter>
<name>basePath</name>
<value>http://localhost:7080/rest</value>
</parameter>
</parameters>
<outputDir>${project.build.directory}/docs/xml</outputDir>
<fileMappers>
<fileMapper implementation="org.codehaus.plexus.components.io.filemappers.FileExtensionMapper">
<targetExtension>.dbx.xml</targetExtension>
</fileMapper>
</fileMappers>
</transformationSet>
</transformationSets>
</configuration>
</plugin>
<plugin>
<groupId>com.agilejava.docbkx</groupId>
<artifactId>docbkx-maven-plugin</artifactId>
<version>2.0.14</version>
<executions>
<execution>
<phase>process-classes</phase>
<goals>
<goal>generate-pdf</goal>
<goal>generate-html</goal>
</goals>
</execution>
</executions>
<configuration>
<sourceDirectory>target/docs/xml</sourceDirectory> <!-- from previous plugin, 2nd transformation set -->
<includes>rest-api-out.dbx.xml</includes>
<hyphenate>true</hyphenate>
<generateToc>true</generateToc>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>cobertura</id>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<dependencies>
<dependency>
<groupId>net.sourceforge.cobertura</groupId>
<artifactId>cobertura</artifactId>
<version>${cobertura.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>cobertura-instrument</id>
<phase>process-test-classes</phase>
<configuration>
<target>
<!-- prepare directory structure for cobertura-->
<mkdir dir="target/cobertura"/>
<mkdir dir="target/cobertura/backup"/>
<!-- backup all classes so that we can instrument the original classes-->
<copy toDir="target/cobertura/backup" verbose="true" overwrite="true">
<fileset dir="target/classes">
<include name="**/*.class"/>
</fileset>
</copy>
<!-- create a properties file and save there location of cobertura data file-->
<touch file="target/classes/cobertura.properties"/>
<echo file="target/classes/cobertura.properties">net.sourceforge.cobertura.datafile=${project.build.directory}/cobertura/cobertura.ser</echo>
<taskdef classpathref="maven.plugin.classpath" resource="tasks.properties"/>
<!-- instrument all classes in target/classes directory -->
<cobertura-instrument datafile="${project.build.directory}/cobertura/cobertura.ser"
todir="${project.build.directory}/classes">
<fileset dir="${project.build.directory}/classes">
<include name="**/*.class"/>
<exclude name="**/DynamicConfigurationPropertyLocal.class"/>
<exclude name="**/DynamicConfigurationPropertyBean.class"/>
</fileset>
</cobertura-instrument>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<id>cobertura-report</id>
<phase>prepare-package</phase>
<configuration>
<target>
<taskdef classpathref="maven.plugin.classpath" resource="tasks.properties"/>
<!-- prepare directory structure for cobertura-->
<mkdir dir="target/cobertura"/>
<mkdir dir="target/site/cobertura"/>
<!-- restore classes from backup folder to classes folder -->
<copy toDir="target/classes" verbose="true" overwrite="true">
<fileset dir="target/cobertura/backup">
<include name="**/*.class"/>
</fileset>
</copy>
<!-- delete backup folder-->
<delete dir="target/cobertura/backup"/>
<!-- create a code coverage report -->
<cobertura-report format="html" datafile="${project.build.directory}/cobertura/cobertura.ser"
destdir="${project.build.directory}/site/cobertura">
<fileset dir="${basedir}/src/main/java">
<include name="**/*.java"/>
</fileset>
</cobertura-report>
<!-- delete cobertura.properties file -->
<delete file="target/classes/cobertura.properties"/>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>signature-check</id>
<activation>
<property>
<name>signature-check-base-version</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>clirr-maven-plugin</artifactId>
<version>${clirr.version}</version>
<configuration>
<includes>
<include>**/*Remote</include>
<include>**/ServerVersion</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<reporting>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>clirr-maven-plugin</artifactId>
<version>${clirr.version}</version>
<configuration>
<includes>
<include>**/*Remote</include>
<include>**/ServerVersion</include>
</includes>
</configuration>
</plugin>
</plugins>
</reporting>
</project>
|