Uploaded image for project: 'Thorntail'
  1. Thorntail
  2. THORN-1063

Swarm plugin executs when packaging is pom

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 2017.2.0
    • Fix Version/s: 2017.3.2
    • Component/s: plugins
    • Labels:
      None

      Description

      Hi all,

      Let's say I have two microservices (S1 and S2), each one under a Maven module, both inheriting from the parent pom [1]. As you can see, these services have a swarm profile that uses the swarm plugin [2][3]. These two profiles being identical, I wanted to move it to the parent pom [4]. Unfortunately when I do that (mvn clean install -Pswarm), I get the following exception :

      ERROR] Failed to execute goal org.wildfly.swarm:wildfly-swarm-plugin:2017.2.0:package (package) on project parent: Cannot package without a primary artifact; please `mvn package` prior to invoking wildfly-swarm:package from the command-line

      That's the Swarm plugin not being happy about not having a war file to package[5].

      It would make sense to avoid this check when the packaging is pom (<packaging>pom</packaging>). This way we could aggregate this kind of profile in the parent pom that would only act on the child modules.

      [1] https://github.com/agoncal/agoncal-sample-microservices/tree/master/03-WildflySwarmJAXRS
      [2] https://github.com/agoncal/agoncal-sample-microservices/blob/master/03-WildflySwarmJAXRS/service1/pom.xml#L36
      [3] https://github.com/agoncal/agoncal-sample-microservices/blob/master/03-WildflySwarmJAXRS/service2/pom.xml#L36
      [4] https://github.com/agoncal/agoncal-sample-microservices/blob/master/03-WildflySwarmJAXRS/pom.xml#L214
      [5] https://github.com/wildfly-swarm/wildfly-swarm/blob/master/plugin/src/main/java/org/wildfly/swarm/plugin/maven/PackageMojo.java#L97

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                bob.mcwhirter Bob McWhirter
                Reporter:
                agoncal Antonio Goncalves
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: