开发者

eclipse api's to get current project's repository url

i am working o开发者_开发技巧n developing a eclipse plugin which takes code from repository and builds the code in hudson. for that i need to get the repository url of pom.xml are there any eclipse api's to get repository url of current project.

for example i have got the workspace of current project using this api.

import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;


IWorkspace workspace = ResourcesPlugin.getWorkspace();
    IWorkspaceRoot root = workspace.getRoot();
    IPath location = root.getLocation();


I think you should try to "stand on the shoulders of giants". Eclipse has now integrated m2e from Sonatype (formally m2eclipse), and I found the following in an XML file

M2E provides both a framework for building Maven-centric Eclipse tools and set of tools and user interface elements directly consumable by Eclipse Users. As a framework, M2E provides facilities to import and configure Maven projects in Eclipse workspace as well as APIs that allow m2e extensions to access Maven project metadata and participate in Maven project configuration and workspace build.

So you should look into m2e and check if the API allows what you want to do. I would start with plugin org.eclipse.m2e.core and study how to get access to the maven project ...


I think eclipse may not know the repository url in pom.xml,the eclipse maven plugin can tell you about them,but why not manually analyze the pom.xml as resource file?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜