How to use maven artifact in the development of Eclipse plugin via Tycho - maven

Since version 2.2.0 Tycho has introduced a new feature to allow using maven artifacts in PDE target platforms, and here's the how-to. Following its instructions I have included an artifact of Saxon-HE into my target platform. I can see the wrapped OSGi bundle of Saxon after ticking the Show Location Content option in the Target Definition Editor. Also I ran mvn clean verify command to make sure that the artifact is downloaded into my computer. However,
as I began to try to import the package into my Eclipse plugin code, I found no suggestions from this package.
When I tried to include the package as a feature in the Product Editor, I couldn't find any option.
In addition, when attempting to include it as required plugin / imported packages in the Plugin Editor, there was no option, too.
What's more, the product produced by mvn clean verify did not contain such plugin as Saxon-HE after checking my whole RCP project.
All the efforts in vain above made me wonder how I can use a maven artifact in my plugin development. I desperately need the functionalities Saxon-HE provides with to enhance my plugin. Anyone experienced sharing your expertise?
-- 2021.08.13 update --
Manually I included this plugin in the plugin list of my RCP project via source file editing. Its jar file appeared in the plugin folder of the product. But anyway I was not able to validate the availability of the library in the dependency tab of the plugin manifest editor as shown in Vogella's tutorial. Restarting the IDE did not help, either. This might mean that I have to manually code the source code without the content assistance.

Related

IntelliJ No files were downloaded for xyz

I've created a new project in IntelliJ.
When I go in to:
Project Structure -> Libraries -> Add -> From Maven -> 'com.atlassian.seraph:atlassian-seraph:3.0.3'
I get the error message 'No files were downloaded for com.atlassian.seraph:atlassian-seraph:3.0.3'
Backstory:
I'm using IntelliJ to write a custom SSO authenticator for JIRA. This is not a JIRA plugin, it's just a class that a custom JSP will use.
I intend to produce a JAR and put it in WEB-INF/lib.
I'm not sure what I've missed here. This is my first exposure to maven and I've googled this extensively.
If you did not change the default remote repository of your maven, it should be this . It seems that the artifact (com.atlassian.seraph:atlassian-seraph:3.0.3), you are looking for, is not in the default remote repository. There are two solutions for your case,
1.Add a new remote repository, which has this artifact, to your project.
2.Find the jar file somewhere on internet, add it to your project as an external jar file. Here is a great tutorial about this.
I've changed from idea 14 to idea 15, and downloading maven jar feature started to work)
My Maven setup in ide aimed to external v3.2.1, but may be it would work even with bundled one.

How to add an Add-On to a Vaadin 7.3 app using the new multi-module Maven archetype?

In late 2014, the Vaadin Plugin for NetBeans was updated to create projects using the new multi-module Maven archetype.
How does one add an Add-On such as Vaadin Charts 2?
I tried pasting into the "-ui" sub-module’s Pom file the Maven snippet found on the Add-On Directory page. No go. When running my app, the web page renders a message suggesting the WidgetSet does not contain the add-on.
That "add-on instructions" link leads to this page. Little information is provided. Even worse: None of the info is relevant to the current multi-module Maven archetype for new Vaadin apps.
If there were any documentation telling me exactly what to do in adding an add-on and recompiling my WidgetSet, I'd gladly follow it. I found Using Add-ons in NetBeans, but it is outdated. I opened a ticket asking for a new edition of that page.
mvn clean install
in the root directory of your project should compile widgetset for your project.
Hack
I found one hacky workaround: Put Maven dependency in both the …-ui and …-widgetset sub-module projects’ .pom files.
I'm trying to install Vaadin Charts 2. So on the Directory page for that product, I grab the Maven dependency XML snippet:
<dependency>
<groupId>com.vaadin.addon</groupId>
<artifactId>vaadin-charts</artifactId>
<version>2.0.0</version>
</dependency>
I open two of the .pom files, and paste that dependency into both.
Then I context-click on the …-parent module to choose Clean and then choose Build With Dependencies.
Lastly, run the project and find the add-on now working.
Note this workaround does not involve an command-line incantations with mvn. Works entirely within NetBeans (which calls Maven on our behalf).
This is a tricky kludge in that when an update of your add-on becomes available, you will need to update both dependency declarations. There must be a better way.

Add a Maven dependency to a Eclipse Plugin project

just a simple question: I need to add a Maven dependency to a Eclipse Plugin project.
The project has not a POM file, so I converted it to a Maven one.
Now I have plugin.xml file and pom.xml file. POM contains the dependency I need to satisfy, but it's ignored; I mean, I can't resolve an import in source code referring to that import.
Can you help me?
ty
I read about Tycho plugin, but online configurations don't work.
If I'm reading this correctly, you've just started by adding a Maven dependency to your project, but don't have the dependency available for Eclipse to validate your code against.
You will need to start a Maven build after you add a brand new dependency so that Maven can add that to your local cached repository. Once the Maven build is done, Eclipse should recognize your imports properly.
You may want to check whether the dependency you are looking for is available in the Eclipse Orbit.
The Orbit project is basically a repository of libraries to make them available for Eclipse Plug-in Development. What is especially nice in the Orbit libraries is that they also provide the sources. Thus, it is possible to view the implementation and get proper JavaDoc and so on.
Example
One can find the com.google.gson library using the update site
https://download.eclipse.org/tools/orbit/downloads/drops/R20190602212107/repository
Thereby, the part R20190602212107 refers to the Orbit build name that you find on the downloads page of the project.

Creating an Eclipse RCP application and plugin repository from the same sources

I'm trying to create an Eclipse (3.x) RCP application from plugins in such a way as to allow me to provide ordinary plugins for existing Eclipse installations, but also create an RCP application from those plugins.
My experimentation has led me to have the following layout:
com.company.testapp.plugin
com.company.testapp.feature
com.company.testapp.updatesite
Where each ID depends on the previous one. This works correctly and I can build an update site from the plugin via the feature. What I would now like to do is add something like
com.company.testapp.rcp
Containing just the required machinery to provide an RCP 'wrapper' around the feature. com.company.testapp.rcp contains a product definition, testapp.product.
However, I can't seem to make this link work; I'm getting "Product com.company.testapp.rcp.product could not be found" on trying to launch from the product configuration.
(Ultimately, I'd like to be able to drive the creation of both the update site and RCP application from Maven/Tycho—I have another com.company.testapp.master containing the master POM which I can again successfully build the update site from.)
I've found plenty of resources on building plugins with Tycho, and plenty on building RCP applications, but nothing on building both from the same source tree. I'm not an Eclipse or Tycho expert by any means, so it's possible I'm just not aware of what I should be searching for.
Is such a thing even possible?
Instead of com.company.testapp.updatesite (and com.company.testapp.rcp) create a new module: com.company.testapp.repository that defines a product and p2 repository (a replacement for old update-site mechanism). The module should have the following files:
category.xml where you define features in p2 repository and their categories (in your case com.company.testapp.feature)
*.product - a product definition file
pom.xml file that defines eclipse-repository module; detailed configuration is explained at Tycho Packaging Types - eclipse-repository

STS M2E 'Plugin execution not covered by lifecycle configuration" Error - Flex-Mojos

I am trying to write my pom.xml for a multimodal flex application. I have been using this resource as an example:
http://www.sonatype.com/books/mvnref-book/reference/flex-dev-sect-creating-with-archetype.html
I am using M2E v1.01 but I am faced with a number of 'Plugin execution not covered by lifecycle configuration" errors. As far as I can see - there are no m2E connectors available to resolve this and I have tried all the Maven advice I can find - to include:
Clean
Update dependencies
Update project configuration
The problem only occurs if the project is declared as swc or swf package. My next move to ask Eclipse to 'permanently mark goal as ignored' - which seems a little brash.
Any advice would be appreciated.
Thanks in advance.
With STS 2.8.0, we have upgraded m2eclipse to be version 1.0. However, this can cause a bit of trouble with existing projects. I wrote a blog on this a couple of months ago.
http://blog.springsource.org/2011/10/18/upgrading-maven-integration-for-springsource-tool-suite-2-8-0/
Essentially, the new architecture for m2eclipse requires that each maven plugin you use must be mapped to one Eclipse plugin to handle the plugin's execution inside of Eclipse. This obviously causes problems since not every maven plugin author has the knowledge or time to create also create and maintain an Eclipse plugin.
By marking the plugin as ignored, you are saying that the plugin should never be executed inside of Eclipse (implying that whenever you need it to be executed, you will do so from the command line). Once marked as ignored, you can then change it to execute, which means that it should always be executed whenever the associated lifecycle is performed in Eclipse. This may cause performance problems, and so only do it if you know the risks.
If all this is too much for you, then STS provides a downgrade option to revert to an older version of m2eclipse. Go to the Dashboard extensions page. Unfortunately, you will have to manually revert all changes to your .project and .classpath files (we provide an auto-upgrade mechanism, but not a downgrade mechanism...presumably everything is in version control).
Any questions or problems should be sent to the STS forums:
http://forum.springsource.org/forumdisplay.php?32-SpringSource-Tool-Suite
You can check this alpha connector "Flex Maven Integration for Flash Builder" on the eclipse marketplace: http://marketplace.eclipse.org/node/648556.

Resources