Hi Gert,

Your fix works for me now.
Would you please also apply your change to 3.2 branch?
btw, I still don't kow where is the error
"Unable to find location 'LICENSE.txt' as URL, File or Resource"
come from.
Cheers

Freeman

Gert Vanthienen wrote:
Freeman,

My environment is actually rather similar, but I still get the same error when building (also happens when I use JDK 6 for building btw).
Maven version: 2.0.9
Java version: 1.5.0_15
OS name: "linux" version: "2.6.24-16-generic" arch: "amd64" Family: "unix"

I'll reopen SM-1369 to find something that works for everyone. I have also committed a first shot at a fix to trunk (created a separate file for the header regex). Could you do a mvn clean install on that to see if trunk now builds with CheckStyle on your machine?

Thanks,

Gert

Freeman Fang wrote:
Hi Gert,

I just run "mvn -cpu install" without specify the LICENSE in parent/pom.xml and it's ok, I can't see your error.
my envrioment is
Maven version: 2.0.9
Java version: 1.5.0_15
OS name: "linux" version: "2.6.9-42.elsmp" arch: "i386" Family: "unix"

Regards

Freeman

Gert Vanthienen wrote:
Freeman,

On my machine, they all fail if the line isn't in the parent/pom.xml. If I don't explicitly configure the headerLocation LICENSE, the plugin takes a default value of LICENSE.txt for the configuration parameter and fails. I have just tried it again with mvn -cpu to make sure I have the latest version of the plugin and it still fails. Could you try running the build on your machine with mvn -cpu to make sure we are both using the same version of the plugin?

[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] An error has occurred in Checkstyle report generation.

Embedded error: Unable to process header location.
Unable to find location 'LICENSE.txt' as URL, File or Resource.


Regards,

Gert

Freeman Fang wrote:
Hi Gert,
Your  change to  parent/pom.xml
+                    <headerLocation>LICENSE</headerLocation>

cause all checkstyle report generation failed since it expect a LICENSE file under each module, I create jira [1] to track it.

[1]https://issues.apache.org/activemq/browse/SM-1369

Regards
Freeman

[EMAIL PROTECTED] wrote:
Author: gertv
Date: Thu May 22 04:22:41 2008
New Revision: 659079

URL: http://svn.apache.org/viewvc?rev=659079&view=rev
Log:
Fixing CheckStyle

Modified:
servicemix/smx3/branches/servicemix-3.2/core/servicemix-audit/src/main/java/org/apache/servicemix/jbi/audit/file/FileAuditor.java servicemix/smx3/branches/servicemix-3.2/core/servicemix-audit/src/main/java/org/apache/servicemix/jbi/audit/file/FileAuditorStrategy.java servicemix/smx3/branches/servicemix-3.2/core/servicemix-audit/src/test/java/org/apache/servicemix/jbi/audit/file/FileAuditorTest.java
    servicemix/smx3/branches/servicemix-3.2/parent/pom.xml

Modified: servicemix/smx3/branches/servicemix-3.2/core/servicemix-audit/src/main/java/org/apache/servicemix/jbi/audit/file/FileAuditor.java URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/core/servicemix-audit/src/main/java/org/apache/servicemix/jbi/audit/file/FileAuditor.java?rev=659079&r1=659078&r2=659079&view=diff ============================================================================== --- servicemix/smx3/branches/servicemix-3.2/core/servicemix-audit/src/main/java/org/apache/servicemix/jbi/audit/file/FileAuditor.java (original) +++ servicemix/smx3/branches/servicemix-3.2/core/servicemix-audit/src/main/java/org/apache/servicemix/jbi/audit/file/FileAuditor.java Thu May 22 04:22:41 2008
@@ -37,7 +37,6 @@
import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.servicemix.components.util.FileMarshaler;
 import org.apache.servicemix.jbi.audit.AbstractAuditor;
 import org.apache.servicemix.jbi.audit.AuditorException;
 import org.apache.servicemix.jbi.event.ExchangeEvent;
@@ -163,7 +162,7 @@
     /*
      * Convenience PrintWriter implementation
      */
-    private class MessageExchangeWriter extends PrintWriter {
+    private final class MessageExchangeWriter extends PrintWriter {
                private MessageExchangeWriter(OutputStream os) {
             super(os);
@@ -182,7 +181,7 @@
             for (Object key : message.getPropertyNames()) {
writeProperty(key, message.getProperty(key.toString()));
             }
-            println();println("- content -");
+            println(); println("- content -");
         }
@@ -196,10 +195,10 @@
      */
private class FileAuditorStrategyImpl implements FileAuditorStrategy { - private final DateFormat DATEFORMAT = new SimpleDateFormat("yyyy-MM-dd"); + private final DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd"); public String getFileName(MessageExchange exchange) { - return DATEFORMAT.format(new Date()) + File.separatorChar + exchange.getExchangeId().replaceAll("[:\\.]", "_"); + return dateformat.format(new Date()) + File.separatorChar + exchange.getExchangeId().replaceAll("[:\\.]", "_");
         }
     }
 }

Modified: servicemix/smx3/branches/servicemix-3.2/core/servicemix-audit/src/main/java/org/apache/servicemix/jbi/audit/file/FileAuditorStrategy.java URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/core/servicemix-audit/src/main/java/org/apache/servicemix/jbi/audit/file/FileAuditorStrategy.java?rev=659079&r1=659078&r2=659079&view=diff ============================================================================== --- servicemix/smx3/branches/servicemix-3.2/core/servicemix-audit/src/main/java/org/apache/servicemix/jbi/audit/file/FileAuditorStrategy.java (original) +++ servicemix/smx3/branches/servicemix-3.2/core/servicemix-audit/src/main/java/org/apache/servicemix/jbi/audit/file/FileAuditorStrategy.java Thu May 22 04:22:41 2008
@@ -26,6 +26,6 @@
     /**
* Get the file name for writing the given [EMAIL PROTECTED] MessageExchange}
      */
-    public String getFileName(MessageExchange exchange);
+    String getFileName(MessageExchange exchange);
}

Modified: servicemix/smx3/branches/servicemix-3.2/core/servicemix-audit/src/test/java/org/apache/servicemix/jbi/audit/file/FileAuditorTest.java URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/core/servicemix-audit/src/test/java/org/apache/servicemix/jbi/audit/file/FileAuditorTest.java?rev=659079&r1=659078&r2=659079&view=diff ============================================================================== --- servicemix/smx3/branches/servicemix-3.2/core/servicemix-audit/src/test/java/org/apache/servicemix/jbi/audit/file/FileAuditorTest.java (original) +++ servicemix/smx3/branches/servicemix-3.2/core/servicemix-audit/src/test/java/org/apache/servicemix/jbi/audit/file/FileAuditorTest.java Thu May 22 04:22:41 2008
@@ -19,23 +19,19 @@
 import java.io.File;
 import java.util.Locale;
-import javax.jbi.messaging.ExchangeStatus;
 import javax.jbi.messaging.InOnly;
-import javax.jbi.messaging.MessageExchange;
import junit.framework.TestCase; -import org.apache.servicemix.jbi.audit.file.FileAuditor;
 import org.apache.servicemix.jbi.container.JBIContainer;
 import org.apache.servicemix.jbi.jaxp.StringSource;
 import org.apache.servicemix.jbi.util.FileUtil;
 import org.apache.servicemix.tck.ReceiverComponent;
 import org.apache.servicemix.tck.SenderComponent;
-import org.hsqldb.jdbc.jdbcDataSource;
public class FileAuditorTest extends TestCase { - private static final File directory = new File("target/tests/FileAuditor"); + private static final File DIRECTORY = new File("target/tests/FileAuditor"); private JBIContainer jbi; @@ -44,8 +40,8 @@
         jbi.setFlowName("st");
         jbi.setEmbedded(true);
         jbi.init();
-        FileUtil.deleteFile(directory); -        directory.mkdirs();
+        FileUtil.deleteFile(DIRECTORY); +        DIRECTORY.mkdirs();
     }
protected void tearDown() throws Exception {
@@ -63,7 +59,7 @@
FileAuditor auditor = new FileAuditor();
         auditor.setContainer(jbi);
-        auditor.setDirectory(directory);
+        auditor.setDirectory(DIRECTORY);
         auditor.afterPropertiesSet();
InOnly inonly = sender.createInOnlyExchange(ReceiverComponent.SERVICE, null, null);

Modified: servicemix/smx3/branches/servicemix-3.2/parent/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/parent/pom.xml?rev=659079&r1=659078&r2=659079&view=diff ==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/parent/pom.xml (original)
+++ servicemix/smx3/branches/servicemix-3.2/parent/pom.xml Thu May 22 04:22:41 2008
@@ -73,6 +73,7 @@
                     <linkXRef>false</linkXRef>
<suppressionsLocation>smx-checkstyle-suppressions.xml</suppressionsLocation> <sourceDirectory>${basedir}/src</sourceDirectory>
+                    <headerLocation>LICENSE</headerLocation>
                   </configuration>
                   <goals>
                     <goal>checkstyle</goal>












Reply via email to