Add a set of maven pom.xml files for Sonar, a few workaround are

necessary, but overall this now allows to compile and run test for
all Apache POI components using Maven, which is a pre-requisite to
be analyzed at http://nemo.sonarqube.org/

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1568613 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Dominik Stadler 2014-02-15 10:42:43 +00:00
parent b51a52cf20
commit 8d6b1f1f35
8 changed files with 581 additions and 0 deletions

39
sonar/examples/pom.xml Normal file
View File

@ -0,0 +1,39 @@
<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.apache.poi</groupId>
<artifactId>poi-parent</artifactId>
<version>3.11-SNAPSHOT</version>
</parent>
<artifactId>poi-examples</artifactId>
<packaging>jar</packaging>
<name>Apache POI Examples package</name>
<build>
<sourceDirectory>../../src/examples/src</sourceDirectory>
</build>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>poi-main</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>poi-ooxml</artifactId>
<version>${project.version}</version>
</dependency>
<!-- non-test dependency for UpdateEmbeddedDoc -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
</dependency>
</dependencies>
</project>

51
sonar/excelant/pom.xml Normal file
View File

@ -0,0 +1,51 @@
<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.apache.poi</groupId>
<artifactId>poi-parent</artifactId>
<version>3.11-SNAPSHOT</version>
</parent>
<artifactId>poi-excelant</artifactId>
<packaging>jar</packaging>
<name>Apache POI ExcelAnt package</name>
<build>
<sourceDirectory>../../src/excelant/java</sourceDirectory>
<testSourceDirectory>../../src/excelant/testcases</testSourceDirectory>
<resources>
<resource>
<directory>../../src/excelant/resources</directory>
</resource>
</resources>
</build>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>poi-main</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>poi-main</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>poi-ooxml</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
<version>1.8.2</version>
</dependency>
</dependencies>
</project>

54
sonar/main/pom.xml Normal file
View File

@ -0,0 +1,54 @@
<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.apache.poi</groupId>
<artifactId>poi-parent</artifactId>
<version>3.11-SNAPSHOT</version>
</parent>
<artifactId>poi-main</artifactId>
<packaging>jar</packaging>
<name>Apache POI Main package</name>
<build>
<sourceDirectory>../../src/java</sourceDirectory>
<testSourceDirectory>../../src/testcases</testSourceDirectory>
<resources>
<resource>
<directory>../../src/resources/main</directory>
</resource>
</resources>
<plugins>
<!-- provide the test-jar for other modules -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.9</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.3</version>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,103 @@
<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.apache.poi</groupId>
<artifactId>poi-parent</artifactId>
<version>3.11-SNAPSHOT</version>
</parent>
<artifactId>poi-ooxml-schema-encryption</artifactId>
<packaging>jar</packaging>
<name>Apach POI - Openxmlformats Encryption Schema package</name>
<build>
<sourceDirectory>target/generated-sources/xmlbeans</sourceDirectory>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>xmlbeans-maven-plugin</artifactId>
<version>2.3.3</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>xmlbeans</goal>
</goals>
</execution>
</executions>
<configuration>
<schemaDirectory>../../src/ooxml/resources/org/apache/poi/poifs/crypt</schemaDirectory>
<javaSource>1.5</javaSource>
<optimize>yes</optimize>
</configuration>
</plugin>
<!-- TODO: ugly workaround as XMLBeans in Maven creates slightly different source compared to the Ant XMLBeans task!?!
see http://stackoverflow.com/questions/21796000/xmlbeans-creates-different-code-when-running-via-ant-and-maven
-->
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
<version>1.5.2</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>replace</goal>
</goals>
</execution>
</executions>
<configuration>
<includes>
<include>target/generated-sources/xmlbeans/com/microsoft/schemas/office/x2006/encryption/CTKeyEncryptor.java</include>
<include>target/generated-sources/xmlbeans/com/microsoft/schemas/office/x2006/encryption/impl/CTKeyEncryptorImpl.java</include>
<include>target/generated-sources/xmlbeans/com/microsoft/schemas/office/x2006/keyEncryptor/password/impl/EncryptedKeyDocumentImpl.java</include>
<include>target/generated-sources/xmlbeans/com/microsoft/schemas/office/x2006/keyEncryptor/certificate/EncryptedKeyDocument.java</include>
<include>target/generated-sources/xmlbeans/com/microsoft/schemas/office/x2006/keyEncryptor/certificate/impl/EncryptedKeyDocumentImpl.java</include>
<include>target/generated-sources/xmlbeans/com/microsoft/schemas/office/x2006/keyEncryptor/password/EncryptedKeyDocument.java</include>
<include>target/generated-sources/xmlbeans/com/microsoft/schemas/office/x2006/keyEncryptor/password/impl/EncryptedKeyDocumentImpl.java</include>
</includes>
<replacements>
<replacement>
<token>etEncryptedKey2</token>
<value>etEncryptedCertificateKey</value>
</replacement>
<replacement>
<token>etEncryptedKey</token>
<value>etEncryptedPasswordKey</value>
</replacement>
<replacement>
<token>ewEncryptedKey2</token>
<value>ewEncryptedCertificateKey</value>
</replacement>
<replacement>
<token>ewEncryptedKey</token>
<value>ewEncryptedPasswordKey</value>
</replacement>
<replacement>
<token>encryptedKey2\)</token>
<value>encryptedCertificateKey)</value>
</replacement>
<replacement>
<token>encryptedKey\)</token>
<value>encryptedPasswordKey)</value>
</replacement>
</replacements>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.apache.xmlbeans</groupId>
<artifactId>xmlbeans</artifactId>
<version>2.3.0</version>
</dependency>
</dependencies>
</project>

101
sonar/ooxml-schema/pom.xml Normal file
View File

@ -0,0 +1,101 @@
<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.apache.poi</groupId>
<artifactId>poi-parent</artifactId>
<version>3.11-SNAPSHOT</version>
</parent>
<artifactId>poi-ooxml-schema</artifactId>
<packaging>jar</packaging>
<name>Apach POI - Openxmlformats Schema package</name>
<build>
<sourceDirectory>target/generated-sources/xmlbeans</sourceDirectory>
<plugins>
<!-- Download and unpack the OfficeOpenXML Schema and use xmlbeans to create classes from the XSDs -->
<plugin>
<groupId>com.googlecode.maven-download-plugin</groupId>
<artifactId>maven-download-plugin</artifactId>
<version>1.1.0</version>
<executions>
<execution>
<id>install-xsds</id>
<phase>generate-sources</phase>
<goals>
<goal>wget</goal>
</goals>
<configuration>
<url>http://www.ecma-international.org/publications/files/ECMA-ST/Office%20Open%20XML%201st%20edition%20Part%204%20(PDF).zip</url>
<unpack>true</unpack>
<md5>abe6bb6e7799e854934b3c634e8bcf7b</md5>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>unzip-schema</id>
<phase>generate-sources</phase>
<configuration>
<target>
<echo message="unzip schemas" />
<unzip src="target/OfficeOpenXML-XMLSchema.zip" dest="target/schemas/" />
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>xmlbeans-maven-plugin</artifactId>
<version>2.3.3</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>xmlbeans</goal>
</goals>
</execution>
</executions>
<configuration>
<schemaDirectory>target/schemas</schemaDirectory>
<javaSource>1.5</javaSource>
<optimize>yes</optimize>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>poi-main</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>poi-scratchpad</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.xmlbeans</groupId>
<artifactId>xmlbeans</artifactId>
<version>2.3.0</version>
</dependency>
</dependencies>
</project>

74
sonar/ooxml/pom.xml Normal file
View File

@ -0,0 +1,74 @@
<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.apache.poi</groupId>
<artifactId>poi-parent</artifactId>
<version>3.11-SNAPSHOT</version>
</parent>
<artifactId>poi-ooxml</artifactId>
<packaging>jar</packaging>
<name>Apache POI OOXML package</name>
<build>
<sourceDirectory>../../src/ooxml/java</sourceDirectory>
<testSourceDirectory>../../src/ooxml/testcases</testSourceDirectory>
<resources>
<resource>
<directory>../../src/resources/ooxml</directory>
</resource>
</resources>
</build>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>poi-ooxml-schema</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>poi-ooxml-schema-encryption</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>poi-main</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>poi-main</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>poi-scratchpad</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.xmlbeans</groupId>
<artifactId>xmlbeans</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
</dependency>
<!-- non-test dependency for OOXMLLite -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
</dependency>
</dependencies>
</project>

119
sonar/pom.xml Normal file
View File

@ -0,0 +1,119 @@
<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>
<groupId>org.apache.poi</groupId>
<artifactId>poi-parent</artifactId>
<packaging>pom</packaging>
<version>3.11-SNAPSHOT</version>
<name>Apache POI Parent Project</name>
<description>Maven build of Apache POI for Sonar checks</description>
<url>http://poi.apache.org/</url>
<mailingLists>
<mailingList>
<name>POI Users List</name>
<subscribe>user-subscribe@poi.apache.org</subscribe>
<unsubscribe>user-unsubscribe@poi.apache.org</unsubscribe>
<archive>http://mail-archives.apache.org/mod_mbox/poi-user/</archive>
</mailingList>
<mailingList>
<name>POI Developer List</name>
<subscribe>dev-subscribe@poi.apache.org</subscribe>
<unsubscribe>dev-unsubscribe@poi.apache.org</unsubscribe>
<archive>http://mail-archives.apache.org/mod_mbox/poi-dev/</archive>
</mailingList>
</mailingLists>
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>
<organization>
<name>Apache Software Foundation</name>
<url>http://www.apache.org/</url>
</organization>
<modules>
<module>main</module>
<module>ooxml-schema</module>
<module>ooxml-schema-encryption</module>
<module>ooxml</module>
<module>scratchpad</module>
<module>excelant</module>
<module>examples</module>
</modules>
<properties>
<project.build.sourceEncoding>ASCII</project.build.sourceEncoding>
</properties>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.16</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit47</artifactId>
<version>2.16</version>
</dependency>
</dependencies>
<configuration>
<systemPropertyVariables>
<POI.testdata.path>../../test-data</POI.testdata.path>
<java.awt.headless>true</java.awt.headless>
<org.apache.poi.util.POILogger>org.apache.poi.util.NullLogger</org.apache.poi.util.POILogger>
</systemPropertyVariables>
<argLine>-Duser.language=en -Duser.country=US</argLine>
<excludes>
<exclude>**/All*Tests.java</exclude>
<exclude>**/TestUnfixedBugs.java</exclude>
<exclude>**/TestcaseRecordInputStream.java</exclude>
<exclude>**/POITestCase.java</exclude>
<!-- TODO: error about no public construct, seems to run with JUnit 3.8... -->
<exclude>**/TestWordToConverterSuite*.java</exclude>
<exclude>**/TestExcelConverterSuite*.java</exclude>
</excludes>
<!--test>TestPPTX2PNG</test-->
<!--parallel>both</parallel>
<threadCount>10</threadCount-->
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>

40
sonar/scratchpad/pom.xml Normal file
View File

@ -0,0 +1,40 @@
<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.apache.poi</groupId>
<artifactId>poi-parent</artifactId>
<version>3.11-SNAPSHOT</version>
</parent>
<artifactId>poi-scratchpad</artifactId>
<packaging>jar</packaging>
<name>Apache POI Scratchpad package</name>
<build>
<sourceDirectory>../../src/scratchpad/src</sourceDirectory>
<testSourceDirectory>../../src/scratchpad/testcases</testSourceDirectory>
<resources>
<resource>
<directory>../../src/resources/scratchpad</directory>
</resource>
</resources>
</build>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>poi-main</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>poi-main</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
</dependencies>
</project>