You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@beam.apache.org by Mark Liu <ma...@google.com.INVALID> on 2017/05/04 06:05:46 UTC

Seeking help for running bash script in Maven

Hi,

I'm working on bringing Java build cross JDK versions to Jenkins. However,
I get stuck on BEAM-2164
<https://issues.apache.org/jira/browse/BEAM-2164> which
is running bash script failed though exec-maven-plugin. In order to have
cross-JDK builds on Jenkins, project directory contains space characters,
which breaks this bash script
<https://github.com/apache/beam/blob/master/sdks/java/maven-archetypes/examples/generate-sources.sh>
when
building beam-sdks-java-maven-archetypes-examples module.

I got following error log from build
<https://builds.apache.org/job/beam_PostCommit_Java_JDK_Versions_Test/jdk=JDK%201.8%20(latest),label=beam/6/console>
:

rsync: change_dir
> "/home/jenkins/jenkins-slave/workspace/beam_PostCommit_Java_JDK_Versions_Test/jdk\#012.\#012(latest)/label/beam/sdks/java/maven-archetypes/examples/../../../../examples/java/src/main/java/org/apache/beam/examples"
> failed: No such file or directory (2)


The problem happens in executing "mkdir -p "${ARCHETYPE_ROOT}/src/main/java"
". ${ARCHETYPE_ROOT} contains space character and the directory isn't
created. I run the script through commandline (without using mvn) and it
works perfectly. Looks like exec-maven-plugin handles this situation in
different ways, but I'm not the expert of Maven and play around commands in
the script doesn't help.

Currently I totally have no ideas. I'll be very appreciate if anyone can
provide some hint.

Thanks!
Mark

Re: Seeking help for running bash script in Maven

Posted by Davor Bonaci <da...@apache.org>.
I don't believe this has anything to do with Maven. Maven isn't passing any
arguments to the script, or anything similar.

Script's location is figured out here:
HERE="$(dirname $0)"

and then used to like this:
ARCHETYPE_ROOT="${HERE}/src/main/resources/archetype-resources"
mkdir -p "$ARCHETYPE_ROOT/src/main/java"

This sounds like a bash issue, which you should be able to reproduce
locally with a similarly-named directory.

Hope this helps.

Davor

On Wed, May 3, 2017 at 11:05 PM, Mark Liu <ma...@google.com.invalid>
wrote:

> Hi,
>
> I'm working on bringing Java build cross JDK versions to Jenkins. However,
> I get stuck on BEAM-2164
> <https://issues.apache.org/jira/browse/BEAM-2164> which
> is running bash script failed though exec-maven-plugin. In order to have
> cross-JDK builds on Jenkins, project directory contains space characters,
> which breaks this bash script
> <https://github.com/apache/beam/blob/master/sdks/java/
> maven-archetypes/examples/generate-sources.sh>
> when
> building beam-sdks-java-maven-archetypes-examples module.
>
> I got following error log from build
> <https://builds.apache.org/job/beam_PostCommit_Java_JDK_
> Versions_Test/jdk=JDK%201.8%20(latest),label=beam/6/console>
> :
>
> rsync: change_dir
> > "/home/jenkins/jenkins-slave/workspace/beam_PostCommit_
> Java_JDK_Versions_Test/jdk\#012.\#012(latest)/label/beam/
> sdks/java/maven-archetypes/examples/../../../../examples/
> java/src/main/java/org/apache/beam/examples"
> > failed: No such file or directory (2)
>
>
> The problem happens in executing "mkdir -p "${ARCHETYPE_ROOT}/src/main/
> java"
> ". ${ARCHETYPE_ROOT} contains space character and the directory isn't
> created. I run the script through commandline (without using mvn) and it
> works perfectly. Looks like exec-maven-plugin handles this situation in
> different ways, but I'm not the expert of Maven and play around commands in
> the script doesn't help.
>
> Currently I totally have no ideas. I'll be very appreciate if anyone can
> provide some hint.
>
> Thanks!
> Mark
>