2

I have a multi-module project with a structure like this:

  • build
    • module
    • module.bom
    • rcp.build
      • module.rcp

Both build projects where separate before and worked. Now that I put them together installAtEnd and deployAtEnd do not work. I added them like this:

    <plugin>
      <artifactId>maven-install-plugin</artifactId>
      <version>2.5.2</version>
      <configuration>
        <installAtEnd>true</installAtEnd>
      </configuration>
    </plugin>
    <plugin>
      <artifactId>maven-deploy-plugin</artifactId>
      <version>2.8.2</version>
      <configuration>
        <deployAtEnd>true</deployAtEnd>
      </configuration>
    </plugin>

I did not configure the plug-ins beyond the above. Still whenever I run the build I get the following log:

[INFO] --- maven-install-plugin:2.5.2:install (default-install) @ module.rcp ---
[INFO] Installing group:module.rcp:0.1.6-SNAPSHOT at end
[INFO] 
[INFO] --- maven-deploy-plugin:2.8.2:deploy (default-deploy) @ module.rcp ---
[INFO] Deploying group:module.rcp:0.1.6-SNAPSHOT at end
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] modules ............................................. SUCCESS [  3.339 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:05 min
[INFO] Finished at: 2019-01-18T12:54:18+01:00
[INFO] ------------------------------------------------------------------------

Maven forgot to install / deploy.

I found this bug and this question, which suggest it might be due to Tycho. So I added the Tycho plug-ins to the parent pom.xml which did nothing. Then I removed the RCP module entirely. Still the same problem.

Now the BOM still has a parent that is not the Maven project "build", and removing it / changing the parent makes the build install and deploy correctly. However since it's a BOM I can't use the "build" parent.

Is there any other way to get installAtEnd and deployAtEnd to work in my project structure?

Stefan S.
  • 3,950
  • 5
  • 25
  • 77
  • This can't be working cause installAtEnd/deployAtEnd won't work correct for different packaging like Tycho. If need a working solution for such cases please take a look at: https://github.com/khmarbaise/maven-deployer-extension – khmarbaise Jan 18 '19 at 12:22
  • @khmarbaise As I said in the question, I removed the Tycho module and the error persisted. In fact, I already know (and stated) the problem is the BOM and its parent POM being different. (And FYI it does work without the BOM but with Tycho.) – Stefan S. Jan 18 '19 at 12:44
  • @khmarbaise But your Maven plug-in still works for the BOM, so thanks. :) – Stefan S. Jan 18 '19 at 13:15

1 Answers1

1

As khmarbaise pointed out, the following Maven extension can be used: https://github.com/khmarbaise/maven-deployer-extension

Note that this approach won't work on a Jenkins, since it doesn't support Maven core extensions. (I'd say "yet", but JENKINS-30058 is a 4 year old blocker bug, so I suppose it's not going to be fixed any time soon.) If the build should work on Jenkins, too, there seems to be no other option than either disabling deployAtEnd and installAtEnd or to remove the second parent POM from the modules.


Today I found another reason for the build to not deploy while maintaining an older project. There was something like this:

        <plugin>
            <groupId>org.apache.felix</groupId>
            <artifactId>maven-bundle-plugin</artifactId>
            <extensions>true</extensions>
        </plugin>

Removing the <extensions> made the project deploy again.

Stefan S.
  • 3,950
  • 5
  • 25
  • 77