Gradle has support for PMD. You can find following example on internet:
apply plugin: 'pmd'
ruleSets = [ "basic", "strings" ]
This code is not working with Gradle 2.0. Here is error message:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':pmdMain'.
Can't find resource null. Make sure the resource is a valid file or URL and is on the CLASSPATH. Here's the current classpath: C:\Users\georgik\tmp\install\gradle-2.0\lib\gradle-launcher-2.0.jar
The reason is simple. In case of Gradle 2.0 you must add language prefix before name of rule. You must use java-strings instead of plain strings.
Here is correct example (available also on YSoftDevs Github):
apply plugin: 'pmd'
ruleSets = [ "java-basic", "java-strings", "java-braces" ]
You can find more rules for PMD in official documentation.
Thanks Matt Sicker for correct solution.
First of all: do not use daemon mode for debugging.
IntelliJ Idea is automatically spawning daemon when you start any Gradle task. You have to attach to remote process.
I wrote small “How to debug” based on info from forums.gradle.org.
You’ll need to set GRADLE_OPTS environment variable to:
Here is example in PowerShell:
Configure Remote debugging in Idea:
You do not need to change anything in default configuration.
Now return to command line with your project and invoke task. Gradle will automatically stop and it waits for debugger.
Here we go 🙂
There is small limitation. You can stop code execution outside DSL e.g. in class method (line 3). You won’t be able to stop execution in Gradle DSL line 10.
You can download sample build script from Github.
I had an opportunity to be one of Lightning talks speakers at Gradle Summit 2014 in Santa Clara – California.
I’d like to share with you slides from my talk about Bamboo and Gradle integration which we successfully deployed in Y Soft.
Link to Speaker Deck
It was exciting to hear about experience with Gradle from other speakers from companies like Netflix, Prezi or JFrog.
Simple scenario: deploy spring application to remote server which has https management interface.
Easy task. When you have properly configured project with pom.xml then you can use tomcat7 plugin for Maven.
Part of pom.xml
<!-- username and password must be set in ~/.m2/settings.xml -->
<!-- URL where Maven can find Tomcat 7 Manager -->
Upload fails with error message:
PKIX path building failed
Ups. Not that easy? 🙂
The problem is that Java does not trust certificate of remote server.
Here is how to fix PKIX issue in Windows.
Open url of remote server by Firefox and save certificate to file.
Run PowerShell as administrator.
Go to directory with JDK cacets and import certificate. Default password is “changeit“.
cd C:\Program Files\Java\jdk1.7.0_40\jre\lib\security
keytool -import -alias test.sinusgear.com -keystore cacerts -file C:\Users\georgik\Documents\test.sinusgear.com
Done. Now you can start mvn tomcat7:deploy again.
I was searching for Apache Tomcat 7 Maven plugin. I found only messages that no such thing exists and that I have to use some workaround. Finally I found link at StackOwerflow that pointed me to the testing version of such a plugin.
You just need to configure repository and update mojo definition.
You can run Tomcat7 by: mvn tomcat7:run
You can read more about this new version of Tomcat Maven plugin at tomcat.apache.org.
This plugin is still under development.
BTW: List Maven plugins hosted at Apache.org is available at maven.apache.org/plugins.
Do you wonder whether your favorite language is the most popular?
Tiobe Programming Community Index could give you some hints about it.
Here is small sample:
You can find more details about other languages also at Tiobe.com.
I was trying to clone git repository. I had brand new Windows with Cygwin version of git. Intellij Idea displayed nice helpful error message:
fatal: The remote end hung up unexpectedly
I found article at grublesmurf.org that pointed me to solution.
Problem was that Cygwin was using directory c:\cygwin\home\georgik\.ssh, but Intellij Idea was trying to read c:\Users\georgik\.ssh. I moved .ssh directory to c:\Users\georgik and set HOME variable to %USERPROFILE%.It is also worthy to modify /etc/passwd in cygwin to match that directory.
BlazeDS provides optimized binary protocol for transfering data known as AMF protocol.
AMF is fast and it has support for transfer of complex objects. Specification of AMF is available at opensource.adobe.com.
The only problem is how to introspect it?
AMF is binary. Therefore normal POST dump or Wireshark dump are not useful.
One solution was to use Flash Builder, but it is quite big and it requires big installation and license and so on.
Piotr Walczyszyn released incredibly simple and powerful AMF introspection tool – Toaster Lite. It acts as a proxy and it decodes all requests and responses.
Just install it. It’s quite small. Configure port and that’s it 🙂
Check out Piotr’s blog with video tutorial.