On 11/09/2008, Brad Cox, Ph.D. <[EMAIL PROTECTED]> wrote:
>  Here's one of the key poms.

I noticed something else in this pom that would cause issues
with Eclipse/PDE - the dependencies are embedded inside a
"target/dependency" directory inside the bundle.

when the bundle is unpacked (<unpackBundle> is enabled)
under target/classes, this directory will actually end up as:

   <project>/target/classes/target/dependency

however, Eclipse/PDE expects to see them in this location

   <project>/target/dependency

ie. relative to the project - also, because Eclipse can clean
the classes directory itself (when doing a rebuild) you might
find these dependencies go missing - which would explain
why you have issues building in Eclipse but not in Maven

FWIW I have a modified version of the maven-eclipse-plugin
that properly handles embedded dependencies by munging
the classpath in the Eclipse/PDE manifest - so the jars will
be found, and won't be accidentally removed by Eclipse

just try using:

   mvn org.ops4j:maven-pax-plugin:eclipse

it will create .project, .classpath and MANIFEST.MF files

this plugin is part of the Pax-Construct tools that attempt
to remove some of the pain in creating OSGi projects that
work in both Maven and Eclipse

another approach is to use the maven-dependency-plugin
to copy dependencies to the correct path expected by the
PDE tooling...

HTH

>  <?xml version="1.0" encoding="UTF-8"?>
>  <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>soakit</groupId>
>   <artifactId>soakit.core</artifactId>
>   <version>1.0-SNAPSHOT</version>
>   <name>soakit.core</name>
>   <description>SoaKit Core Abstraction Layer. Defines interfaces and
> abstract classes for the components defined in sub-modules. Provides a
> factory class for defining soakit composites with an XML configuration
> file.</description>
>   <packaging>bundle</packaging>
>
>   <parent>
>     <groupId>soakit</groupId>
>     <artifactId>soakit</artifactId>
>     <version>1.0-SNAPSHOT</version>
>   </parent>
>
>   <dependencies>
>     <dependency>
>       <groupId>commons-collections</groupId>
>       <artifactId>commons-collections</artifactId>
>       <version>3.2</version>
>     </dependency>
>         <dependency>
>             <groupId>jdom</groupId>
>             <artifactId>jdom</artifactId>
>             <version>1.0</version>
>         </dependency>
>         <dependency>
>             <groupId>javax.xml.parsers</groupId>
>             <artifactId>jaxp-api</artifactId>
>             <version>1.4</version>
>         </dependency>
>         <dependency>
>             <groupId>javax.xml.ws</groupId>
>             <artifactId>jaxws-api</artifactId>
>             <version>2.1-1</version>
>         </dependency>
>         <dependency>
>             <groupId>xerces</groupId>
>             <artifactId>xercesImpl</artifactId>
>             <version>2.8.1</version>
>         </dependency>
>      <dependency>
>             <groupId>org.eclipse</groupId>
>             <artifactId>osgi</artifactId>
>             <version>3.4.0.v20080605-1900</version>
>     </dependency>
>     <dependency>
>             <groupId>jaxen</groupId>
>           <artifactId>jaxen</artifactId>
>           <version>1.1-beta-9</version>
>     </dependency>
>   </dependencies>
>
>   <build>
>     <resources>
>       <resource>
>         <directory>src/main/resources</directory>
>       </resource>
>       <resource>
>         <directory>.</directory>
>         <includes>
>           <include>plugin.xml</include>
>         </includes>
>       </resource>
>     </resources>
>
>     <plugins>
>             <plugin>
>         <artifactId>maven-eclipse-plugin</artifactId>
>         <configuration>
>           <pde>true</pde>
>         </configuration>
>       </plugin>
>       <plugin>
>         <groupId>org.apache.felix</groupId>
>         <artifactId>maven-bundle-plugin</artifactId>
>         <version>1.4.3</version>
>         <extensions>true</extensions>
>         <configuration>
>                     <unpackBundle>true</unpackBundle>
>           <manifestLocation>META-INF</manifestLocation>
>           <instructions>
>             <Bundle-Version>${pom.version}</Bundle-Version>
>             <Bundle-Name>${artifactId}</Bundle-Name>
>
>  <Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
>                         <Bundle-Description>Soakit Core
> Bundle</Bundle-Description>
>
> <Bundle-Activator>com.gestalt.soakit.core.CoreActivator</Bundle-Activator>
>
> <Embed-Dependency>*;scope=compile|runtime;inline=true</Embed-Dependency>
>
>  <Embed-Transitive>true</Embed-Transitive>
>
>  <Embed-Directory>target/dependency</Embed-Directory>
>                         <_failok/>
>
> <Bundle-RequiredExecutionEnvironment>J2SE-1.5</Bundle-RequiredExecutionEnvironment>
>             <Import-Package>
>                 .,
>                             *;-split-package:=merge-first,
>
> org.apache.commons.collections.*;-split-package:=merge-first;version="3.2"
>
> org.apache.commons.collections.iterators.*;-split-package:=merge-first;version="3.2",
>
>  org.jdom;-split-package:=merge-first;version="1.0",
>
>  org.jdom.*;-split-package:=merge-first;version="1.0",
>
> org.jdom.input.*;-split-package:=merge-first;version="1.0",
>
> org.jdom.output.*;-split-package:=merge-first;version="1.0",
>
>  org.apache.xerces.parsers;-split-package:=merge-first,
>                             <!--
>
>  javax.*;-split-package:=merge-first,
>
>  javax.jws.*;-split-package:=merge-first,
>
>  javax.xml.bind.*;-split-package:=merge-first,
>
>  javax.annotation.*;-split-package:=merge-first,
>
>  javax.xml.soap.*;-split-package:=merge-first,
>
>  javax.xml.stream.*;-split-package:=merge-first,
>
>  javax.activation.*;-split-package:=merge-first,
>                             -->
>                         </Import-Package>
>             <Export-Package>
>                 .,
>                             *;-split-package:=merge-first,
>
> org.apache.commons.collections.*;-split-package:=merge-first;version="3.2",
>
> org.apache.commons.collections.iterators.*;-split-package:=merge-first;version="3.2",
>
>  org.jdom;-split-package:=merge-first;version="1.0",
>
>  org.jdom.*;-split-package:=merge-first;version="1.0",
>
> org.jdom.input.*;-split-package:=merge-first;version="1.0",
>
> org.jdom.output.*;-split-package:=merge-first;version="1.0",
>
>  org.apache.xerces.parsers.*;-split-package:=merge-first,
>
>  com.gestalt.soakit.core.*;-split-package;=merge-first,
>                             <!--
>
>  javax.*;-split-package:=merge-first,
>
>  javax.jws.*;-split-package:=merge-first,
>
>  javax.xml.bind;-split-package:=merge-first,
>
>  javax.annotation;-split-package:=merge-first,
>
>  javax.xml.soap;-split-package:=merge-first,
>
>  javax.xml.stream;-split-package:=merge-first,
>
>  javax.activation;-split-package:=merge-first,
>                             -->
>                         </Export-Package>
>           </instructions>
>         </configuration>
>       </plugin>
>             <!--
>         <plugin>
>                 <groupId>org.apache.maven.plugins</groupId>
>
>  <artifactId>maven-eclipse-plugin</artifactId>
>                 <configuration>
>
> <projectNameTemplate>[artifactId]-[version]</projectNameTemplate>
>                     <wtpmanifest>true</wtpmanifest>
>
>  <wtpapplicationxml>true</wtpapplicationxml>
>                     <wtpversion>2.0</wtpversion>
>
> <manifest>${basedir}/src/main/resources/META-INF/MANIFEST.MF</manifest>
>                 </configuration>
>       </plugin>
>             -->
>     </plugins>
>     <extensions>
>     </extensions>
>   </build>
>  </project>

-- 
Cheers, Stuart

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to