which Build tool is used in grails?How a project war is created in grails,is it ANT or GRADLE build tool and how it is created using these build tools
Please read the document.You will find your answer.
http://grails.io/post/138665751278/grails-3-gradle-multi-project-builds .
You can build war simply "grails war " command .and for production "grails prod war"
Grails uses GRADLE build tool.
You need to specify the war name in the war command.
grails war project.war
Related
I have a java project which I build and export it as a jar using eclipse. Then I deploy the jar.
Also my project uses dependencies e.g. Apache POI etc. I include these jars in the build path and then clean build and export it as a jar.
I want to build the jar using Jenkins. Please suggest the script and command to perform the same task without using maven. I have to build the code from Gitlab.
I've heard you should type command
grails war
to build your project. I've thought to this point that Gradle is responsible for building the app in Grails. I've been doing the latter with conviction that my app is built. So what's the difference between
grails war
and
gradle build
?
Is it just that grails war is gradle build + create the war file?
It is not that simple to compare Grails and Gradle. Gradle is a build tool, while Grails is a web application framework.
However, Grails provides a command line tool, that's described in the docs:
Grails incorporates the powerful build system Gant, which is a Groovy wrapper around Apache Ant.
So, Grails does not use Gradle.
The basic usage of the grails command looks the following:
grails [environment]* [command name]
Where especially the command name parameter must be one out of predefined values. You can find the documentation on the war command here.
The basic usage of the gradle command looks the following:
gradle [option...] [task...]
The listed task parameters can be names of tasks created either in the build.gradle script or by plugins. All mentioned tasks and their respective task dependencies will be executed. If you use the Gradle War Plugin, it will generate a war task, which will also (transitively) be added as a task dependency of the build task. So whenever you call gradle build, a WAR file will be created. You can also call this task directly via gradle war.
EDIT
I just learned that Grails can or even does use Gradle beginning at a certain version. I even found a list on which Grails command calls which Gradle task. According to this list, calling grails war is equivalent to calling gradle assemble. The assemble task directly depends on the war task.
gradle build is a Gradle lifecycle task which usually consists of other tasks required to build a software like compileJava and other lifecycle tasks like assemble and check.
In case of Grails it delegates build to Gradle and to war task and it doesn't include check lifecycle during which unit tests will be executed.
How to locate build.gradle file ?. Under which folder i need to create build.gradle file ? I am saving all my .jmx test files under jmeter/bin folder
Do i need to create a new java project in IDE to use Gradle?
Please provide detail steps to integrate Gradle jmeter plugin with jmeter + Jenkins
To create a standalone gradle project that runs jmeter tests, you can create a new folder and add a file build.gradle to it, with the following contents:
plugins {
id "net.foragerr.jmeter" version "1.0.3-2.13"
}
Create a folder src/test/jmeter and place all your test .jmx files there.
From jenkins you can run gradle jmrun to run tests and gradle jmreport to generate reports.
I might be missing something, but I have been struggling with this problem for some time now.
I have an Web application with Ant build script. I would like to set up an Artifact to this module, (which is the .war file, generated using ant), so that I could deploy this war file, to the configured Tomcat server.
But I am not able to figure out, how to make Intellij use my Ant script to build artifact. I see an option to Run Ant Targets, but this just runs the Ant target and Intellij then proceeds to generate Artifact, in the usual way.
Please let me know if the question is ambiguous. The problem is not Ant Integration with Intellij. I could just use the Ant window and run any target and also could make an Ant target run as part of Build. The problem is to associate an Artifact to a module and leverage the Ant script to build that artifact. I need this to enable, tight tomcat integration, Since while integrating the Tomcat server, I can specify an artifact to be deployed.
Note: Intellij IDEA version 11.1
IDEA can either deploy Artifact or the External Source (directory or file) that is built by Ant or any other tool:
It's not possible to associate IDEA Artifact with Ant build.
When I generate the war in my grails app via right-click / run grails / command / war, it shows "Environment set to development", having it run without parameters. Why is this happening when according to the docs it should default to production (which is what I need)?
BTW, is there a way having built the whole grails application with NetBeans to use the command line to generate the wars ?
Versions: NetBeans 6.7.1, Grails 1.2
OS: Ubuntu 9.1
Thanks
The netbeans plugin is probably running the command "grails dev war" which creates a war file based on the development settings. The normal "grails war" command uses production settings.
You should just be able to change to the directory containing your grails-app and src folders and run the command
grails war
This assumes that you have grails installed and on your path.
No, only that grails war may assume it to be a development. I suggest you specifically type as follow:
grails prod war
you can modify the proyect file gradle.properties and add
org.gradle.jvmargs=-Dgrails.env=dev //for development
org.gradle.jvmargs=-Dgrails.env=prod //for production enviroment
Check https://docs.grails.org/latest/guide/gettingStarted.html