Grails cobertura support - grails

Just added Cobertura to project and faced with problem like in this question. How can I add a lib only for test environment to Grails project? Or maybe you know a better solution for Coberture in Grails?

Related

What is currently a good way to develop a Vaadin 8 project with Eclipse?

Yesterday I tried to create a Vaadin project as described under https://vaadin.com/framework/get-started
I did it that way because the current eclipse plugin doesn't support greating Vaadin 8 projects.
Then I imported the project using Eclipse Import->Existing Maven Projects.
THis worked almost fine - only when starting the project using "Debug on Server" the Browser cannot connect to the application, although the application seems to be loaded.
When using mvn clean install and deploying the war manually this works.
What is missing there? Is there currently a good way of using Vaadin 8 with Eclipse?
Apparently this is more of an eclipse configuration question.
The context root can be changed using the projects Properties->Web Project Settings.
I would already use Vaadin together with spring-boot. On spring site they do have also a nice initializer tool to create your project: https://start.spring.io/ (Vaadin 8 is already used)
Also very helpful: http://vaadin.github.io/spring-tutorial/
The big advantage of using spring for me is the dependency injection, which simplifies the project setup.

Creating Grails shared libraries

I'm working on a multi-module project right now, where most of the modules are designed to have their own Web interface (REST API, Web pages, etc.) done using Grails. There are a few classes that I want to be utilized by different (all) modules. If this were a straightforward Java project, I would just create a new Maven project (using archetype:generate), deploy/install, and just import it on the modules accordingly. How do I do this with Grails? Is this one of the things Grails plugins are meant to address?
Since you are talking about a jar/lib artifact it would be best to use a local Maven repository where you build your maven project to then resolve it as a dependency for your modules within your BuildConfig.groovy.
Nothing is stopping you from using a Grails plugin to provide this resource, but that seems a bit overkill since Grails plugins are intended to do so much more.
It looks to me that you want to have a multi-project build or a Mavenized Grails project or separate plugins.
Use a Grails multi-project-build
Guide: http://grails.org/doc/2.1.0/ref/Command%20Line/create-multi-project-build.html
Straight Maven integration
Guide : http://grails.org/doc/latest/guide/commandLine.html#antAndMaven
I have a basic introduction video here: https://www.youtube.com/watch?v=tqGN61hiciE
Separate Grails plugins
You could still use separate Grails plugins and reference them in your main application.

Using grails-mail-plugin outside Grails app

Is it possible to use a grails plugin outside a grails application?
I would like to use the functionality of grails-mail-plugin in a simple groovy/gradle app.
I found some information about binary plugins but I'm not sure how to define the dependency to an official grails plugin.
Thanks!
I don't think you could use any Grails plugin itself outside the Grails environment, usually there is a ton of Grails-specific assumptions built into the plugins' code.
If your Groovy application uses Spring, you could migrate the most important functionality out of it.
For this, you will have to get into the innards of the source code of the plugin (e.g. how it uses the Spring Mail package for example) which not may be very quick or easy work.
If your requirements are simple, you may be better of with building a standalone solution, possibly, directly on top of JavaMail.
If you already have a heterogeneous architecture, you may build a separate Grails application/module which only does mailing functionality (possibly through the Async Mail plugins database tables) in integration with the module you build in pure Groovy.

Grails plugin mismatch between pdf0.6 and jasper

We are working on grails 1.3.7 project. renderpdf0.6 plugin individually working fine. but now, we have added jasper plugin to our project. the jasper related pdf generation is working fine but the renderpdf0.6 plugin is not working after adding the jasper plugin. the exception is
java.lang.NoSuchMethodError: com.lowagie.text.pdf.BaseFont.getCharBBox(C)
we have been searching for this issue in google and other grails fourms. and some suggested that the core-renderer.jar may be effected by the differenent versions of iText.
Edit:
How to specify in grails, to force the core-renderer plugin to use the specific iText version ?
I think this might be a duplicated question. Have you tried the solution in Which version of iText to use so that both JasperReports and Grails Rendering plugin works

Compiled and signed grails plug-in

Is it possible to compile and sign grails plug-in? I am thinking about distributing my application logic using grails plug-in architecture and I do not want my client to be able to read that easily .groovy or to modify it. Is it possible to package it somehow or at least distribute only compiled .class?
Yes. you need to think more traditional Java.
Create a JAR with your logic in it and sign the jar. Put the minimum Groovy code in the plugin. You have not stated where the logic is if it's a controller or GORM object so I am not sure what you looking for 100%.
Hope this helps.
It is possible to compile and package groovy/java code into a jar and then use it in a grails app. (as Scott suggests) but these classes can not directly benefit from grails ie. no way to declare grails service, domain class or controller in a separate jar.
There is an issue in grails jira describing the same problem:
http://jira.codehaus.org/browse/GRAILS-4956
Since Grails 1.4 M1 there are binary plugins, I assume this is exactly what you need. I'm not sure if signing is supported in any way, but it's at least possible to distribute the plugin without its sources.

Resources