Build a CPB heading-link-icon

You can build a CPB from your CPK files using one of the following:

To build a CPB using Gradle:

  1. Add the CPB plugin to your project by adding the following to the start of the build.gradle file of your CorDapp Corda Distributed Application. A Java (or any JVM targeting language) application built using the Corda build toolchain and CorDapp API to solve some problem that is best solved in a decentralized manner. Gradle project:

    plugins {
        id 'net.corda.plugins.cordapp-cpb2'
    }
    
  2. To sign your CPB, add a cordapp/signing section to the project settings.gradle file.

  3. Run the cbp Gradle task:

    ./gradlew cpb
    

To build a CPB using the Corda CLI A command line tool that supports various Corda-related tasks, including Corda Package Installer (CPI) creation and Corda cluster management. :

  1. Generate a code signing key. For example:

    keytool -genkeypair -alias "<key-alias>" -keystore <signingkeys.pfx> -storepass "<keystore-password>" -dname "cn=<CPI Plugin Example - Signing Key 1, o=R3, L=London, c=GB>" -keyalg <RSA> -storetype <pkcs12> -validity <4000>
    
  2. Use the Corda CLI package command, specifying the CPK files, the name, version, and file name of the CPB, and the details of the signing key:

    ./corda-cli.sh package create-cpb \
     <mycpk0.jar> <mycpk1.jar> \
     --cpb-name <manifest-attribute-cpb-name> \
     --cpb-version <manifest-attribute-cpb-version> \
     --file <output.cpb> \
     --keystore <signingkeys.pfx> \
     --storepass <"keystore password"> \
     --key <"signing key 1">
    
     ./corda-cli.cmd package create-cpb `
     <mycpk0.jar> <mycpk1.jar> `
     --cpb-name <manifest-attribute-cpb-name> `
     --cpb-version <manifest-attribute-cpb-version> `
     --file <output.cpb> `
     --keystore <signingkeys.pfx> `
     --storepass <"keystore password"> `
     --key <"signing key 1">
    

    For more information about the Corda CLI package command, see the Corda CLI Reference section.

Was this page helpful?

Thanks for your feedback!

Chat with us

Chat with us on our #docs channel on slack. You can also join a lot of other slack channels there and have access to 1-on-1 communication with members of the R3 team and the online community.

Propose documentation improvements directly

Help us to improve the docs by contributing directly. It's simple - just fork this repository and raise a PR of your own - R3's Technical Writers will review it and apply the relevant suggestions.

We're sorry this page wasn't helpful. Let us know how we can make it better!

Chat with us

Chat with us on our #docs channel on slack. You can also join a lot of other slack channels there and have access to 1-on-1 communication with members of the R3 team and the online community.

Create an issue

Create a new GitHub issue in this repository - submit technical feedback, draw attention to a potential documentation bug, or share ideas for improvement and general feedback.

Propose documentation improvements directly

Help us to improve the docs by contributing directly. It's simple - just fork this repository and raise a PR of your own - R3's Technical Writers will review it and apply the relevant suggestions.