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
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>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.