How to analize/visualize OSGi, maven dependencies - maven

I am trying to build Aptana studio using Maven/Tycho.
It has a lot of Eclipse plugins and I would like to exclude some of them from the build. However the excluded plugins may be required by other plugins.
How to see what plugins are dependent on the current plugin? Is the some tools to visualize dependencies in a directed graph?

The Plugin Dependencies View which comes with PDE has a button (two-to-one graph) to show plugins depending on the focused plugin.
If you want to see the full picture, then you will need to install the PDE Incubator Dependency Visualization (update site link included). Note this often gets quickly unreadable.
UPDATE by Paul
Update site http://download.eclipse.org/eclipse/pde/incubator/visualization/site
Need to uncheck "Group items by category" for item to appear.
It is version 0.5.0.20090415
So it is almost 5 years old and is unlikely to ever graduate from incubator.
Added Marketplace entry: https://marketplace.eclipse.org/content/pde-incubator-dependency-visualization

Related

NetBeans doesn't recognize that dependency is a local project - how to fix?

I have two pairs of projects that I develop in NetBeans, both of which have a GUI project, and a library project, where the GUI project depends on the library one. In one of them, NetBeans recognizes that the dependency is local, and indicates as such with an Ma symbol, as seen below, with the dependency project in green:
This provides some nice functionality, most notably that the "Navigate to" (ctrl+click) functionality from the GUI project takes me to the source code in the library project. I also don't have to manually rebuild the library project for the GUI project to pick up any changes.
However, for the other pair of projects, NetBeans will pick up that the dependency is in my local Maven repo, but does not recognize that the source code is a Maven project that it also has open:
I've tried looking through all the right-click menu options, removing and re-adding the dependency from the NetBeans GUI, comparing the pom.xml, comparing nb-actions.xml, and nb-configuration.xml, but cannot find any explanation of why one library is recognized as local, but the other is not. The only information I've found online is at http://wiki.netbeans.org/MavenBestPractices, where it notes:
"Hint: If you open a project that other projects depend on, the icon in other projects changes to a "maven project" icon to denote that the IDE knows about link between the projects. However such a link is only established when the groupId, artifactId and version all match in the dependency and project declaration. Frequently occurring problem is that you change an API signature in your library project, but the application is not picking up. Often it's caused by the fact that the application is using an older version of the library artifact. The artifact icon can help you track down these problems."
However, I've verified that the pom.xml of the GUI project depends on the version being built in the library project, and even made the versions identical between the GUI project and library, and the "maven project" icon still doesn't show up.
Does anyone know how to debug this issue, or if there's a magic setting somewhere that I'm missing for how to make this link work? I've been trying with both NetBeans 8.2 and 8.1, and am compiling with Java 8 for both the successful pair of projects, and the unsuccessful ones.
Revisiting the project a couple years later, I finally figured out a way to get the dependency to connect locally.
Change the artifact ID of the dependency, and update the dependent pom to match the new name.
This is admittedly bypassing the root issue rather than addressing it, but given the inability to pinpoint the root cause, seems the best option at this time.

How do I add additional plugins to my already existing CKEditor?

This link https://docs.ckeditor.com/#!/guide/dev_example_setups strongly encourages use of the CKEditor builder in order to manage plugins, and strongly discourages installing plugins manually.
Manual Download and Installation of Additional Plugins (Not Recommended)
Although at a first glance it looks like the simplest way
of adding plugins to CKEditor, it is not only inefficient but also may
result in a headache when trying to add plugin A, that requires plugin
B, that requires plugin C (...and so on).
In a brief summary it involves the following steps:
Downloading the predefined package (Basic/Standard/Full) from the
Download page.
Downloading additional plugins manually from the
Add-ons Repository.
Downloading plugins required by additional plugins
manually.
Enabling additional plugins manually through
CKEDITOR.config.extraPlugins.
Then it tauts its Builder:
Using Builder (Recommended)
Using Builder to build a bundle with all required plugins is highly recommended in case of using customized
packages, especially those with additional third-party plugins.
Refer to the Installing Plugins – Online Builder Installation article
for information about building a custom editor package.
But in visiting the page for Builder, unless I'm missing something, it only builds a completely brand new CKEditor from scratch. I can't find any way to keep my current configuration and add plugins.
If there is literally no way to add existing plugins except by doing it manually, I find the language in the docs strongly discouraging this very strange (since 99.9% of the time I'll want to add plugins on the fly and not at the very beginning).
So is manually adding plugins the way to go if I already have other stuff set up?
Most crucial point to keep up with builder is to keep your CKEditor up-to-date. Imaging pain of updating all plugins manually.
Just build our base CKEditor - with ckeditor itself and plugins which 100% you will use in your project.
But no one stops you from adding your own or community plugins. You just need to configure and keep config.js in your ckeditor folder. so you will have your extra plugin configured on each ckeditor update.

Maven site in gradle

Is there a plugin in gradle which can generate maven site similar thing? It would be great if it was compatible with current maven site apt format file.
It seems that there are two plugins, this and this. The first one was committed four years ago, I know nothing about the second. So it seems that these plugins will not be helpful.
I just wrote one as part of Gradle Fury. The primary plugin(s) (it's really just a collection of scripts) for Gradle-Fury is to enhance/fix many of the gradle short comings on publishing, android stuff, pom stuff, etc. Since there's pretty much no standard way for most things in gradle, we jam most of those configurations in the gradle.properties file. That said, the site plugin does depend on those settings to correctly stylize the site.
In short, to apply to your project...
put this in your root build.gradle file
apply from 'https://raw.githubusercontent.com/gradle-fury/gradle-fury/master/gradle/site.gradle'
Next edit your gradle.properties file and use this link as a template for your pom settings....
https://github.com/gradle-fury/gradle-fury/blob/master/gradle.properties
Create a src/site/ directory.
Make a src/site/index.md file as your home page
Copy/clone following files/folders from https://github.com/gradle-fury/gradle-fury/tree/master/src/site
css
images
img
js
template.html
Finally, build the site with gradlew site. Default output is to rootDir/build/site
Don't like the way it looks? (it looks like the Apache Fluido theme from the maven site plugin). Just edit template.html to meet your needs.
I'm currently working on a mechanism to bootstrap the site plugin which will remove a few of these steps, but that's what it is right now. More info and complete feature list is at the wiki
One last note, should run gradlew site after all of your check tasks, but it's not wired up to depend on it. Basically, anything that produces reports for your modules should be ran before site since it's aggregated into the site package, including javadocs and much more. The rest of the fury scripts help automate much of the painful configuration steps. Worth checking out (see the quality and maven-support plugins)
Disclaimer: I'm one of the authors.
Edit: site preview: http://gradle-fury.github.io/gradle-fury/
Edit: We just cut an updated version that makes manual creation of src/site and all the copy/clone tasks from the master repo unnecessary. Just run gradlew site while internet connected and it'll do the rest for you.

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.

Maven does not list current version of a library

With a Maven 3 based project in NetBeans 8 beta, when I context+click on the "Dependencies" item of the "Projects" navigator and choose "Add Dependency…" menu item, I get a dialog box for searching the repository.
Every time I type in "slf4j-api" and choose the found item "org.slf4j : self4j-api", I get different results. Sometimes in the list of versions I get 1.7.0, sometimes 1.7.5, but never the latest: 1.7.6 available for download from the slf4j download page.
Why does the list change when I search and display a list a minute later?
So I got try a search for "logback-classic", and click on "ch.qos.logback : logback-classic". The greatest version number is 1.0.13. That was released in May of last year. Since then version 1.1.0 was released 2014-01-28, and 1.1.1 on 2014-02-05.
Why does Maven not offer these later versions?
Is it a caching problem? Is there some way to force the dialog in Netbeans to update its list of available versions?
I've seen the same problem in Eclipse. It often happens when the IDE can't update it's cached copy of the Maven index.
A quick fix is to put the latest version that I know into the POM and build the project once. The IDE will then download the dependency and from then on, it will know that this version exists.
The longer fix is to look into your IDE's error log to find out why it can't update it's copy of the index files. Often, you need to configure your IDE to use the correct HTTP proxy settings.
Netbeans index all maven repositories in order to find all dependencies and versions. It is a time consuming task so by default it is launched once a week.
If you want to refresh the index go to Tools > Option > Java > Maven > Index and click «Index now»
If you still don't find the last version of your dependency, it is probably that the library has not been uploaded to repositories. To configure repositories go to Window > Services > Maven Repositories.
The documentation is a little outdated but you can find more information, here : http://wiki.netbeans.org/MavenBestPractices#Dependency_management

Resources