How does grails/gradle download the dependencies without version specification - grails

In Grails 3 project we are using some dependencies as below. For the plugin or dependencies which has version it downloads as per version specification from remote repository. We assumed it is downloading the latest dependency available when we did not mention version, but when we checked the hibernate dependency it is downloading '4.3.10.6' version in the project whereas remote repository has latest version. So how does grails or gradle download dependencies without version?
compile "org.grails.plugins:hibernate"
compile "org.grails.plugins:cache"
compile "org.hibernate:hibernate-ehcache"
compile "org.grails.plugins:scaffolding"
compile "org.webjars:bootstrap:3.3.5"
compile "org.webjars:bootstrap-tagsinput:0.5"
Note : We don't have any errors or issues with this in our project

If no version is specified, Gradle will use transitive dependency management, starting with the Gradle version number, and the packages that that Gradle version depends on. If transitive dependency management doesn't care. Then Gradle will search through the hierarchy of repositories and flat files and flat trees and dependent projects and take the latest version.

Related

Does Maven 3.5.2 supports Java11 builds

In Jenkins, currently there is only JDK8 and maven 3.5.2 installed. I downloaded JDK11 to it. I ran a pipeline project to build a springboot Java11 project and it ran fine using maven 3.5.2. There is no reference to any maven source or target versions in the pom of the project. Currently I don't see any issues with JDK11 with maven 3.5.2 due to simplicity of the project. Any idea if it might cause issues with complex projects? Is it good to update Maven version in Jenkins and the spring boot projects?

Are grails plugins compiled at publish time

I see that grails plugins compile files of plugins too. So I am guessing grails plugins are not compiled into bytecode. Is there a way to make grails plugins compile into bytecode so they are not compiled over and over in all projects that have them as dependency?
Note: I'm using grails 2.4.3 but this question may apply to other versions as well.
So I am guessing grails plugins are not compiled into bytecode.
Grails plugins are compiled to bytecode. There is no other way to execute Groovy or Java code.
Is there a way to make grails plugins compile into bytecode so they
are not compiled over and over in all projects that have them as
dependency?
The code has to be compiled into bytecode before it can be executed. In the old plugin system (Grails 1 and 2), that happened at application compile time. With Grails 3 and Grails 4, plugins are compiled when they are distributed so when an app consumes them, the code has already been compiled to bytecode so the code is still being compiled to bytecode, but that is happening once when the plugin is published as opposed to happening when the app that uses the plugin is compiled.

Automate version in .install4j file based on POM version

I am using Maven to automate build process of Install4j.
For every release product, POM version is updated. I want when pom version is updated Install4j version should be updated (under General Setting-> ApplicationInfo->Version).
How can i automate version in install4j file. So that version should always remain latest for my product installer.
You can set the release parameter for the install4j compile target to set the version from the maven plugin. See
http://sonatype.github.io/install4j-support/install4j-maven-plugin/compile-mojo.html
for more information.

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.

How to build project dependencies from source jar-s with maven

I have a project, which is building with maven 3. While building project maven downloads a lot of dependencies (jars). I want to build all this dependencies from source-jars, which I get from maven repository with maven dependency plugin.
But this source jars doesn't contain any pom or other things for building. How I can build them with maven??
You can't. You need to get the source from the project's source repository. The source-jars are just for helping developers debug dependencies.

Resources