Marcus Höjvall created MCHECKSTYLE-245:
------------------------------------------
Summary: "zip file closed" error after a few successful audits
Key: MCHECKSTYLE-245
URL: https://jira.codehaus.org/browse/MCHECKSTYLE-245
Project: Maven Checkstyle Plugin
Issue Type: Bug
Affects Versions: 2.12.1
Environment: OS X 10.9.4 (13E28)
Reporter: Marcus Höjvall
I'm getting an error in the checkstyle plugin in the middle of running maven
install. Checkstyle is running fine until it fails after a few modules. If I
resume the build from the failed module it finishes successfully.
The checkstyle module is a part of an external library project, it contains the
checkstyle.xml file and the license file. I had to add the dependency to the
dependencies and not just in the plugin for maven to download the jar from our
repository.
{code:title=root pom.xml|borderStyle=solid}
<dependencies>
...
<dependency>
<groupId>com.izettle</groupId>
<artifactId>izettle-checkstyle</artifactId>
<version>1.0.6</version>
</dependency>
</dependencies>
...
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.12.1</version>
<dependencies>
<dependency>
<groupId>com.izettle</groupId>
<artifactId>izettle-checkstyle</artifactId>
<version>1.0.6</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>validate</id>
<phase>compile</phase>
<goals>
<goal>checkstyle</goal>
</goals>
<configuration>
<includeTestSourceDirectory>false</includeTestSourceDirectory>
<failsOnError>true</failsOnError>
<consoleOutput>true</consoleOutput>
<configLocation>checkstyle/checkstyle.xml</configLocation>
<headerLocation>checkstyle/LICENSE.txt</headerLocation>
<linkXRef>false</linkXRef>
<propertyExpansion>checkstyle-suppression-file=${project.basedir}/checkstyle-suppression.xml</propertyExpansion>
</configuration>
</execution>
</executions>
</plugin>
...
{code}
{code:title=submodule pom.xml|borderStyle=solid}
<profiles>
<!-- This profile is to run checkstyle-->
<profile>
<id>all</id>
<build>
<plugins>
<plugin>
<artifactId>maven-checkstyle-plugin</artifactId>
<executions>
<execution>
<configuration>
<propertyExpansion>checkstyle-suppression-file=${project.parent.basedir}/checkstyle-suppression.xml</propertyExpansion>
</configuration>
<id>validate</id>
<goals>
<goal>checkstyle</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
...
{code}
{code:title=Stacktrase|borderStyle=solid}
[INFO] --- maven-checkstyle-plugin:2.12.1:checkstyle (validate) @ izettle-admin
---
[INFO] Starting audit...
Audit done.
...
[INFO] --- maven-checkstyle-plugin:2.12.1:checkstyle (validate) @
izettle-api-client ---
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] izettle-parent .................................... SUCCESS [ 0.224 s]
[INFO] izettle-ejb-client ................................ SUCCESS [ 8.635 s]
[INFO] izettle-lib ....................................... SUCCESS [ 1.624 s]
[INFO] izettle-ejb ....................................... SUCCESS [ 18.599 s]
[INFO] izettle-kyc ....................................... SUCCESS [ 0.008 s]
[INFO] izettle-kyc-service ............................... SUCCESS [ 10.737 s]
[INFO] izettle-enrollment ................................ SUCCESS [ 1.799 s]
[INFO] izettle-clearing .................................. SUCCESS [ 1.296 s]
[INFO] izettle-admin ..................................... SUCCESS [ 12.009 s]
[INFO] izettle-api-client ................................ FAILURE [ 0.077 s]
[INFO] izettle-api ....................................... SKIPPED
[INFO] izettle-timers .................................... SKIPPED
[INFO] izettle-web ....................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 55.263 s
[INFO] Finished at: 2014-08-12T09:38:33+01:00
[INFO] Final Memory: 340M/1776M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-checkstyle-plugin:2.12.1:checkstyle (validate)
on project izettle-api-client: Execution validate of goal
org.apache.maven.plugins:maven-checkstyle-plugin:2.12.1:checkstyle failed: zip
file closed -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal
org.apache.maven.plugins:maven-checkstyle-plugin:2.12.1:checkstyle (validate)
on project izettle-api-client: Execution validate of goal
org.apache.maven.plugins:maven-checkstyle-plugin:2.12.1:checkstyle failed: zip
file closed
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224)
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108)
at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
at
org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at
org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at
org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at
org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at
org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at
org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution validate
of goal org.apache.maven.plugins:maven-checkstyle-plugin:2.12.1:checkstyle
failed: zip file closed
at
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:144)
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
Caused by: java.lang.IllegalStateException: zip file closed
at java.util.zip.ZipFile.ensureOpen(ZipFile.java:634)
at java.util.zip.ZipFile.getEntry(ZipFile.java:305)
at java.util.jar.JarFile.getEntry(JarFile.java:226)
at sun.net.www.protocol.jar.URLJarFile.getEntry(URLJarFile.java:128)
at java.util.jar.JarFile.getJarEntry(JarFile.java:209)
at
org.codehaus.plexus.resource.loader.JarHolder.getPlexusResource(JarHolder.java:148)
at
org.codehaus.plexus.resource.loader.JarResourceLoader.getResource(JarResourceLoader.java:169)
at
org.apache.maven.plugin.checkstyle.resource.LicenseResourceManager.getResource(LicenseResourceManager.java:70)
at
org.codehaus.plexus.resource.DefaultResourceManager.getResourceAsFile(DefaultResourceManager.java:91)
at
org.apache.maven.plugin.checkstyle.DefaultCheckstyleExecutor.getOverridingProperties(DefaultCheckstyleExecutor.java:460)
at
org.apache.maven.plugin.checkstyle.DefaultCheckstyleExecutor.getConfiguration(DefaultCheckstyleExecutor.java:299)
at
org.apache.maven.plugin.checkstyle.DefaultCheckstyleExecutor.executeCheckstyle(DefaultCheckstyleExecutor.java:185)
at
org.apache.maven.plugin.checkstyle.AbstractCheckstyleReport.executeReport(AbstractCheckstyleReport.java:488)
at
org.apache.maven.plugin.checkstyle.CheckstyleReport.executeReport(CheckstyleReport.java:156)
at
org.apache.maven.reporting.AbstractMavenReport.generate(AbstractMavenReport.java:196)
at
org.apache.maven.reporting.AbstractMavenReport.execute(AbstractMavenReport.java:104)
at
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
... 20 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please
read the following articles:
[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :izettle-api-client
{code}
--
This message was sent by Atlassian JIRA
(v6.1.6#6162)