-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
None
-
None
A new version of openjdk18-openshift was released today (https://access.redhat.com/containers/?tab=overview#/registry.access.redhat.com/redhat-openjdk-18/openjdk18-openshift) and it looks like it has a bug when dealing with multi module maven projects.
The previously documented solution was to use "ARTIFACT_COPY_ARGS" which we were setting to "*/target" With the latest version of the s2i image, this results in the following warning/error...
WARN ARTIFACT_COPY_ARGS is deprecated. Please use S2I_SOURCE_DEPLOYMENTS_FILTER to specify artifact types and MAVEN_S2I_ARTIFACT_DIRS to specify the build output directories to copy from.
/opt/jboss/container/java/s2i/maven-s2i-overrides: line 44: pushd: /tmp/src/target: No such file or directory
If I set "MAVEN_S2I_ARTIFACT_DIRS" to "*/target" then there are no errors but nothing actually gets copied. Eventually I got it to work by hardcoding the module directories (e.g. "module1/target,module2/target").
I had to trace through all the source code because MAVEN_S2I_ARTIFACT_DIRS seems to be completely undocumented. I eventually found that I had to use commas to separate the list and I also found where the bug is...
Line 94...
if [ -d "${1}/${S2I_SOURCE_DEPLOYMENTS_DIR}" ]; then
This returns false when using "*/target". It does not produce any error or logging but results in a failed image.
I believe the following changes should be made...
1. This code should be changed to support wildcards like it did previously.
2. The documentation for openjdk18-openshift should be updated for MAVEN_S2I_ARTIFACT_DIRS and the deprecation of ARTIFACT_COPY_ARGS.
https://access.redhat.com/documentation/en-us/red_hat_jboss_middleware_for_openshift/3/html/red_hat_java_s2i_for_openshift/reference#configuration_environment_variables
https://docs.openshift.com/online/using_images/s2i_images/java.html"
3. The scripts should log warnings if source artifacts are not found
- is related to
-
OPENJDK-1943 MAVEN_S2I_ARTIFACT_DIRS delimiter is under-documented
- Closed