I have published my CorDapp (corda contracts, states and flows) project in .m2 directory by using the publish task and command: ./gradlew clean publish
.
Now, when I go into my service project (seperate gradle project) to access the flow classes, I am not able to access the flows.
Also, when I am trying to build the service project, it is giving me the following error:
* What went wrong:
Execution failed for task ':compileJava'.
> Could not resolve all files for configuration ':compileClasspath'.
> Could not find com.template.blockchain.corda:contract-states:SNAPSHOT-0.0.1.
Searched in the following locations:
- file:/C:/Users/.m2/repository/com/template/blockchain/corda/contract-states/SNAPSHOT-0.0.1/contract-states-SNAPSHOT-0.0.1.pom
- https://jcenter.bintray.com/com/template/blockchain/corda/contract-states/SNAPSHOT-0.0.1/contract-states-SNAPSHOT-0.0.1.pom
- https://repo.maven.apache.org/maven2/com/template/blockchain/corda/contract-states/SNAPSHOT-0.0.1/contract-states-SNAPSHOT-0.0.1.pom
- https://ci-artifactory.corda.r3cev.com/artifactory/corda/com/template/blockchain/corda/contract-states/SNAPSHOT-0.0.1/contract-states-SNAPSHOT-0.0.1.pom
- https://jitpack.io/com/template/blockchain/corda/contract-states/SNAPSHOT-0.0.1/contract-states-SNAPSHOT-0.0.1.pom
- https://plugins.gradle.org/m2/com/template/blockchain/corda/contract-states/SNAPSHOT-0.0.1/contract-states-SNAPSHOT-0.0.1.pom
My publish code (code in Cordapp project):
publishing {
publications {
mavenJava(MavenPublication) {
groupId = 'com.template.blockchain.corda'
artifactId = 'contract-states'
version = 'SNAPSHOT-0.0.1'
from components.java
}
}
repositories {
mavenLocal()
}
}
In addition, I have written the compile line to compile the CorDapp jars in service project which are in .m2 directory.
Code:
compile group: 'com.template.blockchain.corda', name: 'contract-states', version: 'SNAPSHOT-0.0.1'