Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

build failing when running yarn.cmd from maven pom

Socdaal20
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 5, 2018

I have a multi module project with maven that builds and the front end and puts it to the jar,  but when maven gets to running running the yarn.cmd I am getting the below error:

 

[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.5.0:exec (exec-yarn-install) on project *******: Command execution failed. Cannot run program "yarn.cmd" (in directory "/opt/atlassian/pipelines/agent/build/*******"): error=2, No such file or directory -> [Help 1]org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.5.0:exec (exec-yarn-install) on project : Command execution failed.	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)

I am using 

image: atlassian/default-image:2

 

 

Here is my pom:

<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>obj-uptodate</id>
<goals>
<goal>uptodate-property</goal>
</goals>
<configuration>
<name>build.script</name>
<value>skip</value>
<else>prod</else>
<fileSet>
<directory>${project.basedir}/src</directory>
<outputDirectory>${project.basedir}/target/classes/static}</outputDirectory>
<includes>
<include>*/**</include>
</includes>
<mapper>
<type>merge</type>
<from>*.*</from>
<to>index.html</to>
</mapper>
</fileSet>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>exec-yarn-install</id>
<phase>initialize</phase>
<configuration>
<executable>yarn.cmd</executable>
<arguments>
<argument>install</argument>
<argument>--production=false</argument>

</arguments>
</configuration>
<goals>
<goal>exec</goal>
</goals>
</execution>
<execution>
<id>exec-npm-build</id>
<phase>compile</phase>
<configuration>
<executable>npm.cmd</executable>
<arguments>
<argument>run</argument>
<argument>build:${build.script}</argument>
<argument>--</argument>
<argument>--output-path=target/classes//static</argument>
</arguments>
</configuration>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
</plugin>
image: atlassian/default-image:2

 

1 answer

0 votes
Darin Hafer July 12, 2024

You might try running 'which yarn' at your command line to be sure you have it installed. Then, remove the .cmd and try this:

                <executable>yarn</executable>

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events