Stuart McCulloch wrote:
...

you might want to try my modified maven eclipse goal which comes
with Pax-Construct - just add the following repository to the example:

  <pluginRepositories>
    <pluginRepository>
      <id>ops4j-repository</id>
      <url>http://repository.ops4j.org/maven2</url>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </pluginRepository>
  </pluginRepositories>

and run the following command instead of eclipse:eclipse:

   mvn clean install org.ops4j:maven-pax-plugin:0.6.4:eclipse

(with a Pax-Construct project you can just use pax:eclipse)

this modified eclipse goal also adds maven dependencies as
required libraries, which means PDE sees the same compile
classpath as Maven and so avoids the unnecessary import

I tried this and found it added some of the maven dependencies and not
others (in particular, it missed the ones belonging to my project).  I
traced this to my using <scope>compile</scope>.  When I changed these to
<scope>provided</scope> the pax:eclipse added them to the referenced
library list, and Eclipse could compile the plugin.


correct - the logic at the moment is to add "test" and "provided"
dependencies as "Required Libraries" just in case Eclipse/PDE
doesn't add them as "Plug-in Dependencies".

this often happens with test dependencies, because the bundle
manifest doesn't usually contain the test imports, which means
that without this logic tests would fail to compile in Eclipse.

the reason I don't add "compile" or "runtime" dependencies is
because we typically use those when embedding code inside
bundles, in which case the pax plugin extracts the embedded
jars/folders to a local directory and adds them to the classpath.

however, I guess there's no harm in also adding the original
dependencies to the Eclipse classpath - I'll look into this for
the next release, if you think it would be useful.

Just an interesting note: pax:eclipse needs the scope to be "provided|test" in order to add the dependency to the classpath.

eclipse:eclipse needs the scope to be "compile" in order to add the dependency to the classpath.

-Marshall

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

Reply via email to