Java file compilation

Can anyone please provide me with an example of how to compile a java file along with dependencies using maven repository. I dont want to use any maven pom script . If possible please provide the working script example in gradle only

hey vivek,

the gradle userguide contains a “java quickstart” chapter that should help you to get started fast. You can find another example of a simple java build in the full gradle distribution in the samples/java/quickstart subfolder

cheers, René

I have already consulted with the userguide however it did not helped me much . As i am new to gradle i just need an example to compile a simple java file .

Thank You for fast response

Maybe not quite what your are looking for, but the most simplistic java build is listed out on the Wikipedia entry for Gradle:

In some directory, create a build.gradle file with just apply plugin: ‘java’, and then create the subdirectory src/main/java and place one or more java files into the corresponding package-scoped subdirectories.

From the directory with the build.gradle, run the command gradle build, and it should compile and package up a jar into the build/libs directory.