]> source.dussan.org Git - poi.git/commitdiff
Try to improve Maven files for Sonar: Copy in (test)sources instead of linking to...
authorDominik Stadler <centic@apache.org>
Thu, 27 Feb 2014 14:03:27 +0000 (14:03 +0000)
committerDominik Stadler <centic@apache.org>
Thu, 27 Feb 2014 14:03:27 +0000 (14:03 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1572580 13f79535-47bb-0310-9956-ffa450edef68

sonar/examples/pom.xml
sonar/excelant/pom.xml
sonar/main/pom.xml
sonar/ooxml-schema-encryption/pom.xml
sonar/ooxml-schema/pom.xml
sonar/ooxml/pom.xml
sonar/pom.xml
sonar/scratchpad/pom.xml

index be0cd111a8beb115823feb661b55cf3c2216dcfe..5064a51afcb22162b105cc5e246bf97b88374942 100644 (file)
     <packaging>jar</packaging>
 
     <name>Apache POI Examples package</name>
-
+    
     <build>
-               <sourceDirectory>../../src/examples/src</sourceDirectory>
+               <plugins>
+                       <!-- copy sources, resources and tests in place as otherwise Sonar does not pick them up correctly! -->
+                       <plugin>
+                               <artifactId>maven-resources-plugin</artifactId>
+                               <version>2.6</version>
+                               <executions>
+                                       <execution>
+                                               <id>copy-sources</id>
+                                               <!-- here the phase you need -->
+                                               <phase>generate-sources</phase>
+                                               <goals>
+                                                       <goal>copy-resources</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <outputDirectory>${basedir}/src/main/java</outputDirectory>
+                                                       <resources>          
+                                                               <resource>
+                                                                       <directory>../../src/examples/src</directory>
+                                                               </resource>
+                                                       </resources>              
+                                               </configuration>            
+                                       </execution>
+                               </executions>
+                       </plugin>
+                       <!-- clean copied sources afterwards -->
+                       <plugin>
+                <artifactId>maven-clean-plugin</artifactId>
+                <version>2.5</version>
+                <configuration>
+                    <filesets>
+                        <fileset>
+                            <directory>src</directory>
+                            <followSymlinks>false</followSymlinks>
+                        </fileset>
+                    </filesets>
+                </configuration>
+            </plugin>                  
+               </plugins>
     </build>
 
     <dependencies>
index 478a9364bec70cb17d69621c69bec731d66cd7ef..8cc86ec07e6d2ed5fd912a3c8bf47d67c0a29f2d 100644 (file)
     <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>
+               <plugins>
+                       <!-- copy sources, resources and tests in place as otherwise Sonar does not pick them up correctly! -->
+                       <plugin>
+                               <artifactId>maven-resources-plugin</artifactId>
+                               <version>2.6</version>
+                               <executions>
+                                       <execution>
+                                               <id>copy-sources</id>
+                                               <!-- here the phase you need -->
+                                               <phase>generate-sources</phase>
+                                               <goals>
+                                                       <goal>copy-resources</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <outputDirectory>${basedir}/src/main/java</outputDirectory>
+                                                       <resources>          
+                                                               <resource>
+                                                                       <directory>../../src/excelant/java</directory>
+                                                               </resource>
+                                                       </resources>              
+                                               </configuration>            
+                                       </execution>
+                                       <execution>
+                                               <id>copy-resources</id>
+                                               <!-- here the phase you need -->
+                                               <phase>generate-resources</phase>
+                                               <goals>
+                                                       <goal>copy-resources</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <outputDirectory>${basedir}/src/main/resources</outputDirectory>
+                                                       <resources>          
+                                                               <resource>
+                                                                       <directory>../../src/excelant/resources</directory>
+                                                               </resource>
+                                                       </resources>              
+                                               </configuration>            
+                                       </execution>
+                                       <execution>
+                                               <id>copy-tests</id>
+                                               <!-- here the phase you need -->
+                                               <phase>generate-test-sources</phase>
+                                               <goals>
+                                                       <goal>copy-resources</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <outputDirectory>${basedir}/src/test/java</outputDirectory>
+                                                       <resources>          
+                                                               <resource>
+                                                                       <directory>../../src/excelant/testcases</directory>
+                                                               </resource>
+                                                       </resources>              
+                                               </configuration>            
+                                       </execution>
+                               </executions>
+                       </plugin>
+                       <!-- clean copied sources afterwards -->
+                       <plugin>
+                <artifactId>maven-clean-plugin</artifactId>
+                <version>2.5</version>
+                <configuration>
+                    <filesets>
+                        <fileset>
+                            <directory>src</directory>
+                            <followSymlinks>false</followSymlinks>
+                        </fileset>
+                    </filesets>
+                </configuration>
+            </plugin>                  
+               </plugins>
     </build>
 
     <dependencies>
index 81e87aa168ef125e7ba395ac5cfbeb4041cfe075..6527e75b01d23e63125cd88ed71df41392d7365e 100644 (file)
     <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>
+                       <!-- copy sources, resources and tests in place as otherwise Sonar does not pick them up correctly! -->
+                       <plugin>
+                               <artifactId>maven-resources-plugin</artifactId>
+                               <version>2.6</version>
+                               <executions>
+                                       <execution>
+                                               <id>copy-sources</id>
+                                               <!-- here the phase you need -->
+                                               <phase>generate-sources</phase>
+                                               <goals>
+                                                       <goal>copy-resources</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <outputDirectory>${basedir}/src/main/java</outputDirectory>
+                                                       <resources>          
+                                                               <resource>
+                                                                       <directory>../../src/java</directory>
+                                                               </resource>
+                                                       </resources>              
+                                               </configuration>            
+                                       </execution>
+                                       <execution>
+                                               <id>copy-resources</id>
+                                               <!-- here the phase you need -->
+                                               <phase>generate-resources</phase>
+                                               <goals>
+                                                       <goal>copy-resources</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <outputDirectory>${basedir}/src/main/resources</outputDirectory>
+                                                       <resources>          
+                                                               <resource>
+                                                                       <directory>../../src/resources/main</directory>
+                                                               </resource>
+                                                       </resources>              
+                                               </configuration>            
+                                       </execution>
+                                       <execution>
+                                               <id>copy-tests</id>
+                                               <!-- here the phase you need -->
+                                               <phase>generate-test-sources</phase>
+                                               <goals>
+                                                       <goal>copy-resources</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <outputDirectory>${basedir}/src/test/java</outputDirectory>
+                                                       <resources>          
+                                                               <resource>
+                                                                       <directory>../../src/testcases</directory>
+                                                               </resource>
+                                                       </resources>              
+                                               </configuration>            
+                                       </execution>
+                               </executions>
+                       </plugin>
+                       <!-- clean copied sources afterwards -->
+                       <plugin>
+                <artifactId>maven-clean-plugin</artifactId>
+                <version>2.5</version>
+                <configuration>
+                    <filesets>
+                        <fileset>
+                            <directory>src</directory>
+                            <followSymlinks>false</followSymlinks>
+                        </fileset>
+                    </filesets>
+                </configuration>
+            </plugin>                  
+                       
                        <!-- provide the test-jar for other modules -->
                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
index 9fd237027730d79bb70637ef7739821ab78684d2..aa723d0d6fbb25b59c564cf1da96831caefedcd4 100644 (file)
@@ -14,8 +14,6 @@
     <name>Apach POI - Openxmlformats Encryption Schema package</name>
 
     <build>
-               <sourceDirectory>target/generated-sources/xmlbeans</sourceDirectory>
-               
                <plugins>
                        <plugin>
                          <groupId>org.codehaus.mojo</groupId>
index 92e0111c8f09dd8075cc5dc5eca0e6690ef76c3b..92426b486bef5e2c57f2e1384ee5414ab3a6fb9d 100644 (file)
@@ -14,8 +14,6 @@
     <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>
index 0ece9d62351bec453f7a9509ddff1efe630037c9..bc1feabb4dfd2ce90b46cfc35a490a4204136f24 100644 (file)
     <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>
+               <plugins>
+                       <!-- copy sources, resources and tests in place as otherwise Sonar does not pick them up correctly! -->
+                       <plugin>
+                               <artifactId>maven-resources-plugin</artifactId>
+                               <version>2.6</version>
+                               <executions>
+                                       <execution>
+                                               <id>copy-sources</id>
+                                               <!-- here the phase you need -->
+                                               <phase>generate-sources</phase>
+                                               <goals>
+                                                       <goal>copy-resources</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <outputDirectory>${basedir}/src/main/java</outputDirectory>
+                                                       <resources>          
+                                                               <resource>
+                                                                       <directory>../../src/ooxml/java</directory>
+                                                               </resource>
+                                                       </resources>              
+                                               </configuration>            
+                                       </execution>
+                                       <execution>
+                                               <id>copy-resources</id>
+                                               <!-- here the phase you need -->
+                                               <phase>generate-resources</phase>
+                                               <goals>
+                                                       <goal>copy-resources</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <outputDirectory>${basedir}/src/main/resources</outputDirectory>
+                                                       <resources>          
+                                                               <resource>
+                                                                       <directory>../../src/resources/ooxml</directory>
+                                                               </resource>
+                                                       </resources>              
+                                               </configuration>            
+                                       </execution>
+                                       <execution>
+                                               <id>copy-tests</id>
+                                               <!-- here the phase you need -->
+                                               <phase>generate-test-sources</phase>
+                                               <goals>
+                                                       <goal>copy-resources</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <outputDirectory>${basedir}/src/test/java</outputDirectory>
+                                                       <resources>          
+                                                               <resource>
+                                                                       <directory>../../src/ooxml/testcases</directory>
+                                                               </resource>
+                                                       </resources>              
+                                               </configuration>            
+                                       </execution>
+                               </executions>
+                       </plugin>
+                       <!-- clean copied sources afterwards -->
+                       <plugin>
+                <artifactId>maven-clean-plugin</artifactId>
+                <version>2.5</version>
+                <configuration>
+                    <filesets>
+                        <fileset>
+                            <directory>src</directory>
+                            <followSymlinks>false</followSymlinks>
+                        </fileset>
+                    </filesets>
+                </configuration>
+            </plugin>                  
+               </plugins>
     </build>
 
     <dependencies>
             <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>
index 2232fe5e0925da9770212c4ed3ff1b73e5b04fcd..8d54d14d1dce0c2063b6180fea3a5dfab1e7f311 100644 (file)
@@ -9,7 +9,7 @@
     <packaging>pom</packaging>
     <version>3.11-SNAPSHOT</version>
 
-    <name>Apache POI Parent Project</name>
+    <name>Apache POI - the Java API for Microsoft Documents</name>
 
     <description>Maven build of Apache POI for Sonar checks</description>
     <url>http://poi.apache.org/</url>
index 3824eeaace5cb7c57fa394a1a5c47f241e2425e3..24e8045d766bb6d16bc594645ed632549aef3c39 100644 (file)
     <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>
+               <plugins>
+                       <!-- copy sources, resources and tests in place as otherwise Sonar does not pick them up correctly! -->
+                       <plugin>
+                               <artifactId>maven-resources-plugin</artifactId>
+                               <version>2.6</version>
+                               <executions>
+                                       <execution>
+                                               <id>copy-sources</id>
+                                               <!-- here the phase you need -->
+                                               <phase>generate-sources</phase>
+                                               <goals>
+                                                       <goal>copy-resources</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <outputDirectory>${basedir}/src/main/java</outputDirectory>
+                                                       <resources>          
+                                                               <resource>
+                                                                       <directory>../../src/scratchpad/src</directory>
+                                                               </resource>
+                                                       </resources>              
+                                               </configuration>            
+                                       </execution>
+                                       <execution>
+                                               <id>copy-resources</id>
+                                               <!-- here the phase you need -->
+                                               <phase>generate-resources</phase>
+                                               <goals>
+                                                       <goal>copy-resources</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <outputDirectory>${basedir}/src/main/resources</outputDirectory>
+                                                       <resources>          
+                                                               <resource>
+                                                                       <directory>../../src/resources/scratchpad</directory>
+                                                               </resource>
+                                                       </resources>              
+                                               </configuration>            
+                                       </execution>
+                                       <execution>
+                                               <id>copy-tests</id>
+                                               <!-- here the phase you need -->
+                                               <phase>generate-test-sources</phase>
+                                               <goals>
+                                                       <goal>copy-resources</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <outputDirectory>${basedir}/src/test/java</outputDirectory>
+                                                       <resources>          
+                                                               <resource>
+                                                                       <directory>../../src/scratchpad/testcases</directory>
+                                                               </resource>
+                                                       </resources>              
+                                               </configuration>            
+                                       </execution>
+                               </executions>
+                       </plugin>
+                       <!-- clean copied sources afterwards -->
+                       <plugin>
+                <artifactId>maven-clean-plugin</artifactId>
+                <version>2.5</version>
+                <configuration>
+                    <filesets>
+                        <fileset>
+                            <directory>src</directory>
+                            <followSymlinks>false</followSymlinks>
+                        </fileset>
+                    </filesets>
+                </configuration>
+            </plugin>                  
+               </plugins>
     </build>
 
     <dependencies>