Grails return CSV - grails-plugin

I am working on Grails 2.4.0 and I would like to return CSV file to the browser.
export plugin doesn't work - I get
Resolve error obtaining dependencies: Could not transfer artifact org.grails.plugins:export:jar:1.6
How can I achieve this?

Try add this in your plugins -
compile(":export:1.6") {
exclude "bcprov-jdk14"
}
*For me is working (grails 2.3.11)

Related

Checkstyle 8.41.1 throws exception when configuring a custom Google checkstyle.xml in IntelliJ 2021

I have upgraded to the latest Checkstyle plugin (8.41.1) using IntelliJ 2021.
I'm trying to configure a custom google checkstyle xml file, so I took the lates example from Github and tried to set it as config file to the checkstyle plug but I'm getting the following exception
com.puppycrawl.tools.checkstyle.api.CheckstyleException: cannot initialize module TreeWalker - cannot initialize module JavadocMethod - Property 'accessModifiers' does not exist, please check the documentation
at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:473)
at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:201)
at org.infernus.idea.checkstyle.service.cmd.OpCreateChecker.execute(OpCreateChecker.java:61)
...
...
If I'm setting the builtin Google check then it works.
Any idea?
I took the lates example from Github
This is the issue. You should be using the config that was built for the version of checkstyle you are using. You pulled in master's config which contains new features that have not been released.
See https://github.com/checkstyle/checkstyle/blob/49d1ea3835e017133ada46555d2214e017fc6fe2/src/main/resources/google_checks.xml

Disabling Node.js download in KotlinJS Gradle plugin

The version of Node.js that KotlinJS downloads (as of 1.3.40+) seems not to work in Alpine Linux. The docker image I'm using already has Node baked into it, so there's no reason not to use that one.
However, I'm having trouble figuring out how to set download to false (which should cause KotlinJS to build using the node on the PATH).
The relevant section of my build.gradle looks like this:
kotlin {
target {
useCommonJs()
browser()
}
}
Any help would be appreciated!
Looks like it's pretty similar to #talalUcef's answer:
kotlinNodeJs {
download = false
}
Using the KotlinBrowserJs plugin applies the NodeJsRoot plugin.
The NodeJsRoot plugin applies itself, which causes the NodeJsRootExtension to be included under the name kotlinNodeJs.
Thus, I believe, any of the vars here can be set inside a kotlinNodeJs block.
You can add
node {
download = false
}
on your build.gradle file

InteliJ IDEA artifact not configured properly with Gradle

A gradle project configured with wrapper version 3.5. This gradle wrapper version works properly when import as project in Intelij IDEA 2017.1 and IDEA war artifact are available.
I tried to update gradle wrapper version to 4.0.2 and IDEA could not configure artifacts, it shows this Warning:
Warning:<i><b>root project 'dummy-trunk': Web Facets/Artifacts will not be configured properly</b>
Details: org.gradle.internal.typeconversion.UnsupportedNotationException: Cannot convert the provided notation to a File or URI: .
The following types/formats are supported:
- A String or CharSequence path, for example 'src/main/java' or '/usr/include'.
- A String or CharSequence URI, for example 'file:/usr/include'.
- A File instance.
- A Path instance.
- A URI or URL instance.</i>
Maybe someone with the same problem?
I don't know how to get more info about the warning.
I tried to run > gradlew idea -d but this debug ouput do not show the warning.
Solved with IDEA 2017.2.1 + Gradle Wrapper 4.0.2
Thx to #CrazyCoder for your suggestion.
I have same problem.
(*) Update to IntelliJ IDEA 2017.2.5
(*) Use Gralde 4.2.1
(*) Use Gradle local, use mavenLocal()
This is a sample (a part of file build.gradle)
buildscript {
ext {
springBootVersion = '2.0.0.M5'
}
repositories {
mavenLocal()
mavenCentral()
maven { url "https://repo.spring.io/snapshot" }
maven { url "https://repo.spring.io/milestone" }
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}

Intellij+Springboot+Thymeleaf+gradle - autoreload html resources

I am using IntelliJ Ultimate, Spring Boot, and Thymeleaf.
I want to enable auto-reload of HTML without restarting the server and without CTRL-F9.
I have read the following already and I think it should be working, but it's not:
https://github.com/spring-projects/spring-boot/issues/34
IntelliJ 15, SpringBoot devtools livereload not working
Livereload for assets in Intellij using Spring boot
I have done the following steps:
build.gradle snippet
compile group: 'org.springframework.boot', name: 'spring-boot-autoconfigure', version: '1.5.2.RELEASE'
compile("org.springframework.boot:spring-boot-devtools")
runtime('mysql:mysql-connector-java')
testCompile('org.springframework.boot:spring-boot-starter-test')
}
bootRun {
addResources = true
}
IntelliJ Settings for Compilier:
And Intellij Registry Setting:
My HTML is in main\resources\templates and my application.properties is in \resources\
I then have tried both running and debugging the project but either way, I still have to rebuild (CTRL-F9) between changes to the HTML.
Reading here from snicoll and dsayer this should be possible without the CTRL-F9:
It appears after adding the registry setting :
compilier.automake.allow.when.app.running
You need to restart not only the Springboot server but Intellij too.
It is going now.
If you are still struggling with spring-boot-devtools, I recommend using Gulp to automate templates and resources reload. Following is a little Gulp task that does the magic for me:
var gulp = require('gulp'),
watch = require('gulp-watch');
gulp.task('watch', function () {
return watch('src/main/resources/**/*.*', () => {
gulp.src('src/main/resources/**')
//replace with build/resources/main/ for netBeans
.pipe(gulp.dest('out/production/resources/'));
});
});
gulp.task('default', ['watch']);
I also wrote a short blog post on this topic which includes other methods as well.

Unable to use apache-ldap-api with grails 2.2

I am trying to use apache-ldap-api with grails 2.2 . The latest version of the api on their website is 1.0.0-M15 , but maven repo has upto 1.0.0-M13 . So I decided to use M13 first by adding a dependency to BuildConfig.groovy:
dependencies {
// specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes e.g.
runtime(
[group: 'org.apache.directory.shared', name: 'apache-ldap-api', version: '1.0.0-M13']
)
// runtime 'mysql:mysql-connector-java:5.1.20'
}
Grails downloaded the dependency alright, but when I try to use the API in the code such as:
import org.apache.directory.groovyldap.LDAP
LDAP.newInstance(...)
I get a compile error :
LdapController.groovy: 2: unable to resolve class org.apache.directory.groovyldap.LDAP
# line 2, column 1.
import org.apache.directory.groovyldap.LDAP
^
1 error
The compiler lets me import 'org.apache.directory.groovyldap.*' but then again, the call to 'LDAP.newInstance()' throws an exception.
I also tried manually dropping the 1.0.0-M15 version in my /lib folder and running 'grails compile --refresh-dependencies' without any luck. Any ideas if I am doing something wrong here?
Thanks!
1 run this grails compile --refresh-dependencies
2 change LDAP.newInstance(...) into new LDAP
This is how it works for me