This is a common issue in pipelines these days, and you're absolutely right that simply putting JAR files into the repo isn't the best way forward. There are a few solutions to this, and some examples online for some of the techniques (some of which may depend on using ACE v12).
One solution that fits quite well into the open-source Java world is to switch the ACE Java projects to use Maven, and then use Maven to build the projects in the pipeline. The Eclipse Maven integration is quite good, so the toolkit builds would pick up any options provided to Maven in the pom.xml files, pull in dependencies, etc, so the developers can be reasonably sure their local builds match the pipeline builds. Maven can also be used to run the ACE commands to build applications, populate work directories, etc.
https://github.com/ot4i/ace-demo-pipeline shows this approach (amongst other thing), showing an application with Java projects, Maven builds, Tekton pipelines, GitHub Actions, etc, and also includes unit testing as part of the pipeline (v12 only).
Another solution for v12 is to use the "
ibmint" command to build and package the applications:
ibmint will compile Java projects and is intended to provide a non-toolkit way to build everything mqsicreatebar can build.
ibmint can be run from pretty much any build system, and a Gradle example is shown at
https://github.com/ot4i/ace-demo-pipeline/blob/master/build.gradle with projects being built and unit-tested. This is in addition to the Maven build setup in the same repo, and is there to show an alternative approach.
As you say, you could also run javac and jar from a script and build that way, but tools like Maven and Gradle are often preferable as they are built for that purpose. Mixing and matching, with Maven/Gradle/Ant building the Java libraries and mqsipackagebar building the applications and packaging them, is another similar way to go.
It's also possible (though not ideal) to run mqsicreatebar in a container, and build that way. See
https://github.com/tdolby-at-uk-ibm-com/ace-docker/tree/master/experimental/ace-full for a container that will allow this, but be aware it will be quite large!
Hope this helps - more info available if needed.