You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Alex Karasulu <ak...@apache.org> on 2009/12/25 16:32:21 UTC

[maven-bundle-plugin] Problems with resources containing '='

Hello Felix Community,

I have a problem with the maven-bundle-plugin where resources containing
file names with '=' are causing the plugin to fail.  I've looked at the
plugin code and it seems the culprit is property string splitting using the
'=' as a token in the plugin's Builder class here on line 590:

            String parts[] = name.split("\\s*=\\s*");

This causes serious issues for us over at the Apache Directory Project where
we are trying to push LDIF files into a bundle for extraction.  The LDIF
files on disk to be rolled up into the bundle as resources have LDAP
DIstinguished Names for their file names like so:

/Users/akarasulu/Projects/directory/schema/shared/ldap-schema/schema/cn=system.ldif

Basically cn=system is the LDAP entry (node) in our LDIF backend/partition.
 The LDIF file on disk contains the content.  This is a vary special
component for us that contains all the basic schema inside the bundle and is
extracted when the service starts up.

etc...

As you can see when the resources is put into the includes property value
and then accessed with this kind of token splitting this causes the file
name to be broken and the result is a "Input file not found" error from the
plugin.  Here's a trace of what this looks like when mvn -X is run to
install the project:

[NOTE: I added some system out lines to just see values in the plugin]

Before the output I just wanted to say that I was going to try to fix this
but there's a lot here that I'm just not understanding.  I can try to fix
this since it's urgent for us but I'm very worried about any changes being
made to this rather complex piece of code.

-------- mvn -X install OUTPUT -------

Missing source file =
/Users/akarasulu/Projects/directory/schema/shared/ldap-schema/schema/cn
Inside noSuchFile: schema/cn
entry =
schema/ou=schema/cn=system.ldif=src/main/resources/schema/ou=schema/cn=system.ldif={}
name =
schema/ou=schema/cn=system.ldif=src/main/resources/schema/ou=schema/cn=system.ldif
entry =
META-INF/DEPENDENCIES=target/maven-shared-archive-resources/META-INF/DEPENDENCIES={}
name =
META-INF/DEPENDENCIES=target/maven-shared-archive-resources/META-INF/DEPENDENCIES
Source before getFile() =
target/maven-shared-archive-resources/META-INF/DEPENDENCIES
Inside copy: from =
/Users/akarasulu/Projects/directory/schema/shared/ldap-schema/target/maven-shared-archive-resources/META-INF/DEPENDENCIES,
to = META-INF/DEPENDENCIES
entry =
META-INF/LICENSE=target/maven-shared-archive-resources/META-INF/LICENSE={}
name =
META-INF/LICENSE=target/maven-shared-archive-resources/META-INF/LICENSE
Source before getFile() =
target/maven-shared-archive-resources/META-INF/LICENSE
Inside copy: from =
/Users/akarasulu/Projects/directory/schema/shared/ldap-schema/target/maven-shared-archive-resources/META-INF/LICENSE,
to = META-INF/LICENSE
entry =
META-INF/NOTICE=target/maven-shared-archive-resources/META-INF/NOTICE={}
name = META-INF/NOTICE=target/maven-shared-archive-resources/META-INF/NOTICE
Source before getFile() =
target/maven-shared-archive-resources/META-INF/NOTICE
Inside copy: from =
/Users/akarasulu/Projects/directory/schema/shared/ldap-schema/target/maven-shared-archive-resources/META-INF/NOTICE,
to = META-INF/NOTICE
[DEBUG] BND Manifest:
[DEBUG]
------------------------------------------------------------------------
[DEBUG] Export-Package:
org.apache.directory.shared.ldap.schema.ldif.extractor
[DEBUG] Manifest-Version: 1.0
[DEBUG] Tool: Bnd-0.0.357
[DEBUG] Bundle-Name: Apache Directory Shared LDAP Schema
[DEBUG] Created-By: 1.6.0_17 (Apple Inc.)
[DEBUG] Bundle-Vendor: The Apache Software Foundation
[DEBUG] Bundle-Version: 0.9.18.SNAPSHOT
[DEBUG] Bnd-LastModified: 1261754742711
[DEBUG] Bundle-ManifestVersion: 2
[DEBUG] Bundle-Description: Jar bundled LDIF files containing schema data
using the Apache Directory    specific meta schema for describing schema
information using LDAP.  This    jar can be used by clients as well as by
ApacheDS' schema partition.
[DEBUG] Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
[DEBUG] Import-Package:
org.apache.directory.shared.ldap.schema.ldif.extractor,org.slf4j;version="1.5"
[DEBUG] Bundle-SymbolicName: shared-ldap-schema
[DEBUG] Bundle-DocURL: http://www.apache.org/
[DEBUG]
------------------------------------------------------------------------
[DEBUG] Final Manifest:
[DEBUG]
------------------------------------------------------------------------
[DEBUG] Export-Package:
org.apache.directory.shared.ldap.schema.ldif.extractor
[DEBUG] Built-By: akarasulu
[DEBUG] Manifest-Version: 1.0
[DEBUG] Tool: Bnd-0.0.357
[DEBUG] Bundle-Name: Apache Directory Shared LDAP Schema
[DEBUG] Created-By: Apache Maven Bundle Plugin
[DEBUG] Bundle-Vendor: The Apache Software Foundation
[DEBUG] Build-Jdk: 1.6.0_17
[DEBUG] Bundle-Version: 0.9.18.SNAPSHOT
[DEBUG] Bnd-LastModified: 1261754742711
[DEBUG] Bundle-ManifestVersion: 2
[DEBUG] Bundle-Description: Jar bundled LDIF files containing schema data
using the Apache Directory    specific meta schema for describing schema
information using LDAP.  This    jar can be used by clients as well as by
ApacheDS' schema partition.
[DEBUG] Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
[DEBUG] Import-Package:
org.apache.directory.shared.ldap.schema.ldif.extractor,org.slf4j;version="1.5"
[DEBUG] Bundle-SymbolicName: shared-ldap-schema
[DEBUG] Bundle-DocURL: http://www.apache.org/
[DEBUG]
------------------------------------------------------------------------
[ERROR] Error building bundle
org.apache.directory.shared:shared-ldap-schema:bundle:0.9.18-SNAPSHOT :
Input file does not exist: schema/cn
[ERROR] Error building bundle
org.apache.directory.shared:shared-ldap-schema:bundle:0.9.18-SNAPSHOT :
Input file does not exist: schema/ou
[ERROR] Error building bundle
org.apache.directory.shared:shared-ldap-schema:bundle:0.9.18-SNAPSHOT :
Input file does not exist: schema.ldif
[ERROR] Error(s) found in bundle configuration
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Error(s) found in bundle configuration

[INFO]
------------------------------------------------------------------------
[DEBUG] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Error(s) found in
bundle configuration
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:703)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:41)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.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: Error(s) found in
bundle configuration
at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:357)
at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:240)
at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:231)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
... 17 more
Caused by: org.apache.maven.plugin.MojoFailureException: Error(s) found in
bundle configuration
at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:309)
... 21 more
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 7 seconds
[INFO] Finished at: Fri Dec 25 10:25:42 EST 2009
[INFO] Final Memory: 29M/80M
[INFO]
------------------------------------------------------------------------


-- 
Alex Karasulu
My Blog :: http://www.jroller.com/akarasulu/
Apache Directory Server :: http://directory.apache.org
Apache MINA :: http://mina.apache.org