M2_HOME removed from env variable

I have this step on my flow which is no longer working

      - name: Install takari
        run: |
          wget -P $M2_HOME/lib/ext https://repo1.maven.org/maven2/io/takari/aether/takari-local-repository/0.11.3/takari-local-repository-0.11.3.jar
          wget -P $M2_HOME/lib/ext https://repo1.maven.org/maven2/io/takari/takari-filemanager/0.8.3/takari-filemanager-0.8.3.jar
          wget -P $M2_HOME/lib/ext https://repo1.maven.org/maven2/io/takari/maven/takari-smart-builder/0.6.1/takari-smart-builder-0.6.1.jar

the failure due to the M2_HOME is not present

/lib/ext: Permission denied
/lib/ext/takari-local-repository-0.11.3.jar: No such file or directory

Do you have any alternative to it? do we have to setup maven as we do for java?
you can check the whole flow here droolsjbpm-knowledge/pull_request.yml at 857f296ace7041adb3a6774e3fc6bb253ed3616e · kiegroup/droolsjbpm-knowledge · GitHub

There’s nothing in your workflow that’d set the M2_HOME environment variable. I see two options here:

  • Use a Maven command to download those packages. It should be able to figure out where they are supposed to go.
  • Set M2_HOME yourself, either statically or dynamically.

@airtower-luna I know the M2_HOME var is/was not set, but it was working until yesterday, so I guess the nodes have a different configuration now. I set it for now and it’s working BXMSPROD-1214 Install takari error workaround by Ginxo · Pull Request #1595 · kiegroup/droolsjbpm-build-bootstrap · GitHub
We can’t follow maven command since those are extension libraries and they should go to $M2_HOME/lib/ext.
Thanks anyway!

1 Like

@airtower-luna we have found a better solution here

which is basically to specify the extensions you need on the .mvn/extensions.xml file


1 Like