Author: centic
Date: Thu Feb 27 14:03:27 2014
New Revision: 1572580

URL: http://svn.apache.org/r1572580
Log:
Try to improve Maven files for Sonar: Copy in (test)sources instead of linking 
to sources outside the sonar-directory which confuses Sonar, remove source-dir 
setting for ooxml-schema and ooxml-schema-encryption as both have generate 
sources and not actual ones, scratchpad is not needed for ooxml

Modified:
    poi/trunk/sonar/examples/pom.xml
    poi/trunk/sonar/excelant/pom.xml
    poi/trunk/sonar/main/pom.xml
    poi/trunk/sonar/ooxml-schema-encryption/pom.xml
    poi/trunk/sonar/ooxml-schema/pom.xml
    poi/trunk/sonar/ooxml/pom.xml
    poi/trunk/sonar/pom.xml
    poi/trunk/sonar/scratchpad/pom.xml

Modified: poi/trunk/sonar/examples/pom.xml
URL: 
http://svn.apache.org/viewvc/poi/trunk/sonar/examples/pom.xml?rev=1572580&r1=1572579&r2=1572580&view=diff
==============================================================================
--- poi/trunk/sonar/examples/pom.xml (original)
+++ poi/trunk/sonar/examples/pom.xml Thu Feb 27 14:03:27 2014
@@ -12,9 +12,46 @@
     <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>

Modified: poi/trunk/sonar/excelant/pom.xml
URL: 
http://svn.apache.org/viewvc/poi/trunk/sonar/excelant/pom.xml?rev=1572580&r1=1572579&r2=1572580&view=diff
==============================================================================
--- poi/trunk/sonar/excelant/pom.xml (original)
+++ poi/trunk/sonar/excelant/pom.xml Thu Feb 27 14:03:27 2014
@@ -14,13 +14,76 @@
     <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>

Modified: poi/trunk/sonar/main/pom.xml
URL: 
http://svn.apache.org/viewvc/poi/trunk/sonar/main/pom.xml?rev=1572580&r1=1572579&r2=1572580&view=diff
==============================================================================
--- poi/trunk/sonar/main/pom.xml (original)
+++ poi/trunk/sonar/main/pom.xml Thu Feb 27 14:03:27 2014
@@ -14,15 +14,76 @@
     <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>

Modified: poi/trunk/sonar/ooxml-schema-encryption/pom.xml
URL: 
http://svn.apache.org/viewvc/poi/trunk/sonar/ooxml-schema-encryption/pom.xml?rev=1572580&r1=1572579&r2=1572580&view=diff
==============================================================================
--- poi/trunk/sonar/ooxml-schema-encryption/pom.xml (original)
+++ poi/trunk/sonar/ooxml-schema-encryption/pom.xml Thu Feb 27 14:03:27 2014
@@ -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>

Modified: poi/trunk/sonar/ooxml-schema/pom.xml
URL: 
http://svn.apache.org/viewvc/poi/trunk/sonar/ooxml-schema/pom.xml?rev=1572580&r1=1572579&r2=1572580&view=diff
==============================================================================
--- poi/trunk/sonar/ooxml-schema/pom.xml (original)
+++ poi/trunk/sonar/ooxml-schema/pom.xml Thu Feb 27 14:03:27 2014
@@ -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>

Modified: poi/trunk/sonar/ooxml/pom.xml
URL: 
http://svn.apache.org/viewvc/poi/trunk/sonar/ooxml/pom.xml?rev=1572580&r1=1572579&r2=1572580&view=diff
==============================================================================
--- poi/trunk/sonar/ooxml/pom.xml (original)
+++ poi/trunk/sonar/ooxml/pom.xml Thu Feb 27 14:03:27 2014
@@ -12,15 +12,78 @@
     <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>
@@ -46,11 +109,6 @@
             <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>

Modified: poi/trunk/sonar/pom.xml
URL: 
http://svn.apache.org/viewvc/poi/trunk/sonar/pom.xml?rev=1572580&r1=1572579&r2=1572580&view=diff
==============================================================================
--- poi/trunk/sonar/pom.xml (original)
+++ poi/trunk/sonar/pom.xml Thu Feb 27 14:03:27 2014
@@ -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>

Modified: poi/trunk/sonar/scratchpad/pom.xml
URL: 
http://svn.apache.org/viewvc/poi/trunk/sonar/scratchpad/pom.xml?rev=1572580&r1=1572579&r2=1572580&view=diff
==============================================================================
--- poi/trunk/sonar/scratchpad/pom.xml (original)
+++ poi/trunk/sonar/scratchpad/pom.xml Thu Feb 27 14:03:27 2014
@@ -14,13 +14,76 @@
     <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>



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@poi.apache.org
For additional commands, e-mail: commits-h...@poi.apache.org

Reply via email to