Grails BuildConfig.groovy, difference between build, compile, and runtime?

There are a couple of other dependency scopes.

Up vote 2 down vote favorite share g+ share fb share tw.

I'm trying to understand the BuildConfig. Groovy file in Grails 1.3.7. Grails.project.dependency.

Resolution = { plugins { build "acme:acme-cache:latest. Integration" } dependencies { build "com.foo. Bar:foobar:1.0.5" runtime "org.apache.

Httpcomponents:httpclient:4.0.3" compile("com.thoughtworks. Xstream:xstream:1.3.1") } } I understand that Grails plugins get listed under the plugins{} section. I'm assuming libraries (ZIP, JAR, etc) are listed under the dependencies section.

What's the purpose of build, runtime, and compile, and when would you use one over the other? Grails build compilation config link|improve this question asked Jan 5 at 23:37RaffiM4528 81% accept rate.

Build - dependency that is only needed by the build process runtime - dependency that is needed to run the application, but not compile it e.g. JDBC implementation for specific database vendor. This would not typically be needed at compile-time because code depends only the JDBC API, rather than a specific implementation thereof compile - dependency that is needed at both compile-time and runtime. This is the most common case There are a couple of other dependency scopes: test - dependency that is only needed by the tests provided - dependency that is needed at compile-time but should not be packaged with the app (usually because it is provided by the container).

An example is the Servlet API.

– RaffiM Jan 6 at 15:15 yes, same convention for all scopes. I never use the repository - I didn't even know it existed, so in my case I specify groupId:artifactId:version – Don Jan 6 at 16:22 We're using Artifactory to store all of our artifacts, so that's why I mentioned it...thanks again! – RaffiM Jan 6 at 16:45 @RaffiM you could congigure the repo in the repositories section of BuildConfig.

Groovy to avoid having to configure it for each dependency – Don Jan 6 at 14:00.

A couple grails commands help illustrate the difference. Consider grails run-app and grails compile. Grails compile is the compile step and will include compile-time dependencies.

Grails run-app is the run step and will include runtime dependencies. Build dependencies are anything that you might need to run any of these commands, for example, a custom script that hooks into some build events. So you would pick the one that best fits when you need to be certain the dependency is included.

It seems the 2 previous answers conflict on the distinction between compile and build. I believe that build is the scope that includes grails compile and grails run-app, while compile is just the former.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions