0

mvn compile can't find the autogenerated clases in the compiled dar file with version 0.12.24

I have created a smart contract with DAML where with version 0.12.20 if you executed mvn compile works and generate the clases correctly.

When upgrading to version 0.12.24 where some bug has been fixed in DAML the mvn compile can't find the clases generated in the file.dar i.e:

[ERROR] /Users/Pablo/Documents/everis/projects/PoC/stampchain-daml-app/src/main/java/com/digitalasset/quickstart/stampcontract/StampContractMain.java:[10,55] package com.digitalasset.quickstart.model.stampcontract does not exist

To assure it was not an issue in my code I've create a new quickstarter project and try the same getting the same error where maven can't compile from the dar. steps:

  1. daml new quickstart quickstart-java
  2. cd quickstart
  3. daml build
  4. mvn compile

The output

[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:java (daml-codegen-java) on project daml-quickstart-java: An exception occured while executing the Java class. Input file '/Users/Pablo/Downloads/DAML/tempquickstarter/quickstart/target/daml/iou.dar' doesn't exist -> [Help 1]

if you try the same with the sdk version 0.12.20 works and generate the java.

1 Answers1

0

By default daml build generates the dar file in dist/<projectname>.dar so for your example it will create dist/quickstart.dar. However, the codegen in the quickstart example is setup to expect the dar in target/daml/iou.dar. You can pass -o target/daml/iou.dar to change the output location so the full command is daml build -o target/daml/iou.dar. This is also the command used in the quickstart guide. I hope that helps!

cocreature
  • 801
  • 5
  • 5