开发者

How do I add external dependencies to an Eclipse Plugin Product definition?

I'm attempting to define an eclipse plugin product that includes bundles from Spring's Enterprise Bundle Repository and 开发者_如何学GoEclipse's Zodiac repository. I've used Maven to download these repositories, but I can't figure out how to make the product editor aware of them.

Ideally, I'd like to make the product editor aware of a list of maven managed dependencies and allow me to add them to its dependency list. Failing that, is there an easy way to simply import the Jar's? Or am I stuck creating a dummy project and importing the contents of each Jar as an archive?


Window->Preferences->Plug-in Development->Target Platform

either add a new one matching your needs or edit your current.

Locations Tab -> add select folder and browse to your jars


After a night's sleep, this is the answer I came up with:

I'd created an empty eclipse project and placed my *.product file in there. To that project, I added a *.target file (New > Plugin Development > Target Definition). On the definition tab of the target editor, I added my custom folder.

All of my dependency Jars are copied to that folder using the Maven Dependency Plugin:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-dependency-plugin</artifactId>
    <version>2.1</version>
    <executions>
        <execution>
        <id>copy-dependencies</id>
        <phase>process-sources</phase>
        <goals>
            <goal>copy-dependencies</goal>
        </goals>
        <configuration>
            <outputDirectory>${basedir}</outputDirectory>
            <overWriteReleases>false</overWriteReleases>
            <overWriteSnapshots>false</overWriteSnapshots>
            <overWriteIfNewer>true</overWriteIfNewer>
        </configuration>
        </execution>
    </executions>
</plugin>

Once this is all done, I clicked the "Set as Target Platform" link in the top-right corner of the target editor. Now all of my Maven downloaded Jars are visible in the product editor. Note that if you change your maven dependencies, you'll likely need to refresh the project.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜