Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Maven Tools 4 Eclipse"
(How do I import the result in a Nexus server?) |
|||
Line 6: | Line 6: | ||
== How it works == | == How it works == | ||
+ | |||
+ | Replace RUN below with <tt>java -jar org.eclipse.dash.mt4e-0.9.0-SNAPSHOT-jar-with-dependencies.jar</tt> | ||
A simple workflow: | A simple workflow: | ||
− | # Download an Eclipse release from http://www.eclipse.org/downloads/ | + | # Create a folder to work. Download the tool and put it into this folder. '''TODO''' I've asked to upload the tool on an Eclipse site; I'll post the link here. For the time being, you can build the tool from sources (see below). |
− | + | # Download an Eclipse release from http://www.eclipse.org/downloads/ into a new folder <tt>downloads</tt> inside the work folder. | |
# Download the sources for the Eclipse release and/or other archives which contain Eclipse products or OSGi bundles. | # Download the sources for the Eclipse release and/or other archives which contain Eclipse products or OSGi bundles. | ||
− | # Import | + | # Import everything into a temporary Maven repo <tt>tmp/m2repo</tt> using <tt>RUN convert org.eclipse.dash:dependency-management:3.7.0</tt> (you may want to tweak the version number) |
− | + | # Check the report generated for any problems you may want to fix. Create a patch file (probably using [http://git.eclipse.org/c/dash/org.eclipse.dash.m4e.tools.git/tree/patches the examples]) to do that | |
− | # | + | # Repeat until you're happy with the results |
+ | # Upload the content of <tt>tmp/m2repo/</tt> somewhere where Maven can find it (<tt>~/.m2/repository/</tt> or your Maven proxy). | ||
− | + | <tt>convert</tt> is actually a wrapper for these commands: | |
− | # Fix any know problems by applying the patches in the <tt>patches/</tt> folder using the tool <tt> | + | # Importing every archive in the folder <tt>downloads</tt> into a temporary Maven repo using <tt>RUN import</tt> <i>archive</i> |
− | # Check the result with <tt> | + | # Merge all repositories using <tt>RUN merge </tt><i>directories...</i><tt> tmp/m2repo</tt> |
− | # Create a POM with the version info to make sure your build picks the correct versions using the <tt> | + | # The sources are in the wrong place. Fix that with <tt>RUN attach-sources tmp/m2repo</tt> |
− | # If anything goes wrong, use <tt> | + | # Fix any know problems by applying the patches in the <tt>patches/</tt> folder using the tool <tt>RUN apply-patches tmp/m2repo </tt><i>patches...</i> |
+ | # Check the result with <tt>RUN analyze tmp/m2repo</tt> | ||
+ | # Create a POM with the version info to make sure your build picks the correct versions using the <tt>RUN dm tmp/m2repo </tt><i>groupId:artifactId:version</i> | ||
+ | # If anything goes wrong, use <tt>RUN clean</tt> to clean up temporary files and start over. | ||
− | == | + | == Building From Source == |
− | + | ||
− | + | ||
− | + | ||
# <tt>git clone git://git.eclipse.org/gitroot/dash/org.eclipse.dash.m4e.tools.git</tt> | # <tt>git clone git://git.eclipse.org/gitroot/dash/org.eclipse.dash.m4e.tools.git</tt> | ||
+ | # <tt>org.eclipse.dash.m4e.tools</tt> will be our work directory | ||
# Download everything you will want and put it into the folder <tt>org.eclipse.dash.m4e.tools/downloads/</tt> | # Download everything you will want and put it into the folder <tt>org.eclipse.dash.m4e.tools/downloads/</tt> | ||
− | # | + | # Compile the code with [http://maven.apache.org/ Maven]: <tt>mvn install</tt> |
− | + | # See above how to use the tool | |
− | + | ||
− | + | ||
== How do I import the result in a Nexus server? == | == How do I import the result in a Nexus server? == | ||
Line 63: | Line 65: | ||
It needs [http://www.python.org/download/ Python 2.7] and [http://lxml.de/ lxml]. | It needs [http://www.python.org/download/ Python 2.7] and [http://lxml.de/ lxml]. | ||
− | |||
[[Category:Dash Project]] | [[Category:Dash Project]] |
Revision as of 10:24, 24 August 2011
Maven Tools 4 Eclipse (or m4e for short) is a set of tools to convert OSGi bundles into Maven artifacts.
You can find the source on http://git.eclipse.org/c/dash/org.eclipse.dash.m4e.tools.git/
This tool is used to create the Maven artifacts which you can find on Eclipse's Nexus server at http://maven.eclipse.org/nexus/index.html
Contents
How it works
Replace RUN below with java -jar org.eclipse.dash.mt4e-0.9.0-SNAPSHOT-jar-with-dependencies.jar
A simple workflow:
- Create a folder to work. Download the tool and put it into this folder. TODO I've asked to upload the tool on an Eclipse site; I'll post the link here. For the time being, you can build the tool from sources (see below).
- Download an Eclipse release from http://www.eclipse.org/downloads/ into a new folder downloads inside the work folder.
- Download the sources for the Eclipse release and/or other archives which contain Eclipse products or OSGi bundles.
- Import everything into a temporary Maven repo tmp/m2repo using RUN convert org.eclipse.dash:dependency-management:3.7.0 (you may want to tweak the version number)
- Check the report generated for any problems you may want to fix. Create a patch file (probably using the examples) to do that
- Repeat until you're happy with the results
- Upload the content of tmp/m2repo/ somewhere where Maven can find it (~/.m2/repository/ or your Maven proxy).
convert is actually a wrapper for these commands:
- Importing every archive in the folder downloads into a temporary Maven repo using RUN import archive
- Merge all repositories using RUN merge directories... tmp/m2repo
- The sources are in the wrong place. Fix that with RUN attach-sources tmp/m2repo
- Fix any know problems by applying the patches in the patches/ folder using the tool RUN apply-patches tmp/m2repo patches...
- Check the result with RUN analyze tmp/m2repo
- Create a POM with the version info to make sure your build picks the correct versions using the RUN dm tmp/m2repo groupId:artifactId:version
- If anything goes wrong, use RUN clean to clean up temporary files and start over.
Building From Source
- git clone git://git.eclipse.org/gitroot/dash/org.eclipse.dash.m4e.tools.git
- org.eclipse.dash.m4e.tools will be our work directory
- Download everything you will want and put it into the folder org.eclipse.dash.m4e.tools/downloads/
- Compile the code with Maven: mvn install
- See above how to use the tool
How do I import the result in a Nexus server?
It's very tedious to deploy the files one by one. Here is a recipe to mass-upload them:
- Create a "Hosted Repository" on Nexus
- Copy the files from tmp/m2repo/ into sonatype-work/nexus/storage/<name>/ where <name> is the name of the new repository.
- Open the Nexus UI in your web browser
- Login as admin
- Open the "Repositories" tab
- Right click on the hosted repository
- Select "Rebuild Metadata"
After that, Maven should be happy.
Support
Please file an issue for Project Dash, Component Maven.
Biggest Issues Right Now
- The name m4e sucks. Suggestions?
- Find the time to create a repo with Eclipse 3.7
Old Python Version
You can find the original Python project on Github: https://github.com/digulla/org.eclipse.dash.m4e.tools/
It needs Python 2.7 and lxml.