jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Maven 2.x JAR Plugin
  • MJAR-111

Index creation fails when classpath is set in manifest

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Duplicate
  • Affects Version/s: 2.2
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    Windows XP, IBM SDK 1.5.0

Description

The following plugin configuration fails deterministically, as JarArchiver tries to open a directory folder as a RandomAccessFile, which fails (at least on Windows):

<plugin>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<index>true</index>
<manifest>
<addClasspath>true</addClasspath>
</manifest>
</archive>
</configuration>
</plugin>

The error is:
$ mvn clean package -e
[...]
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error assembling JAR

Embedded error: Problem creating jar: d:\adesso\eclipse-Arbeitsbereiche\Portale2-Test1\indextest\target\classes (Zugriff
verweigert)
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Error assembling JAR
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:583)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:49
9)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:478)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.jav
a:330)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.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.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
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: Error assembling JAR
at org.apache.maven.plugin.jar.AbstractJarMojo.createArchive(AbstractJarMojo.java:225)
at org.apache.maven.plugin.jar.AbstractJarMojo.execute(AbstractJarMojo.java:237)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
... 16 more
Caused by: org.codehaus.plexus.archiver.ArchiverException: Problem creating jar: d:\adesso\eclipse-Arbeitsbereiche\Porta
le2-Test1\indextest\target\classes (Zugriff verweigert)
at org.codehaus.plexus.archiver.AbstractArchiver.createArchive(AbstractArchiver.java:690)
at org.apache.maven.archiver.MavenArchiver.createArchive(MavenArchiver.java:421)
at org.apache.maven.plugin.jar.AbstractJarMojo.createArchive(AbstractJarMojo.java:218)
... 19 more
Caused by: java.io.FileNotFoundException: d:\adesso\eclipse-Arbeitsbereiche\Portale2-Test1\indextest\target\classes (Zug
riff verweigert)
at java.io.RandomAccessFile.open(Native Method)
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:243)
at org.codehaus.plexus.archiver.zip.ZipFile.<init>(ZipFile.java:147)
at org.codehaus.plexus.archiver.zip.ZipFile.<init>(ZipFile.java:132)
at org.codehaus.plexus.archiver.jar.JarArchiver.grabFilesAndDirs(JarArchiver.java:922)
at org.codehaus.plexus.archiver.jar.JarArchiver.createIndexList(JarArchiver.java:499)
at org.codehaus.plexus.archiver.jar.JarArchiver.finalizeZipOutputStream(JarArchiver.java:422)
at org.codehaus.plexus.archiver.zip.AbstractZipArchiver.execute(AbstractZipArchiver.java:245)
at org.codehaus.plexus.archiver.AbstractArchiver.createArchive(AbstractArchiver.java:673)
... 21 more
[...]

See also minimum test project attached.

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. GZip Archive
    index-test.tar.gz
    18/Sep/08 3:33 AM
    0.8 kB
    Karsten Tinnefeld

Issue Links

is duplicated by

Bug - A problem which impairs or prevents the functions of the product. MJAR-69 When 'index' and 'addClasspath' are both true, plugin fails.

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Andrea Aime added a comment - 16/May/09 9:37 AM

The same problems occurs using Maven 2.1.0, with the same configuration, in some of the GeoTools modules, using JDK 1.5.0_18 on Ubuntu 9.04. Strange enough, it seems to be happening only on those modules that do not have no dependencies that should be registered in the manifest (e.g., no dependencies at all, or provided dependencies). The moment I add a single external dependency that will result in the classpath entry to be written in the manifest file the bug disappears.

Show
Andrea Aime added a comment - 16/May/09 9:37 AM The same problems occurs using Maven 2.1.0, with the same configuration, in some of the GeoTools modules, using JDK 1.5.0_18 on Ubuntu 9.04. Strange enough, it seems to be happening only on those modules that do not have no dependencies that should be registered in the manifest (e.g., no dependencies at all, or provided dependencies). The moment I add a single external dependency that will result in the classpath entry to be written in the manifest file the bug disappears.

People

  • Assignee:
    Unassigned
    Reporter:
    Karsten Tinnefeld
Vote (1)
Watch (2)

Dates

  • Created:
    18/Sep/08 3:33 AM
    Updated:
    28/Oct/09 1:18 PM
    Resolved:
    28/Oct/09 1:18 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.