Compiling with gradle idea - compilation

Hi) when I compile the project are with gradle idea, I should get jar file...?
maybe in the folder dist...
The problem is that I get only two files start.sh and start.cmd

gradle idea doesn't compile the project. It creates project files (*.iws, *.ipr, *l.iml) for IDEA (the IDE from JetBrains). Likewise, there is gradle eclipse to create project files for the Eclipse IDE.
To create a Jar, you can do gradle jar or gradle build (assuming you have the java plugin applied). gradle tasks shows which tasks are available for a given project.

start.sh and start.cmd sound like they are coming from the application plugin. Are you using the application plugin?
The above poster is right that gradle idea simply creates the IntelliJ files that define your modules, src locations, etc. It does NOT compile the project.
Adding apply plugin: 'java' to your build.gradle will allow you to run gradle jar to generate a jar file.

Related

Gradle - Copy file inside a dependency of a java project

I am new to gradle. I am trying to write a gradle script that copies some scripts inside a dependency of a java project. How can I achieve that? I tried to read documentation to figure out how can specific files be pulled from a dependency but couldn't find anything.
So my projectA -> Depends on projectB:moduleB -> Depends on projectC:moduleC:{Has files that I need to copy in projectA tar}

Gradle custom plugin as a standalone project

I have custom gradle plugin as a standalone project. I would like to use it in other project.
Suppose that plugin is not yet build. Is there any way how can I compile my plugin (in my other project) and add it on classpath to buildScript block all in one build.gradle of my other project ?
I am new to gradle so sorry if this is dumb question.

Run specific project using gradle

I have a Groovy application, I am using Gradle as my build tool. I have 2 seperate projects a Ratpack project with it's own build.gradle file and then a React project with it's own build.gradle file.
When I do ./gradlew run It builds my Ratpack project which in my Ratpacks build.gradle file has
compile project(':react-app')
In the dependencies closure.
Is there a way to just be able to run one of the projects for example ./gradlew runRatPack which stops the React project from being built?
If you can change the following line
compile project(':react-app') which states there is a Project Dependency to
compile name : 'react-app' - artifact dependency, then the project will try to pick the artifact from the repository instead of building the project.
Please let me know if the issue is addressed and this solves your issue.

How do you run War files generated by Gradle War plugin on IDE?

How do you run War files generated by Gradle War plug-in on IDE?
How to configure the IDE to run the file on its own?
Intellij IDEA can do it. I just need to configure it for 'gradle war' and deploy the output.
Apply "Jetty" plugin to your project:
apply plugin: 'jetty'
after that, task jettyRunWar will be available. It will run your war from commandline or IDE.

Why does my gradle download sources by default?

I converted my maven project to gradle with gradle init. Now every time I import the same project into my IDE, gradle downloads the same dependencies from the scratch, and what's worse is it also downloads the sources, I have no idea where that was configured, I am using IntelliJ, but I didn't configure anything related to gradle. How can I let gradle cache the same dependencies and not download sources?
You can disable downloading sources in your Gradle config file when using 'idea' plugin. See: http://gradle.org/docs/current/dsl/org.gradle.plugins.ide.idea.model.IdeaModule.html (search for 'downloadSources').

Resources