I am trying to configure Maven to build an Eclipse application (Eclipse plugin packaged with all of the Eclipse EXEs etc).
I have already Mavenised dozens of dependencies of the project and deployed them to our internal Nexus (OSS) server. I have also installed the Nexus P2 Repository Plugin and the P2 Bridge Plugin (2.6.3-01) and the Nexus Unzip Plugin (0.12.0). I can browse to the .meta/p2 folder of our group repository, but it is currently empty.
This should be a lot simpler than it currently appears to be. I'm targeting Eclipse 3.4.2 (Ganymede) on Windows. If it makes any difference, we actually deploy our application packaged as a stripped-down/customised Eclipse installation.
When I run maven against a pom with <packaging>eclipse-repository</packaging>
I get the following error:
[ERROR] Missing requirement: MyApp 0.0.0 requires
'org.eclipse.equinox.executable.feature.group 0.0.0'
but it could not be found
...where do I get that from, and how do I add it to Nexus?
When I run maven against a pom with <packaging>eclipse-plugin</packaging>
I get the following error:
[ERROR] Missing requirement: MyApp 0.0.0 requires
'bundle org.eclipse.ui 0.0.0'
but it could not be found
...but I found the following directories on my local file system (suspect itp-04-rcp generated the first one):
D:\maven\repository\p2\osgi\bundle\org.eclipse.ui\3.6.2.M20110203-1100
D:\maven\repository\p2\osgi\bundle\org.eclipse.ui\3.7.0.v20110928-1505
I've also tried the pom-first-dependencies and manifest-first-dependency combo: http://wiki.eclipse.org/Tycho/How_Tos/Dependency_on_pom-first_artifacts
I don't understand how this works - I can build itp02 from Git. I can see that it builds two bundles:
+---------------------+---------------------+--------------------------------------+ | artifactId | Bundle-Name | Bundle-SymbolicName | +---------------------+---------------------+--------------------------------------+ | pomfirst-bundle | pomfirst-bundle | tycho.demo.itp02.pomfirst-bundle | | pomfirst-thirdparty | pomfirst-thirdparty | tycho.demo.itp02.pomfirst-thirdparty | +---------------------+---------------------+--------------------------------------+
...but how does build02 pick these up? The only bit that seems relevant is:
Import-Package: tycho.demo.itp02.pomfirst
...that doesn't have anything to do with either of the Bundle-Names.
I tried the Felix maven-bundle-plugin. I include all of my regular maven dependencies in a pom with <packaging>bundle</packaging>
.
mvn deploy
creates something at /nexus/content/repositories/snapshots/.meta/p2/plugins. I can download the jar via a browser, but all of the dependency jars are named "artifact-vresion" rather than "artifact_version" - is that right?
mvn bundle:bundleall
creates an OSGI bundle for each of the transitive dependencies, but I'm not sure what to do with them from here.
mvn bundle:deploy
refuses to do anything unless I specify -DremoteOBR
and probably a few other parameters which I don't really understand.
The Maven Eclipse Plugin is used to generate Eclipse IDE files (*. classpath, *. project, *. wtpmodules and the . settings folder) for use with a project.
Building and Running the Maven Project in Eclipse To run the maven project, select it and go to “Run As > Java Application”. In the next window, select the main class to execute. In this case, select the App class and click on the Ok button. You will see the “Hello World” output in the Console window.
By "use install a Maven plugin and use it" I am sure you are looking for a Eclipse plugin that will perform Maven functions within the IDE. If so, M2E is a good choice. You will find a lot of help within the Eclipse installation once you install M2E.
You can see that Eclipse has added Maven dependencies to java build path. Now, it is time to build this project using maven capability of eclipse. Right Click on consumerBanking project to open context menu. Select Run as option. Then maven package option. Maven will start building the project.
You must add them as OSGi dependencies in the manifest. The dependencies are injected into the in-memory representation of the POM during the build. From now on you simply develop and test your Eclipse plugin in PDE as per usual. When building the plugin using Maven 2, the normal build lifecycle comes into effect.
In the case of Maven 2, plugins are responsible for things like compilation, testing, code instrumentation (e.g. for code coverage), reporting and packaging.
You can update maven dependencies with IDE. You can Launch Maven builds from within Eclipse. It does the dependency management for Eclipse build path based on Maven's pom.xml. It resolves Maven dependencies from the Eclipse workspace without installing to local Maven repository (requires dependency project be in same workspace).
The 'org.eclipse.equinox.executable.feature.groug' seems to be necessary if you build an eclipse product which includes the native launchers ("include laucher" property set to true in product configuration). Try to add the feature to your platform definition (e.g. copy from eclipse p2 repo or your running eclipse IDE).
See also https://bugs.eclipse.org/bugs/show_bug.cgi?id=407272
Regards, Paolo
To solve the Problem concerning the missing dependencies:
[ERROR] Missing requirement: MyApp 0.0.0 requires
'bundle org.eclipse.ui 0.0.0'
but it could not be found
seems that your Feature/Plugin MyApp requires to download the org.eclipse.ui Plug-in before it can be installed.
You should check your settings from your configuration-pom like this:
<properties>
<tycho.version>0.25.0</tycho.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<repository.url>http://download.eclipse.org/releases/neon</repository.url>
</properties>
<repositories>
<repository>
<id>NeonRepository</id>
<url>${repository.url}</url>
<layout>p2</layout>
</repository>
if you have set up your self-hosted p2 repository, make sure that the page is correctly build. You can check this if you select(in eclipse) Help -> Install New Software. Eclipse should show the provided parts. If nothing is shown, even if you have deselected every checkbox, you should check your p2-repository. It should contain the "features" and "plugins" container as well as the artifacts.jar and content.jar. If you have only the two folders, you should run
eclipse -application org.eclipse.equinox.p2.publisher.UpdateSitePublisher
-metadataRepository file:/<some location>/repository
-artifactRepository file:/<some location>/repository
-source /<location with a site.xml>
-configs gtk.linux.x86
-compress
-publishArtifacts
in a CLI/Shell. For more Information check the eclipse documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With