Can't read Checkstyle configuration
"Lewis, Eric" <[email protected]> Thu, 6 Nov 2008 17:15:53 +0100
| Newsgroups | gmane.comp.java.audit.checkstyle.user |
|---|---|
| Message-ID | <[email protected]> |
Hi
I'm trying to use Checkstyle within Maven. I've asked this question
already to the Maven mailing list, but to no avail.
But since the underlying error comes from Checkstyle itself, maybe
someone here can help me...
The Maven plugin can specify a Checkstyle configuration file, which in
my case is a URL.
It then copies it to the local directory of the project it's building,
but then Checkstyle can't read it.
And that's the point: Checkstyle isn't able to open the file's stream,
but I have no idea why. The file exists and was written by the same user
that's trying to read it (in my case, 'jboss'):
jboss@xyz /ige/temp/continuous_integration/ipi-utils/time-util/target$
ls -al
total 60
drwxrwxr-x 7 jboss jboss 4096 Nov 6 16:34 .
drwxrwxr-x 5 jboss jboss 4096 Nov 6 16:34 ..
-rw-rw-r-- 1 jboss jboss 4113 Nov 6 16:34 checkstyle-checker.xml
-rw-rw-r-- 1 jboss jboss 1666 Nov 6 16:34 checkstyle-header.txt
drwxrwxr-x 3 jboss jboss 4096 Nov 6 16:34 classes
drwxrwxr-x 2 jboss jboss 4096 Nov 6 16:34 maven-archiver
drwxrwxr-x 2 jboss jboss 4096 Nov 6 16:34 site
drwxrwxr-x 2 jboss jboss 4096 Nov 6 16:34 surefire-reports
drwxrwxr-x 3 jboss jboss 4096 Nov 6 16:34 test-classes
-rw-rw-r-- 1 jboss jboss 17144 Nov 6 16:34 time-util-1.0.0-SNAPSHOT.jar
jboss@xyz /ige/temp/continuous_integration/ipi-utils/time-util/target$
more checkstyle-checker.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE checkstyle-packages PUBLIC
"-//Puppy Crawl//DTD Package Names 1.0//EN"
"http://www.puppycrawl.com/dtds/packages_1_0.dtd">
<module name="Checker">
<module name="PackageHtml" />
<module name="TreeWalker">
<property name="charset" value="UTF-8" />
<module name="JavadocMethod" />
... (etc.)
I'm using the Checkstyle Plugin 2.2, which requires Checkstyle 4.4
Any help is greatly appreciated!
Best regards,
Eric
[DEBUG] Configuring mojo
'org.apache.maven.plugins:maven-checkstyle-plugin:2.2:checkstyle' -->
[DEBUG] (f) cacheFile =
/ige/temp/continuous_integration/ipi-utils/time-util/target/checkstyle-c
achefile
[DEBUG] (f) configLocation =
http://buildconfig.ipie.ch/checkstyle/checkstyle.xml
[DEBUG] (f) consoleOutput = false
[DEBUG] (f) enableFilesSummary = true
[DEBUG] (f) enableRSS = false
[DEBUG] (f) enableRulesSummary = true
[DEBUG] (f) enableSeveritySummary = true
[DEBUG] (f) encoding = UTF-8
[DEBUG] (f) failsOnError = false
[DEBUG] (f) format = sun
[DEBUG] (f) headerFile =
/ige/temp/continuous_integration/ipi-utils/time-util/LICENSE.txt
[DEBUG] (f) headerLocation = LICENSE.txt
[DEBUG] (f) includeTestSourceDirectory = true
[DEBUG] (f) includes = **/*.java
[DEBUG] (f) linkXRef = true
[DEBUG] (f) outputDirectory =
/ige/temp/continuous_integration/ipi-utils/time-util/target/site
[DEBUG] (f) outputFile =
/ige/temp/continuous_integration/ipi-utils/time-util/target/checkstyle-r
esult.xml
[DEBUG] (f) outputFileFormat = xml
[DEBUG] (f) project = MavenProject: ch.ipi:time-util:1.0.0-SNAPSHOT @
/ige/temp/continuous_integration/ipi-utils/time-util/pom.xml
[DEBUG] (f) skip = false
[DEBUG] (f) sourceDirectory =
/ige/temp/continuous_integration/ipi-utils/time-util/src/main/java
[DEBUG] (f) suppressionsFileExpression = checkstyle.suppressions.file
[DEBUG] (f) testSourceDirectory =
/ige/temp/continuous_integration/ipi-utils/time-util/src/test/java
[DEBUG] (f) xrefLocation =
/ige/temp/continuous_integration/ipi-utils/time-util/target/site/xref
[DEBUG] -- end configuration --
[INFO] [checkstyle:checkstyle]
[DEBUG] URLResourceLoader: Found
'http://buildconfig.ipie.ch/checkstyle/checkstyle.xml' at ''
[DEBUG] The resource
'http://buildconfig.ipie.ch/checkstyle/checkstyle.xml' found using the
org.codehaus.plexus.resource.loader.URLResourceLoader@3e5e9db7.
[DEBUG] The resource 'LICENSE.txt' found using the
org.codehaus.plexus.resource.loader.ThreadContextClasspathResourceLoader
@633a1778.
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] An error has occurred in Checkstyle report generation.
Embedded error: Failed during checkstyle configuration
Connection timed out
[INFO]
------------------------------------------------------------------------
[DEBUG] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: An error has
occurred in Checkstyle report generation.
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Default
LifecycleExecutor.java:583)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoa
l(DefaultLifecycleExecutor.java:512)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultL
ifecycleExecutor.java:482)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandle
Failures(DefaultLifecycleExecutor.java:330)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(
DefaultLifecycleExecutor.java:291)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifec
ycleExecutor.java:142)
at
org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: An error has
occurred in Checkstyle report generation.
at
org.apache.maven.reporting.AbstractMavenReport.execute(AbstractMavenRepo
rt.java:79)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginMa
nager.java:451)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Default
LifecycleExecutor.java:558)
... 16 more
Caused by: org.apache.maven.reporting.MavenReportException: Failed
during checkstyle configuration
at
org.apache.maven.plugin.checkstyle.CheckstyleReport.executeReport(Checks
tyleReport.java:648)
at
org.apache.maven.reporting.AbstractMavenReport.generate(AbstractMavenRep
ort.java:98)
at
org.apache.maven.reporting.AbstractMavenReport.execute(AbstractMavenRepo
rt.java:73)
... 18 more
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException:
unable to read
/ige/temp/continuous_integration/ipi-utils/time-util/target/checkstyle-c
hecker.xml - unable to read from stream
at
com.puppycrawl.tools.checkstyle.ConfigurationLoader.loadConfiguration(Co
nfigurationLoader.java:309)
at
com.puppycrawl.tools.checkstyle.ConfigurationLoader.loadConfiguration(Co
nfigurationLoader.java:268)
at
org.apache.maven.plugin.checkstyle.CheckstyleReport.executeReport(Checks
tyleReport.java:607)
... 20 more
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException:
unable to read from stream
at
com.puppycrawl.tools.checkstyle.ConfigurationLoader.loadConfiguration(Co
nfigurationLoader.java:361)
at
com.puppycrawl.tools.checkstyle.ConfigurationLoader.loadConfiguration(Co
nfigurationLoader.java:298)
... 22 more
Caused by: java.net.ConnectException: Connection timed out
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.Socket.connect(Socket.java:519)
at java.net.Socket.connect(Socket.java:469)
at sun.net.NetworkClient.doConnect(NetworkClient.java:157)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:394)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:529)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:233)
at sun.net.www.http.HttpClient.New(HttpClient.java:306)
at sun.net.www.http.HttpClient.New(HttpClient.java:323)
at
sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConn
ection.java:788)
at
sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnecti
on.java:729)
at
sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.ja
va:654)
at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnec
tion.java:977)
at
com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEnt
ity(XMLEntityManager.java:677)
at
com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(XML
EntityManager.java:1315)
at
com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDTDEntity(
XMLEntityManager.java:1282)
at
com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.setInputSource
(XMLDTDScannerImpl.java:283)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver
.dispatch(XMLDocumentScannerImpl.java:1176)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver
.next(XMLDocumentScannerImpl.java:1075)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDri
ver.next(XMLDocumentScannerImpl.java:993)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLD
ocumentScannerImpl.java:647)
at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XM
LNSDocumentScannerImpl.java:140)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.s
canDocument(XMLDocumentFragmentScannerImpl.java:508)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML1
1Configuration.java:807)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML1
1Configuration.java:737)
at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.jav
a:107)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Abstr
actSAXParser.java:1205)
at
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.pars
e(SAXParserImpl.java:522)
at
com.puppycrawl.tools.checkstyle.api.AbstractLoader.parseInputSource(Abst
ractLoader.java:96)
at
com.puppycrawl.tools.checkstyle.ConfigurationLoader.parseInputStream(Con
figurationLoader.java:255)
at
com.puppycrawl.tools.checkstyle.ConfigurationLoader.loadConfiguration(Co
nfigurationLoader.java:344)
... 23 more
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/