How to exclude a plugin from development environment in Grails 3? - grails-plugin

I would like to disable a specific plugin while running in development mode. Is there a generic way to achieve this in Grails 3.x?
I found the following solutions for Grails 2.x, but they won't work for Grails 3 since it uses Gradle instead of BuildConfig.groovy:
Exclude plugin for specific environment
Is it possible to exclude grails plugin from production environment?
Specifically, I am looking for a way to disable the LDAP sub-plugin for the Spring Security plugin, when running in local development mode.
UPDATE: I found that org.grails.plugins.DefaultGrailsPlugin has an isEnabled method, that returns a boolean based on whether the plugin's profiles list matches the set of active profiles (e.g. "development").
But the private method that initalizes the profiles list (evaluateProfiles) appears not to be called anywhere (it should probably be called in initialisePlugin, along with other evaluate* methods).

Related

Not ableto migrate from eclipse 3.x to eclipse 4.x

We've an RCP application based on 3.x api we are trying to migrate it to eclipse 4.x.
The problem is some part of the code was using eclipse internal classes present in the workbench.jar . SO i added the workbench.jar JAR from the previous eclipse(HELIOS) to my new eclipse(KEPLER) this resolved the errors .But my application is not able to start.So just wanted to know is it the correct approach
1.Can I have two workbench.jar JARS(3.105 and 3.6) in my application.
2.If no then is there a way to search for the internal classes which I was using previously in the new jars I was mainly using the internal classes related to layout and prespectives(like : org.eclise.ui.internal.layyoutPart ,org.eclipse.internal.ui.perspectives)
3.Is there a way using which I can avoid rewriting the code.
Eclipse 4.x is a very substantial rewrite so there is very little chance that internal classes from 3.x are going to work. Multiple workbench jars is not going to work in any case.
The layout and perspective classes you mention do not exist in Eclipse 4.x, you are going to have to rewrite your code.
See also Eclipse API Rules of Engagement

How to ensure eclipse plugin has required bundles available?

I'm just starting to develop a new eclipse plugin where I want a web application server running in Eclipse. I found a nice blog, OSGi as a Web Application Server, that describes how to do this. The author suggests creating a target environment for my bundle requirements, and some of those bundles get pulled in from the Equinox Project SDK (now called Equinox Target Components in Juno). I notice that the tutorial project runs fine when my target platform is the platform I created in the tutorial, but fails to start when it is the default platform. So, now for my question...
If I need bundles that are not part of the default, how will my plugin project get access to those bundles? Will I need to deploy them along with my plugin? How would I know if the user's eclipse does or does not already have those required bundles?
You was not much clear about what kind of application you are developing. Running a web server in an Eclipse IDE as a plugin don't make any sense to me. This kind of server application is best just running on top of Equinox.
Anyway, the right path is to create a "Product Configuration" file and add categories that contains the needed bundles (go to File/Plug-in Development/Product Configuration).
With this file you can run an instance of the product (inside the IDE) and can export it (create a zip containing all needed bundles)
And if you want to able your user to install plugin inside his IDE you must create a P2 repository (using a Target Definition File) and expose the exported directory within a Http server. You could research about Tycho to build this kind of components in a maven style.
Well, I'm not sure if re-inventing the wheel again is really sufficient.
You might take a look at Pax-Web for inspiration on how to do it, or take a look Apache Karaf as a OSGi-Container (using Pax-Web). Or even better start contributing to one of the two :-)

Ignore Sibling-Modules During Maven Javadoc/Site Compilation

I have a Maven-managed project which contains a few modules, one of which is the actual library of interest. The other modules are just add-ons or examples that build off of the library. I'm looking to generate the Maven site for this library and have it automatically deployed (as a standalone site and not as part of a multi-module site) but I am having trouble with the Javadoc plugin.
When executing the javadoc:javadoc goal, the javadoc plugin is attempting to access the jar for the other modules causing a failure.
I have created a simple example which demonstrates this phenomenon. Make sure you run the clean goal before any others so that the flaw be shown. Though executing the packaging first would solve this error, this cannot be done because the use case occurs during the Maven-managed release process which starts from a clean state.
Is there a way for me to disable this functionality in the javadoc plugin so I only get the documetation for the library module?
I can think of two options depending on your preference. Both include using profiles. If you want the default build to create the javadocs for your library of interest. Make the other modules use a property inside of the default profile in order to skip the javadocs.
If you are okay with passing in a profile, just have the javadocs only run in the profile.

Maven Chronos plugin

I have a problem with Maven Chronos plugin. Is it possible to tell plugin a mask for name of jmx files to execute?
Thx
It is still not possible to use the chronos plugin to proces files based on a mask. It is possible to select a folder containing tests (.jmx-files), which should be good enough for most cases.
I have a problem with Maven Chronos plugin. Is it possible to tell plugin a mask for name of jmx files to execute?
No, this is currently not supported, the chronos plugin is limited to process only one .jmx/.jtl that you must "hard code" in the POM. But an issue has been logged as MOJO-1460 to enhance the plugin and make it able to process multiple scenario. It's not exactly what you're asking for but it might provide a decent alternative (and there is a patch attached).
Do you know if I can run multiple jmeter tests with any other plugin?
I double checked and it appears that the maven-jmeter-plugin can do that (and even supports includes and excludes if required).
A more recent version of the plugin (using JMeter 2.3) was hosted on Google's code and can now be found on github.

Maven Cargo configuring a Glassfish 2.1 instance to run integration-tests?

I was wondering whether it is possible to use Maven2 to automatically configure a Glassfish 2.1 with JNDI Resources, Datasources and Mail-Sessions for my integration tests.
Also I wonder whether it is possible to create some sort of benchmarks that might then be tracked using continuum or Hudson.
I was wondering whether it is possible to use Maven2 to automatically configure a Glassfish 2.1 with JNDI Resources, Datasources and Mail-Sessions for my integration tests.
I'm not sure Cargo does provide anything to configure Mail-Sessions. And anyway, from what I can see in DataSource+and+Resource+Support, there is no support at all for GlassFish. I'd simply configure the installed container against which you run your integration tests.
Also I wonder whether it is possible to create some sort of benchmarks that might then be tracked using continuum or Hudson.
You could run JMeter performance tests. Hudson has a Performance Plugin allowing to generate a trend graphic report from the results. Also maybe have a look at JChav (seems dormant though).