0

I am working on a web application with PLAY Framework 2.8.13, Scala and Maven for the back and with React for the front. I am using a script to build the front with maven as follows :

<plugin>
    <artifactId>exec-maven-plugin</artifactId>
    <groupId>org.codehaus.mojo</groupId>
    <executions>
      <execution>
        <id>npm-install</id>
        <phase>generate-sources</phase>
        <goals>
          <goal>exec</goal>
        </goals>
        <configuration>
          <executable>${project.basedir}/install-front.sh</executable>
        </configuration>
      </execution>
    </executions>
</plugin>

When I run my backend server with mvn play2:run the source generation never ends and nothing happens, the console freeze on :

[INFO] --- scala-maven-plugin:4.5.4:script ...

Strangely, when I change the phase generate-source to clean, the error no longer occurs and everything is going well

However I can't use this solution because mvn release bypass clean phase and the compilation fails

Luc E
  • 1,204
  • 8
  • 16
  • You might have a hidden missing dependency for some artifact, Can you try running: `mvn clean generate-sources` - it might show the artifact that cannot resolve it. Usually, `generate-sources` works as long as you have every dependency inside your repo, not near it, but inside. – Alin Gabriel Arhip Jul 01 '22 at 14:42
  • Thanks for you answer, however it didn't work .. I don't know why but there is a conflict between these two plugins and the execution never happen. For the moment I found a solution by skipping exec-maven-plugin with `-Dexec.skip` but I would like to understand why this is happening – Luc E Oct 10 '22 at 09:47

0 Answers0