开发者

Get a Hudson build with Maven

I have moved to Maven recently, and since it works fine for resources up to date in some repositories, it's not obvious for non-maven ones.

I have something very simple to achieve (in the idea), but that I am unable to express so far: I need to compile my code with a jar that can be found here: https://hudson.eclipse.org/hudson/view/WTP/job/cbi-wtp-wst.xsl.psychopath/ws/sourceediting/plugins/org.eclipse.wst.xml.xpath2.processor/target/

What do I have to put in my pom.xml to make Maven downloading the .jar + the java source + the javadoc, and eventually the other dependencies (actually IBM ICU, Xerces, JavaCup) that are mentionned in the supplied MANIFEST ?

I have read lots of documents, including those with a plugin called Tycho开发者_运维百科, but nothing helpfull for that simple task.

Thanks for your help.


Maven only works well if all artifacts needed for a build are contained in the local or a configured remote repository. So you have to do the following jobs:

  • Find out if eclipse plugins are deployed in a Maven2-style repository, and what the URL of that repository is.
  • Then find out which version of that plugin (artifact) you need.
  • Maven allows you to configure what will be copied locally: jar file, sources and api doc if you want to.
  • Maven should then be responsible to download as well all needed artifacts for the plugin you want to use.

After looking at the contents of the URL you gave us (especially the file p2content.xml), it looks like there should be a repository. I searched for the maven repository for org.eclipse.wst.xml.xpath2 and found the URL http://maven.eclipse.org/nexus/content/repositories/testing/org/eclipse/wst/org.eclipse.wst.xml.xpath2/1.1.0/org.eclipse.wst.xml.xpath2-1.1.0.pom

So the repository you are searching for is located at http://maven.eclipse.org/nexus. Just open it, search for example for xpath2, and Nexus, the repository software used there will you show the available artifacts. Depending on what was deployed to that repository, it may contain only the library, or have even sources and JavaDoc bundled with it. For the example above (xpath2), there seems to be only the POM itself and the library (the jar). If you take as example junit, you will find all versions and variants, even with sources.jar and javadoc.jar.

After you have found the needed artifact, you can include it in the dependency section of your POM. And you have to add http://maven.eclipse.org/nexus as a remote repository in the configuration of your Maven installation.

The question and its answer Get source JARs from Maven repository explain how to fetch sources and JavaDoc (if they are available).


You need a maven repository which contains this artifacts (i don't know, if Eclipse hosts a repository for their projects). You can also deploy manually the artifacts to a local repository on your computer.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜