ci.maven icon indicating copy to clipboard operation
ci.maven copied to clipboard

Dev mode should run plugins bound to a "phase" rather than a "goal"

Open kathrynkodama opened this issue 3 years ago • 3 comments

Rather than dev mode calling the maven-compiler-plugin directly on startup, it should call all plugins associated with the compile phase.

For example, users can specify an additional source directory with the build-helper-maven-plugin:

  <plugin>
      <groupId>org.codehaus.mojo</groupId>
      <artifactId>build-helper-maven-plugin</artifactId>
      <version>3.0.0</version>
      <executions>
          <execution>
              <phase>generate-sources</phase>
              <goals>
                  <goal>add-source</goal>
              </goals>
              <configuration>
                  <sources>
                      <source>src/main/java2</source>
                  </sources>
              </configuration>
          </execution>
      </executions>
  </plugin>

Running mvn compile will compile any files in the second source directory, but liberty:dev will not. Dev mode should pick up the build-helper-maven-plugin and any other plugins bound to specific phases.

kathrynkodama avatar Jul 21 '21 20:07 kathrynkodama

That's interesting.. it could turn into a whole feature depending on how it's scoped.

E.g. do we mean goals bound to compile phase specifically or up to compile phase in the lifecycle? Why compile phase and not test-compile ? Why not go all the way to post-integration-test phase? Would this be configurable via liberty-maven-plugin config?

scottkurz avatar Jul 21 '21 20:07 scottkurz

I suppose we will have to think about the scope a bit more. I included the compile phase as an example, perhaps we will have to investigate further and decide which phases make the most sense to support.

cc: @ericglau

kathrynkodama avatar Jul 21 '21 21:07 kathrynkodama

I would love to see this supported, preferably with a configurable maven life cycle phase. My current use case is with code generated for jaxws/xmlws services.

m-schutte-ohra-nl avatar Jun 18 '23 14:06 m-schutte-ohra-nl