1

I am trying to use maven-release-plugin to publish npm packages. For this I am using frontend-maven-plugin. The release itself is working well using, except when the maven-release-plugin is transforming the pom.xml version to the next development iteration X.X.X-SNAPSHOT.

For this I want to be able to execute a specific execution id by specifying goal in mvn.

More specifically I am trying to run a goal from frontend-maven-plugin with a specific configuration from the <completionGoals> tag in maven-release-plugin, in order to keep the pom.xml file and package.json versions in sync after the release process.

In the example below I am trying to use the @ symbol to explicitly specify which execution I want to execute in the goal (the "setversion" execution) , but that does not seem to work, I get “Could not find goal 'npm@setversion'” error during the release. I have tried to use parameters directly in the goal specification but without any success.

Any ideas?

<plugins>
  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-release-plugin</artifactId>             
      <configuration>
        <releaseProfiles>gui-komponent-release</releaseProfiles>
        <completionGoals>com.github.eirslett:frontend-maven plugin:npm@setversion</completionGoals>
      </configuration>              
  </plugin>         
  <plugin>
    <groupId>com.github.eirslett</groupId>
    <artifactId>frontend-maven-plugin</artifactId>
    <version>1.2</version>
    <executions>
      <execution>
        <id>setversion</id>                     
        <goals>
          <goal>npm</goal>
        </goals>
        <phase /> 
        <configuration>                         
          <arguments>version ${project.version}</arguments>
        </configuration>
     </execution>
   ...
  • As far as I know the @id syntax is currently only supported from command in Maven but not in release plugin... – khmarbaise Nov 24 '16 at 09:31
  • @khmarbaise you mean that @ id syntax is only available from command line in Maven? Do you kno if there is any other way of executing a specific execution from the pom.xml in Maven? – Raggi Steinsen Nov 24 '16 at 09:54
  • Yes that's what I mean. The question is why do you need a particular execution with an id during the release? – khmarbaise Nov 24 '16 at 11:25
  • Because I only want to execute this command once at this particular time during the release. I'm not sure that using execution id is the correct way to do this, but what I need to do is to specify to just execute this particular execution in the defined configuration. – Raggi Steinsen Nov 24 '16 at 11:49
  • You can use a release profile cause you already have set one. So you can use the profile and don't need to use the `@Id`... – khmarbaise Nov 24 '16 at 14:37
  • The release profile is only activated _during_ the release, what I want to do is execute the execution id _after_ the release. – Raggi Steinsen Nov 25 '16 at 07:22
  • That sounds more like a job for CI solution like Jenkins within a pipeline etc. Apart from that `completionGoals` are running after the `release:prepare` step...which sounds like it's wrong based on your comments. – khmarbaise Nov 26 '16 at 11:26

0 Answers0