views:

39

answers:

2

This is my foo.java file:

/**
 * LICENSE blah-blah-blah
 * @Version $Id$
 */
public class Foo {
}

This is how the file looks after svn update:

/**
 * LICENSE blah-blah-blah
 * @Version $Id: Foo.java 396 2010-10-14 06:31:27Z [email protected] $
 */
public class Foo {
}

The length of line no.3 is over 80 characters and I can't do anything with this, since the value is embedded by SVN. maven-checkstyle-plugin complains with:

Foo.java:3: Line is longer than 80 characters.

Is there anything I can do with this? Can I teach checkstyle to ignore just this particular line?

+1  A: 

In the documentation there is it possible to ignore lines with a particular pattern. So this would solve your problem.

khmarbaise
+1  A: 

You can add an ignorePattern to the LineLength module in your Checkstyle Checker configuration file so that it ignores the line containing version information.

<module name="LineLength">
  <property name="severity" value="inherit"/>
  <property name="ignorePattern" value="^ \* @Version \$Id: .*$"/>
</module>
dogbane