Results 1 to 7 of 7

Thread: maven-bundle-plugin Error calculating classpath...

Hybrid View

  1. #1

    Question maven-bundle-plugin Error calculating classpath...

    Hi @all (again ;-) )

    Can anybody tell me why I get a
    org.apache.maven.lifecycle.LifecycleExecutionExcep tion: Error calculating classpath for project MavenProject:

    when compiling/packaging my project with maven-bundle-plugin. (it is the first bundle which gets compiled)

    There is also the confusing ZipException which gets thrown during compile process but I don't know which file causes this - I have already cleaned my .m2 folder and downloaded all dep. again.

    PHP Code:
    org.apache.maven.lifecycle.LifecycleExecutionExceptionError calculating classpath for project MavenProjectcom.testapp:com.testapp.common:0.01-SNAPSHOT @ /home/development/testapp/com.testapp.common/pom.xml
        at org
    .apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:583)
        
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:499)
        
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:478)
        
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java: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: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 byorg.apache.maven.plugin.MojoExecutionExceptionError calculating classpath for project MavenProjectcom.testapp:com.testapp.common:0.01-SNAPSHOT @ /home/development/testapp/com.testapp.common/pom.xml
        at org
    .apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:126)
        
    at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:118)
        
    at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
        
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
        ... 
    16 more
    Caused by
    java.util.zip.ZipExceptionerror in opening zip file
        at java
    .util.zip.ZipFile.open(Native Method)
        
    at java.util.zip.ZipFile.<init>(ZipFile.java:114)
        
    at java.util.zip.ZipFile.<init>(ZipFile.java:131)
        
    at aQute.lib.osgi.ZipResource.build(ZipResource.java:39)
        
    at aQute.lib.osgi.ZipResource.build(ZipResource.java:32)
        
    at aQute.lib.osgi.Jar.<init>(Jar.java:31)
        
    at org.apache.felix.bundleplugin.BundlePlugin.getClasspath(BundlePlugin.java:295)
        
    at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:123)
        ... 
    19 more 

    Please help me ;-)

    Thanks!

    --wolfman
    Last edited by wolfman22; Oct 9th, 2008 at 07:11 AM. Reason: typo
    cu
    Woifal

  2. #2

    Default

    post your pom file, please

  3. #3

    Default

    ok, sure my pom files (i was with my laptop when starting this thread ;-)

    parent-Pom:
    PHP Code:
    <!--This is the main pom-->
    <
    project xmlns="http://maven.apache.org/POM/4.0.0"
             
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
        <
    modelVersion>4.0.0</modelVersion>
        <
    groupId>com.testapp</groupId>
        <
    artifactId>com.testapp</artifactId>
        <
    version>${testappVersion}</version>
        <
    name>Complete Application</name>
        <
    packaging>pom</packaging>

        <
    modules>
            <
    module>com.testapp.db</module>
            <
    module>com.testapp.web</module>
            <
    module>com.testapp.common</module>
        </
    modules>

        <
    properties>
            <
    pgVersion>8.3.603</pgVersion>
            <
    testappVersion>0.01-SNAPSHOT</testappVersion>
        </
    properties>

        <
    build>
            <
    extensions>
                <
    extension>
                    <
    groupId>org.postgresql</groupId>
                    <
    artifactId>com.springsource.org.postgresql.jdbc3</artifactId>
                    <
    version>${pgVersion}</version>
                </
    extension>
            </
    extensions>
            <
    plugins>
                <
    plugin>
                    <
    groupId>org.apache.maven.plugins</groupId>
                    <
    artifactId>maven-compiler-plugin</artifactId>
                    <
    configuration>
                        <
    source>1.6</source>
                        <
    target>1.6</target>
                    </
    configuration>
                </
    plugin>
                <
    plugin>
                    <
    groupId>org.codehaus.mojo</groupId>
                    <
    artifactId>hibernate3-maven-plugin</artifactId>
                    <
    version>2.0-alpha-2</version>
                </
    plugin>
            </
    plugins>
        </
    build>

        <
    dependencyManagement>
            <
    dependencies>

                <
    dependency>
                    <
    groupId>org.apache.felix</groupId>
                    <
    artifactId>org.osgi.core</artifactId>
                    <
    version>1.0.0</version>
                </
    dependency>


                <!-- =========================================================== -->
                <!-- 
    Log dep                                                       -->
                <!-- =========================================================== -->
                <
    dependency>
                    <
    groupId>org.apache.log4j</groupId>
                    <
    artifactId>com.springsource.org.apache.log4j</artifactId>
                    <
    version>1.2.15</version>
                </
    dependency>

                <!-- =========================================================== -->
                <!-- 
    Log dep                                                       -->
                <!-- =========================================================== -->
                <
    dependency>
                    <
    groupId>org.apache.commons</groupId>
                    <
    artifactId>com.springsource.org.apache.commons.lang</artifactId>
                    <
    version>2.4.0</version>
                </
    dependency>

                <!-- =========================================================== -->
                <!-- 
    DB dep                                                        -->
                <!-- =========================================================== -->
                <
    dependency>
                    <
    groupId>org.hibernate</groupId>
                    <
    artifactId>org.hibernate.ejb-library</artifactId>
                    <
    type>libd</type>
                    <
    version>3.3.2.GA</version>
                </
    dependency>

                <
    dependency>
                    <
    groupId>org.postgresql</groupId>
                    <
    artifactId>com.springsource.org.postgresql.jdbc3</artifactId>
                    <
    version>${pgVersion}</version>
                </
    dependency>


                <!-- =========================================================== -->
                <!-- 
    spring                                                      -->
                <!-- =========================================================== -->

                <
    dependency>
                    <
    groupId>org.springframework</groupId>
                    <
    artifactId>org.springframework.spring-library</artifactId>
                    <
    type>libd</type>
                    <
    version>2.5.5.A</version>
                </
    dependency>

                <!-- =========================================================== -->
                <!-- 
    JUnit                                                        -->
                <!-- =========================================================== -->
                <
    dependency>
                    <
    groupId>org.junit</groupId>
                    <
    artifactId>com.springsource.org.junit</artifactId>
                    <
    version>4.4.0</version>
                </
    dependency>

            </
    dependencies>
        </
    dependencyManagement>

        <
    repositories>
            <
    repository>
                <
    id>com.springsource.repository.bundles.release</id>
                <
    name>SpringSource Enterprise Bundle Repository SpringSource Bundle Releases</name>
                <
    url>http://repository.springsource.com/maven/bundles/release</url>
            
    </repository>
            <
    repository>
                <
    id>com.springsource.repository.bundles.external</id>
                <
    name>SpringSource Enterprise Bundle Repository External Bundle Releases</name>
                <
    url>http://repository.springsource.com/maven/bundles/external</url>
            
    </repository>

            <
    repository>
                <
    id>com.springsource.repository.libraries.release</id>
                <
    name>SpringSource Enterprise Bundle Repository SpringSource Library Releases</name>
                <
    url>http://repository.springsource.com/maven/libraries/release</url>
            
    </repository>
            <
    repository>
                <
    id>com.springsource.repository.libraries.external</id>
                <
    name>SpringSource Enterprise Bundle Repository External Library Releases</name>
                <
    url>http://repository.springsource.com/maven/libraries/external</url>
            
    </repository>

        </
    repositories>

    </
    project
    one child-module: common
    PHP Code:
    <project xmlns="http://maven.apache.org/POM/4.0.0"
             
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
        <
    modelVersion>4.0.0</modelVersion>
        <
    parent>
            <
    groupId>com.testapp</groupId>
            <
    artifactId>com.testapp</artifactId>
            <
    version>${testappVersion}</version>
        </
    parent>

        <
    artifactId>com.testapp.common</artifactId>
        <
    packaging>bundle</packaging>
        <
    name>Common</name>

        <
    build>
            <
    plugins>
                <
    plugin>
                    <
    groupId>org.apache.felix</groupId>
                    <
    artifactId>maven-bundle-plugin</artifactId>
                    <
    extensions>true</extensions>
                    <
    version>1.0.0</version>
                    <
    configuration>
                        <
    instructions>
                            <
    manifestLocation>META-INF</manifestLocation>
                            <
    Export-Package>com.testapp.common*</Export-Package>
                            <
    Import-Bundle>*</Import-Bundle>
                        </
    instructions>
                    </
    configuration>
                </
    plugin>
            </
    plugins>
            <
    pluginManagement>
                <
    plugins>
                    <
    plugin>
                        <
    groupId>org.apache.maven.plugins</groupId>
                        <
    artifactId>maven-compiler-plugin</artifactId>
                        <
    configuration>
                            <
    source>1.6</source>
                            <
    target>1.6</target>
                        </
    configuration>
                    </
    plugin>
                </
    plugins>

            </
    pluginManagement>
        </
    build>

        <
    dependencies>

            <!-- =========================================================== -->
            <!-- 
    Log dep                                                       -->
            <!-- =========================================================== -->
            <
    dependency>
                <
    groupId>org.apache.log4j</groupId>
                <
    artifactId>com.springsource.org.apache.log4j</artifactId>
            </
    dependency>


            <!-- =========================================================== -->
            <!-- 
    DB dep                                                        -->
            <!-- =========================================================== -->
            <
    dependency>
                <
    groupId>org.hibernate</groupId>
                <
    artifactId>org.hibernate.ejb-library</artifactId>
                <
    type>libd</type>
            </
    dependency>

            <!-- =========================================================== -->
            <!-- 
    JUnit                                                        -->
            <!-- =========================================================== -->
            <
    dependency>
                <
    groupId>org.junit</groupId>
                <
    artifactId>com.springsource.org.junit</artifactId>
            </
    dependency>

            <!-- =========================================================== -->
            <!-- 
    spring                                                      -->
            <!-- =========================================================== -->
            <
    dependency>
                <
    groupId>org.springframework</groupId>
                <
    artifactId>org.springframework.spring-library</artifactId>
                <
    type>libd</type>
            </
    dependency>
        </
    dependencies>
    </
    project
    cu
    Woifal

  4. #4

    Default

    and web-module-bundle-pom:
    PHP Code:
    <project xmlns="http://maven.apache.org/POM/4.0.0"
             
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
        <
    modelVersion>4.0.0</modelVersion>
        <
    parent>
            <
    groupId>com.testapp</groupId>
            <
    artifactId>com.testapp</artifactId>
            <
    version>${testappVersion}</version>
        </
    parent>
        <
    packaging>bundle</packaging>

        <
    artifactId>com.testapp.web</artifactId>
        <
    name>Webapp Application</name>

        <
    properties>
            <!--<
    rfVersion>3.2.1.GA</rfVersion>-->
            <
    rfVersion>3.1.4.GA</rfVersion>
        </
    properties>


        <!-- for 
    packaging as an OSGi bundlewe use the maven-bundle-plugin -->
        <!-- 
    see http://felix.apache.org/site/maven-bundle-plugin-bnd.html for more info -->
        
    <build>
            <
    plugins>
                <
    plugin>
                    <
    groupId>org.apache.felix</groupId>
                    <
    artifactId>maven-bundle-plugin</artifactId>
                    <
    extensions>true</extensions>
                    <
    version>1.0.0</version>
                    <
    configuration>
                        <
    instructions>
                            <
    manifestLocation>META-INF</manifestLocation>
                            <
    Export-Package>com.testapp.web*</Export-Package>
                            <!--<
    Import-Library>org.springframework.spring;version="[2.5.5.A,2.5.5.A]"</Import-Library>
                            <
    Import-Library>org.hibernate.ejb;version="[3.3.2.GA,3.3.2.GA]"</Import-Library>
                            <
    Import-Bundle>com.springsource.org.apache.log4j;version="[1.2.15,1.2.15]"</Import-Bundle>
                            <
    Import-Bundle>com.springsource.org.junit;version="[4.4.0,4.4.0]"</Import-Bundle>-->
                            <
    Module-Type>Web</Module-Type>
                            <
    Web-ContextPath>testapp</Web-ContextPath>
                            <
    Web-DispatcherServletUrlPatterns>/</Web-DispatcherServletUrlPatterns>
                        </
    instructions>
                    </
    configuration>
                </
    plugin>
            </
    plugins>
            <
    pluginManagement>
                <
    plugins>
                    <
    plugin>
                        <
    groupId>org.apache.maven.plugins</groupId>
                        <
    artifactId>maven-compiler-plugin</artifactId>
                        <
    configuration>
                            <
    source>1.6</source>
                            <
    target>1.6</target>
                        </
    configuration>
                    </
    plugin>
                </
    plugins>

            </
    pluginManagement>
        </
    build>


        <
    dependencies>
            <
    dependency>
                <
    groupId>com.testapp</groupId>
                <
    artifactId>com.testapp.common</artifactId>
                <
    version>${testappVersion}</version>
            </
    dependency>

            <!-- =========================================================== -->
            <!-- 
    Log dep                                                       -->
            <!-- =========================================================== -->
            <
    dependency>
                <
    groupId>org.apache.log4j</groupId>
                <
    artifactId>com.springsource.org.apache.log4j</artifactId>
            </
    dependency>

            <!-- =========================================================== -->
            <!-- 
    DB dep                                                        -->
            <!-- =========================================================== -->
            <
    dependency>
                <
    groupId>org.hibernate</groupId>
                <
    artifactId>org.hibernate.ejb-library</artifactId>
                <
    type>libd</type>
            </
    dependency>

            <
    dependency>
                <
    groupId>org.postgresql</groupId>
                <
    artifactId>com.springsource.org.postgresql.jdbc3</artifactId>
            </
    dependency>

            <!-- =========================================================== -->
            <!-- 
    JUnit                                                        -->
            <!-- =========================================================== -->
            <
    dependency>
                <
    groupId>org.junit</groupId>
                <
    artifactId>com.springsource.org.junit</artifactId>
            </
    dependency>

            <!-- =========================================================== -->
            <!-- 
    spring                                                      -->
            <!-- =========================================================== -->

            <
    dependency>
                <
    groupId>org.springframework</groupId>
                <
    artifactId>org.springframework.spring-library</artifactId>
                <
    type>libd</type>
            </
    dependency>

            <
    dependency>
                <
    groupId>org.jboss.el</groupId>
                <
    artifactId>com.springsource.org.jboss.el</artifactId>
                <
    version>2.0.0.GA</version>
            </
    dependency>

            <!-- =========================================================== -->
            <!-- 
    RichFaces dep                                      -->
            <!-- =========================================================== -->
            <
    dependency>
                <
    groupId>org.richfaces</groupId>
                <
    artifactId>org.richfaces-library</artifactId>
                <
    type>libd</type>
                <
    version>${rfVersion}</version>
            </
    dependency>

            <
    dependency>
                <
    groupId>org.richfaces</groupId>
                <
    artifactId>com.springsource.org.richfaces.impl</artifactId>
                <
    version>${rfVersion}</version>
            </
    dependency>

            <
    dependency>
                <
    groupId>javax.faces</groupId>
                <
    artifactId>com.springsource.javax.faces</artifactId>
                <
    version>1.2.0.08</version>
            </
    dependency>

            <
    dependency>
                <
    groupId>javax.servlet</groupId>
                <
    artifactId>com.springsource.javax.servlet.jsp</artifactId>
                <
    version>2.1.0</version>
            </
    dependency>

            <
    dependency>
                <
    groupId>javax.servlet</groupId>
                <
    artifactId>com.springsource.javax.servlet</artifactId>
                <
    version>2.5.0</version>
            </
    dependency>

            <
    dependency>
                <
    groupId>javax.el</groupId>
                <
    artifactId>com.springsource.javax.el</artifactId>
                <
    version>2.1.0</version>
            </
    dependency>

            <
    dependency>
                <
    groupId>org.apache.commons</groupId>
                <
    artifactId>com.springsource.org.apache.commons.fileupload</artifactId>
                <
    version>1.2.0</version>
            </
    dependency>

            <!-- =========================================================== -->
            <!-- 
    Facelets                                                     -->
            <!-- =========================================================== -->
            <
    dependency>
                <
    groupId>com.sun.facelets</groupId>
                <
    artifactId>com.springsource.com.sun.facelets</artifactId>
                <
    version>1.1.14</version>
            </
    dependency>
        </
    dependencies>
    </
    project
    Thanks a lot!
    Last edited by wolfman22; Oct 9th, 2008 at 06:43 AM.
    cu
    Woifal

  5. #5
    Join Date
    Dec 2009
    Posts
    4

    Default

    Hello,

    I have the same error with the maven-bundle-plugin if my pom contains a dependency on Hibernate. Does someone have a solution?

    Thanks.

  6. #6
    Join Date
    Oct 2008
    Posts
    493

    Default

    You may have more luck getting an answer to your question over on one of the Felix mailing lists. Alternatively, you could use Bundlor to generate your manifests. We (SpringSource) wrote Bundlor so it's much easier for us to offer help.
    Last edited by Andy Wilkinson; Dec 21st, 2009 at 11:25 AM.
    Andy Wilkinson
    SpringSource

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •