2009/8/8 Serge Emmanuel Pagop <serge.pa...@googlemail.com>

> Is there someone in the ops4j mailinglist wo uses PAX-Construct in a Maven
> Multiple Module Projects with Eclipse IDE ?


Yes, I and several others use it this way (note: I've been away for a few
weeks and only recently saw your emails)

The symptoms you describe are not a bug, it's just how the
maven-eclipse-plugin (which we extend) works in PDE mode.
Any dependencies to other OSGi bundles in the same maven reactor (ie. the
same build) are not added to the .classpath
because it is expected that the Eclipse/PDE classpath container will resolve
the inter-bundle dependency.

This is why you get a different classpath if you cd to the second bundle -
because the first bundle is no longer in the same
reactor build, and so an explicit dependency is added to the .classpath. The
reasoning behind this is that bundles built in
the same reactor are likely to be loaded together into Eclipse.

So if you want to start from a clean slate it is recommended you do an "mvn
clean install pax:eclipse" from the top of your
multi-module project (note: if you uncomment the IDE execution section in
the generated top pom.xml then you can just do
"mvn clean install" as it will then automatically do the "pax:eclipse" goal
during the install phase).

Finally do "import existing projects" in Eclipse/PDE, point it to the top
directory, and import all the bundle projects.

FYI, you can also use this setting to forcibly add inter-project
dependencies to .classpath even if they're OSGi bundles:

      <plugin>
        <groupId>org.ops4j</groupId>
        <artifactId>maven-pax-plugin</artifactId>
        <version>1.4</version>
        <configuration>
          <fixDependencies>true</fixDependencies>
        </configuration>
      </plugin>

which I think I already mentioned in reply to an earlier post you made back
in mid-June?

HTH


> read the send email below for more about my problem.
>
> On Fri, Aug 7, 2009 at 3:03 AM, Serge Emmanuel Pagop <
> serge.pa...@googlemail.com> wrote:
>
>> Hi altogether,
>>
>> may somebody already got this problem:
>> I created a maven multi-project modules  with Pax-Construct version 1.4,
>> that means I started my project with the Quickstart from the ops4j site
>> http://www.ops4j.org/projects/pax/construct/index.html and then created
>> more module.
>>
>> Here look my project tree.
>>
>> *Parent-Project*
>>   - pom.xml
>>   + provisions
>>   + poms
>>   + child-project1 (*Bundle 1*)
>>   + child-project2 (*Bundle 2*)
>>
>> Probleme:
>>
>> - First, the Bundle 2 (Impl.) needs Bundle 1 (API), when I run the maven
>> command "mvn install pax:clean pax:eclipse" from the parent project
>> "Parent-Project" to generate ".project" and ".classpath", the Bundle 1
>> (artifact child-project1) is not present into the file ".classpath"
>> (strange).
>> So looked my .classpath content
>>
>> <classpath>
>>   <classpathentry kind="src" path="."
>> including="plugin.xml|plugin.properties|icons/**" excluding="**/*.java"/>
>>   <classpathentry kind="src" path="src/main/java"/>
>>   <classpathentry kind="src" path="src/main/resources"
>> excluding="**/*.java"/>
>>   <classpathentry kind="output" path="target/classes"/>
>>   <classpathentry kind="con"
>> path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
>>   <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
>>   <classpathentry kind="var"
>> path="M2_REPO/org/osgi/osgi_R4_compendium/1.0/osgi_R4_compendium-1.0.jar"/>
>>   <classpathentry kind="var"
>> path="M2_REPO/org/osgi/osgi_R4_core/1.0/osgi_R4_core-1.0.jar"/>
>> </classpath>
>>
>> - Second, If I change to the child-project2 (Bundle 2) and from there run
>> the maven command "mvn pax:clean pax:eclipse", the .classpath for my project
>> was generated correctly and so looked that:
>>  see line 10 for this below XML file
>>
>> <classpath>
>>   <classpathentry kind="src" path="."
>> including="plugin.xml|plugin.properties|icons/**" excluding="**/*.java"/>
>>   <classpathentry kind="src" path="src/main/java"/>
>>   <classpathentry kind="src" path="src/main/resources"
>> excluding="**/*.java"/>
>>   <classpathentry kind="output" path="target/classes"/>
>>   <classpathentry kind="con"
>> path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
>>   <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
>>   <classpathentry kind="var"
>> path="M2_REPO/org/osgi/osgi_R4_compendium/1.0/osgi_R4_compendium-1.0.jar"/>
>>   <classpathentry kind="var"
>> path="M2_REPO/org/osgi/osgi_R4_core/1.0/osgi_R4_core-1.0.jar"/>
>>   <classpathentry kind="var"
>> path="M2_REPO/Parent-Project/child-project/1.0-SNAPSHOT/child-project-1.0-SNAPSHOT.jar"/>
>> </classpath>
>>
>> It's that a BUG in PAX-Construct, if not, is there already in forum a
>> solution for so a problem.
>>
>> Thanking in advance and I appreciate any tricks and help,
>>
>> Serge.
>>
>
>
>
> --
> ----------------------------------
> Serge Emmanuel Pagop
> Java EE Senior Consultant
> E-Mail: serge.pagop.pa...@innoq.com, serge.pa...@glooglemail.com
> Skype-Name: sisepago
> mobil : +49-1784049592
>
> _______________________________________________
> general mailing list
> general@lists.ops4j.org
> http://lists.ops4j.org/mailman/listinfo/general
>
>


-- 
Cheers, Stuart
_______________________________________________
general mailing list
general@lists.ops4j.org
http://lists.ops4j.org/mailman/listinfo/general

Reply via email to