You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Sriharan Sithamparanathan (JIRA)" <ji...@codehaus.org> on 2009/09/11 06:15:31 UTC

[jira] Commented: (MPCHECKSTYLE-20) Unable to get class information for custom exceptions

    [ http://jira.codehaus.org/browse/MPCHECKSTYLE-20?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=190573#action_190573 ] 

Sriharan Sithamparanathan commented on MPCHECKSTYLE-20:
-------------------------------------------------------

I had a same issue when I run checkstyle task by using ant. Workaround is provide a customized exception classes in the checkstyle class path.
<checkstyle config="<<checkstyle.xml>>" failOnViolation="false">
            <fileset dir="<<source path>>">
                <include name="**/*.java"/>               
	<exclude name="**/*Test.java" />
            </fileset>
<classpath path="<<path of custom exception class>>"/>					
          	  <formatter type="xml" toFile="checkstyle-report.xml"/>
   </checkstyle>

In the class path you can specify jar file path which is contains all the customized exception classes.

Example: if you have customized exception class InvalidNumberExcpetion class then that class should be in the checkstyle task class path.


> Unable to get class information for custom exceptions
> -----------------------------------------------------
>
>                 Key: MPCHECKSTYLE-20
>                 URL: http://jira.codehaus.org/browse/MPCHECKSTYLE-20
>             Project: Maven 1.x Checkstyle Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3
>         Environment: maven-1.0-rc2
>            Reporter: Ryan Sonnek
>
> checkstyle reports an error "Unable to get class information" for custom exceptions within the same project.  it is able to load exceptions that are listed as dependencies for the project, but not for other exceptions.  one workaround is to only use throws Exception in the signiture, but that's really a hack.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira