Finally, add the following to `build.gradle` file:
```groovy
import dev.firstdark.keymaster.tasks.SignJarTask
// Register a custom task to sign your jar
tasks.register('signJar', SignJarTask) {
// Depend on the task used to build your project
dependsOn jar
// The input artifact. This can be a Task, File or File Name
artifactInput = jar
// Optional. Set the output name of the signed jar. This defaults to the artifactInput file name, and will overwrite it
outputFileName = "testsign"
// The password of your key
keyPass = "123456"
// Your key alias
keyStoreAlias = "testalias"
// Your keystore password
keyStorePass = "123456"
// Your keystore location
keyStore = "/home/hypherionsa/dummystore.jks"
}
// Example of signing another jar
tasks.register('signDummyJar', SignJarTask) {
dependsOn createDummyJar
artifactInput = createDummyJar
keyPass = "123456"
keyStoreAlias = "testalias"
keyStorePass = "123456"
keyStore = "/home/hypherionsa/dummystore.jks"
}
```
That's all there is to it. You can use this custom task as an input for maven publishing, [modpublisher](https://github.com/firstdarkdev/modpublisher) or any other task that takes in a file
</details>
<details><summary>Kotlin DSL</summary>
To use this plugin inside your project, first you have to add our maven.
To do this, open up `settings.gradle.kts` and add the following:
id("com.hypherionmc.modutils.modpublisher") version "VERSION"
}
```
Replace VERSION with the version above.
Finally, add the following to `build.gradle.kts` file:
```kotlin
import dev.firstdark.keymaster.tasks.SignJarTask
import org.gradle.kotlin.dsl.register
// Register a custom task to sign your jar
val signJar by tasks.register<SignJarTask>("signJar") {
// Depend on the task used to build your project
dependsOn(tasks.jar)
// The input artifact. This can be a Task, File or File Name
artifactInput = tasks.jar
// Optional. Set the output name of the signed jar. This defaults to the artifactInput file name, and will overwrite it
outputFileName = "testsign"
// The password of your key
keyPass = "123456"
// Your key alias
keyStoreAlias = "testalias"
// Your keystore password
keyStorePass = "123456"
// Your keystore location
keyStore = "/home/hypherionsa/dummystore.jks"
}
// Example of signing another jar
val signDummyJar by tasks.register<SignJarTask>("signDummyJar") {
dependsOn(tasks.createDummyJar)
artifactInput = tasks.createDummyJar
keyPass = "123456"
keyStoreAlias = "testalias"
keyStorePass = "123456"
keyStore = "/home/hypherionsa/dummystore.jks"
}
```
That's all there is to it. You can use this custom task as an input for maven publishing, [modpublisher](https://github.com/firstdarkdev/modpublisher) or any other task that takes in a file
</details>
***
If you need any other help, open an issue, or visit us on [Discord](https://discord.firstdark.dev)