# To create jars before compilation

**URL:** <https://discuss.gradle.org/t/to-create-jars-before-compilation/11478>\
**Category:** Help/Discuss\
**Created:** [September 4, 2015, 10:46am UTC](https://discuss.gradle.org/t/to-create-jars-before-compilation/11478 "2015-09-04T10:46:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Niranjan123456](https://avatars.discourse-cdn.com/v4/letter/n/a88e57/32.png) [@Niranjan123456](https://discuss.gradle.org/u/Niranjan123456)\
**Post date:** [September 4, 2015, 10:46am UTC](https://discuss.gradle.org/t/to-create-jars-before-compilation/11478/1 "2015-09-04T10:46:20Z")

</div>

Hello All,

I am novice to Gradle, The current Maven project has a pom.xml which will create and provide the jar before the actual compilation starts for that project.

The part of pom.xml which I am unable to translate to gradle is in the below location.

[https://gist.github.com/Niranjan123456/94788736c335cb520174](https://gist.github.com/Niranjan123456/94788736c335cb520174)

Please let me to know how to do this???

Regards,

---

<div class="post-metadata">

**Author:** ![jnizet](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/jnizet/32/123_2.png) [@jnizet](https://discuss.gradle.org/u/jnizet)\
**Post date:** [September 5, 2015, 1:51pm UTC](https://discuss.gradle.org/t/to-create-jars-before-compilation/11478/2 "2015-09-05T13:51:27Z")

</div>

I’m not sure I understand what you’re asking. The snippet your posted configures the surefire plugin to not run tests by default and to ignore test failures. It has nothing to do with producing a jar file.

Regarding the question itself, given that a jar file contains compiled class files, how could gradle produce a jar file before compiling source files?

Regardless of your pom.xml, what are you trying to achieve?

---

<div class="post-metadata">

**Author:** ![Niranjan123456](https://avatars.discourse-cdn.com/v4/letter/n/a88e57/32.png) [@Niranjan123456](https://discuss.gradle.org/u/Niranjan123456)\
**Post date:** [September 9, 2015, 6:59am UTC](https://discuss.gradle.org/t/to-create-jars-before-compilation/11478/3 "2015-09-09T06:59:38Z")

</div>

Sorry for the incorrect way of asking question.

I wanted to create a fatJar and got to know about the same through the documentation.

Second thing is, there are few customized plugins present in the current project.

I would like to know how will I write them in Gradle i.e. passing arguments to those plugins, using the result of that etc…

I have copied the segment of the earlier question in the below link.  
Please let me know how to do the same.

[https://gist.github.com/Niranjan123456/02b36682eed351cfe430](https://gist.github.com/Niranjan123456/02b36682eed351cfe430)

Regards,
