1

I have a question connecting maven version 3.6, exec-maven-plugin version 1.6.0, npm version 6.13.4

Plugin definition in my pom.xml file look like this

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>1.6.0</version>
        <executions>
          <execution>
            <id>exec-npm-install</id>
            <phase>generate-sources</phase>
            <configuration>
              <executable>npm</executable>
              <workingDirectory>../my-frontend-app</workingDirectory>
              <arguments>
                <argument>run</argument>
                <argument>build</argument>
              </arguments>
            </configuration>
            <goals>
              <goal>exec</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

Thank's to this plugin I'm able to run npm run build during my maven build.

I have problem with is passing additional argument to my npm build using this plugin. I would like to pass application version from pom.xml to my-frontend-app during maven build.

Can any body help me with this?

Piotr Żak
  • 2,083
  • 6
  • 29
  • 42
  • 1
    if you will add more arguments, e.g `arg1` it will run `npm run build arg2` .What is your desired npm command? – Yuri G. Dec 22 '19 at 04:20
  • an example would be `...{ ...,"scripts": { ..., "docker:tag": "image:latest image:1.6.0", ... },... }...` The question is how to read the version from `pom.xml` programmatically for npm-script `docker:tag` ? –  Jun 03 '20 at 18:02

0 Answers0