Offline maven build

I’m surprised a List of Configuration can’t be used as a task input. To get it working you could remove the @Input annotation from the task. Obviously up-to-date checking won’t work if you do this

eg:

@Input <-- remove this
List<Configuration> configurations

This possibly requires a jira to make the Configuration serializable… or maybe it would work with a newer version of gradle.

Possibly related to GRADLE-1784

Yes, now the offline task runs without any error, but if I comment out the url “https://repo.grails.org/grails/core” lines and try to use the local versions, I still get errors if I try to run the bootRun task. It looks like it still needs other files. To name a few: grails-bom, slf4j-1.7.10 (this is actually in the location but with different version).

I’m not familiar with the dependency-management-plugin but I’m guessing that there’s another configuration (or more) that need to be saved offline.

Try this:

task offline(type: OfflineMavenRepository) {
   def allConfigs = []
   allConfigs.addAll(project.configurations)
   allConfigs.addAll(buildscript.configurations)
   configurations = allConfigs
}

Still says it needs a lot of dependencies, which are not at the local folders.

As I said, I don’t know how the dependency management plugin works. Try creating another configuration with the missing dependencies so it’s backed up.

configurations {
   temp
}
dependencies {
   temp "org.grails:grails-bom:$grailsVersion"
}

Ok thanks, I’m gonna start to work on the missing dependencies and gonna report back, it that is gonna work.

Obviously that’s a bit of a hack. The proper solution is to source the missing dependencies from the dependency management plugin model somehow

So at last I have succeeded!
If anyone is interested I have used Nexus on my local computer, and set it up, so it would download everything into a specific folder. After that I was able to use this build.gradle (gist).
Also I had to save the gradle-2.9-bin.zip file and set it up in C:/path/project/gradle/wrapper/gradle-wrapper.properties like this:

distributionUrl=file:///C:/path/to/gradle-2.9-bin.zip