Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

S2I_SOURCE_DEPLOYMENTS_FILTER does not support sub-directories #336

Open
vorburger opened this issue Apr 10, 2019 · 11 comments
Open

S2I_SOURCE_DEPLOYMENTS_FILTER does not support sub-directories #336

vorburger opened this issue Apr 10, 2019 · 11 comments

Comments

@vorburger
Copy link

https://github.com/jboss-container-images/openjdk/issues/75

@jmtd
Copy link
Collaborator

jmtd commented Apr 11, 2019

text from that issue:

While working on quarkusio/quarkus-quickstarts#81, I'm using:

ARTIFACT_COPY_ARGS=-p -r lib/ *-runner.jar

seeing this:

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.

I've therefore attempted to use S2I_SOURCE_DEPLOYMENTS_FILTER instead of ARTIFACT_COPY_ARGS like this:

S2I_SOURCE_DEPLOYMENTS_FILTER=*-runner.jar lib/*.jar

as, according to https://github.com/jboss-openshift/cct_module/blob/master/jboss/container/s2i/core/api/README.adoc (which is somewhat hard to find BTW, see #74), it's a "Space separated list of filters to be applied when copying deployments." ...

INFO Copying deployments from target to /deployments...
'/tmp/src/target/quarkus-quickstart-1.0-SNAPSHOT-runner.jar' -> '/deployments/quarkus-quickstart-1.0-SNAPSHOT-runner.jar'
Build completed successfully

... but this does not work. Upon investigating this, I found that it does not actually copy the lib/*.jar (only *-runner.jar) - I'm guessing that S2I_SOURCE_DEPLOYMENTS_FILTER does not support sub-directories? It should.

@jmtd
Copy link
Collaborator

jmtd commented May 15, 2019

@vorburger did you also specify MAVEN_S2I_ARTIFACT_DIRS at the same time as S2I_SOURCE_DEPLOYMENTS_FILTER? I wonder whether the former on its own would be sufficient (the filter probaly defaults to *jar) but I have not tested it yet.

I've started trying to trace down precisely why we are claiming ARTIFACT_COPY_ARGS is deprecated. The deprecation warning was brought in with the massive refactoring in 1ff1d96, which unfortunately makes tracing why it was introduced a bit trickier (I was hoping that I could git blame myself to a JIRA issue number). That commit also introduced S2I_SOURCE_DEPLOYMENTS_FILTER and MAVEN_S2I_ARTIFACT_DIRS.

This is also relevant: https://issues.jboss.org/browse/CLOUD-3126 ("The openjdk18-openshift image has a bug when dealing with multi module maven projects") which appears on the surface to be the same problem.

@pilhuhn
Copy link

pilhuhn commented Jan 8, 2020

Has this been solved meanwhile? If so: how?

@cescoffier
Copy link

Same here? We are facing the same issue in Quarkus. Any ETA?

@pilhuhn
Copy link

pilhuhn commented Jan 28, 2020

This is what we do now:

    - name: MAVEN_S2I_ARTIFACT_DIRS
       value: external/target
     - name: SCRIPT_DEBUG
       value: "true"
     - name: S2I_SOURCE_DEPLOYMENTS_FILTER
       value: '*.jar lib'

The script_debug is technically not needed, but extremely helpful when having those kinds of issues. external/ is the dir, where in our multi-mvn-project build the final artifacts are put.

@cescoffier
Copy link

Thanks @pilhuhn !
So you replaced ARTIFACT_COPY_ARGS with S2I_SOURCE_DEPLOYMENTS_FILTER and MAVEN_S2I_ARTIFACT_DIRS.

@pilhuhn
Copy link

pilhuhn commented Jan 28, 2020

@cescoffier Yes

@cescoffier
Copy link

cescoffier commented Jan 29, 2020

Thanks for the help @pilhuhn

If someone is looking for the Quarkus version, here it is. In the .s2i/environment file, you need:

MAVEN_S2I_ARTIFACT_DIRS=target
S2I_SOURCE_DEPLOYMENTS_FILTER=*-runner.jar lib
JAVA_OPTIONS=-Dquarkus.http.host=0.0.0.0
AB_JOLOKIA_OFF=true

@brunobaiano
Copy link

With this new quarkus version, i can´t use this command. Someone can help?

this works
ARTIFACT_COPY_ARGS=-r quarkus-app/*

@jmtd
Copy link
Collaborator

jmtd commented May 7, 2021

Which quarkus version exactly are you using -- 1.13.3.Final or something else? Here's a working set of environment variables as specified for the getting-started quickstart for 1.13.3.Final:

MAVEN_S2I_ARTIFACT_DIRS=target/quarkus-app
S2I_SOURCE_DEPLOYMENTS_FILTER=app lib quarkus quarkus-run.jar
JAVA_OPTIONS=-Dquarkus.http.host=0.0.0.0

I think the above variables should work for any Quarkus version since the switch to "fast-jar" build layout by default.

@brunobaiano
Copy link

Thanks! this works for me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants