Maven versions plugin: updating plugins - maven-3

I'm seeing some updates when I run the versions:display-plugin-updates but I found no way for the plugin to fix those. Am I just missing something?
Here's the output:
The following plugin updates are available:
maven-checkstyle-plugin ................................ 2.16 -> 2.17
maven-release-plugin ................................. 2.5.2 -> 2.5.3
maven-surefire-report-plugin ......................... 2.18.1 -> 2.19
org.codehaus.mojo:findbugs-maven-plugin .............. 3.0.2 -> 3.0.3
The following plugins do not have their version specified:
maven-clean-plugin ........................ (from super-pom) 3.0.0
maven-deploy-plugin ....................... (from super-pom) 2.8.2
maven-install-plugin ...................... (from super-pom) 2.5.2
Project defines minimum Maven version as: 3.0.4
Plugins require minimum Maven version of: 3.0.4
Note: the super-pom from Maven 3.0.5 defines some of the plugin
versions and may be influencing the plugins required minimum Maven
version.
No plugins require a newer version of Maven than specified by the pom.
Require Maven 3.1 to use the following plugin updates:
org.bsc.maven:maven-processor-plugin .................... 3.1.0-beta1
Is there a goal to update those plugins and/or add the ones not defined?

The short answer is that you need to update the versions in your pom.xml by hand.
It's not particularly onerous as it is not something that needs to be done frequently.

There is a workaround: Define plugin versions as properties, then the goal update-properties updates these versions as well.

Related

Upgrading a Grails app from 1.3.7 to Java 8 compatibility version

I am looking to upgrade Grails from 1.3.7.
Which version of grails is compatible with Java8?
What versions of hibernate and tomcat plugins to be used?
Which version of grails is compatible with Java8?
Grails 2.5.x is the first version of Grails for which we officially support Java 8.
What versions of hibernate and tomcat plugins to be used?
Your options there will depend on which version of Grails you decide to use. If you are using Grails 2.5.6 then I would suggest :tomcat:7.0.70 and either :hibernate4:4.3.10 or :hibernate:3.6.10.18. With Grails 3 you have a wider array of options.
Which version of grails is compatible with Java8?
I upgraded to 2.3.10 with JDK 1.8 successfully in two steps.
I first tried to upgrade it to version 2.0.5 from 1.3.7. (Note earlier vesions of grails support upgrade command which helps to upgrade few things automatically).
Remember there will be some changes in Application
AppplicationContext.xml will have some changes.
The class org.codehaus.groovy.grails.commons.ConfigurationHolder is deprecated. Use below code
def config = Holders.config
In second step I migrated from version 2.0.5 to 2.3.10
What versions of hibernate and tomcat plugins to be used?
runtime ':hibernate:3.6.10.16' // ':hibernate4:4.3.5.4' for Hibernate 4
build ':tomcat:7.0.54'

Grails Upgrade to 2.5.5 - Unresolved dependencies - groovy-all 2.4.5

I am trying to upgrade my grails application from 2.0.0 to 2.5.5, running into Unresolved dependencies for groovy-all jar.
Dependency resolver in BuildConfig.groovy is set to ivy. Also, location %USERPROFILE%/.grails/ivy-cache/org.codehaus.groovy contains groovy-all.jar of version 2.4.5
Java is set to JDK7
Exact error:
org.codehaus.groovy#groovy-all;2.4.5: configuration not found in org.codehaus.groovy#groovy-all;2.4.5: 'master'. It was required from org.grails#grails-core;2.5.5 compile
BuildConfig.groovy
grails.project.dependency.resolver = "ivy"
repositories {
mavenRepo "link to company specific repo"
mavenCentral()
}
plugins {
runtime ":hibernate4:4.3.10"
runtime ":jquery:1.7.1"
runtime ":resources:1.1.5"
runtime ":bubbling:1.5.1"
runtime ":calendar:1.2.1"
runtime ":code-coverage:1.1.6"
runtime ":jsecurity:0.3"
runtime ":tomcat:7.0.42"
runtime ":webflow:1.3.7"
runtime ":webtest:1.1.5.1"
runtime ":yui:2.8.2.1"
build ":tomcat:7.0.70"
}
Please help. Let me know if any additional details needed.
After spending lot of time finding reason for this issue, I came across an issue reported in Grails version 2.5.5 (https://github.com/grails/grails-core/issues/10011) So before going to my project, tried to execute basic grails command "grails-createapp". This command also failed with error mentioned in question above.
Solution in our case was to
1. Remove Grails version 2.5.5 (if this is already installed)
2. Download/install Grails version 2.5.4
3. Run basic command grails-createapp. This runs fine and an app is created.
4. Remove Grails version 2.5.4
5. Install Grails version 2.5.5 now
6. Run command - grails createapp (this starts working now)
Strange issue :)
For upgrade to version 2.5.5 add to your BuildConfig dependencies the line
compile 'org.codehaus.groovy:groovy-all:2.4.6'
This worked for me.

Grails plugins getting upgrade and downgrade message for same build

I have grails rest-client-builder plugin installed in my grails application.
Earlier I had 1.0.3, but now I changed the version in BuildConfig.groovy to 2.1.1
Now I am getting this following strange message:
|Environment set to development
.................................
|Packaging Grails application
You currently already have a version of the plugin installed [rest-client-builder-1.0.3]. Do you want to upgrade to [rest-client-builder-2.1.1]? [y,n] y
y
.
|Installing zip rest-client-builder-2.1.1.zip...
...
|Installed plugin rest-client-builder-2.1.1
..............You currently already have a version of the plugin installed [rest-client-builder-2.1.1]. Do you want to downgrade to [rest-client-builder-1.0.3]? [y,n]
Now My question is why I am getting the message to downgrade to 1.0.3 in the same build?
I suspect this is linked to some strange errors (like unit test framework quitting expectedly which was not happening before the upgrade).
PS: When again putting 1.0.3 version back, I just get the message to downgrade. So I wonder whats wrong when I put the higher version.
I am not sure whether this will work for you or not but you can run grails depedency-report command and see if there is anything in there that it's needing the older version. If so upgrade that other plugin If that is not the case make sure you do not have any references in BuildConfig to 1.0.3. This is my BuildConfig:
plugins {
build(":release:3.0.1", ":rest-client-builder:2.1.1", ":tomcat:7.0.54") {
export = false
}
runtime ":console:1.5.4"
runtime ':db-reverse-engineer:0.5'
runtime ":hibernate:3.6.10.16"
compile ":scaffolding:2.0.3"
runtime ":jquery:1.11.1"
compile ":jquery-ui:1.10.4"
compile ":mail:1.0.7"
compile ":cache-headers:1.1.7"
compile ":rest-client-builder:2.1.1"
}
When I had that issue I realized i had the rest-client-builder:1.0.3 listed in the build section and in compile I had the 2.1.1. It was in front of my eyes and I would not see it.
You can also try to do a clean-all. Additionally, delete all the plugins from your .m2 folder at C:\Users\your_user\.m2\repository\org\grails\plugins\rest-client-builder
Then do a grails refresh-dependencies with just the 2.1.1 version in your BuildConfig. I am running grails version 2.3.11 For earlier than grails 2.3 you are stuck with the earlier version.

Grails application holder error

I am working in grails 2.4.0 and installed excel-import 1.0.0 plugin to the project. While compiling the project it is generating an error that could not resolve the class Application Holder. Please help.
I was having the same problem. You can get the version 1.0.1 of the plugin here https://github.com/jbarmash/grails-excel-import
Or if you prefer, add this url to the repositories section in BuildConfig.groovy
mavenRepo "http://maven.ala.org.au/repository/"
I found that this repository has the latest version of the plugin (at least it compiles with grails 2.4.4, real tests are yet to be made)
Then add this two entries to the plugins section
compile ":excel-import:1.0.1"
compile ":joda-time:1.5"
Upgrade your plugin to the latest 1.0.1 version. It was made 2.4.x compatible.

Dependencies and lastest.release

We are currently using grails 2.2 and are trying to upgrade to 2.4, but we have an issue.
In BuildConfig.groovy, we have a few dependencies and plugins that use latest.release.
For example: 'com.example:myplugin:latest.release'.
In grails 2.2, this would work as expected. In grails 2.4, I receive an error: Error Resolve error obtaining dependencies: Could not find artifact ...
We are using the latest version of Artifactory. The error indicates that grails is looking in the correct location, but cannot find it.
If we specify a specific version then grails finds it ok. For example: 'com.example:myplugin:12.03.01'
Has something changed with latest.release since version 2.2? Should we now specify the version numbers?
Thanks.
The latest.release syntax is Ivy specific and only worked with the Ivy resolver. Grails 2.4 uses Aether a dependency resolver which is the dependency resolution engine found in the Maven build tool. In Maven the syntax for expression the latest version is slightly different. See http://docs.codehaus.org/display/MAVEN/Dependency+Mediation+and+Conflict+Resolution#DependencyMediationandConflictResolution-DependencyVersionRanges
So to get the latest version you expression a minimum version with no upper bound. Example:
compile ":feeds:[1.6,)"

Resources