question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

antlr4-maven-plugin ignored when using `quarkus:dev`

See original GitHub issue

Describe the bug

in a Quarkus application, I also applied the org.antlr:antlr4-maven-plugin. When I issue mvn clean quarkus:dev the plugin default behaviour is ignored. I even tried to specify as:

      <plugin>
        <groupId>org.antlr</groupId>
        <artifactId>antlr4-maven-plugin</artifactId>
        <version>${antlr4.version}</version>
        <executions>
          <execution>
            <phase>generate-sources</phase>
            <goals>
              <goal>antlr4</goal>
            </goals>

to be explicit, but it is still ignored. To have it working, I need to mvn clean generate-sources quarkus:dev.

Please notice if I issue the mvn clean install or mvn clean package the plugin is accounted for execution as normal.

This application can be used as reproducer: https://github.com/tarilabs/quarkus-aytb/blob/main/pom.xml#L89-L97

Expected behavior

Checkout https://github.com/tarilabs/quarkus-aytb

mvn clean quarkus:dev I was expected to be working fine.

Actual behavior

mvn clean quarkus:dev will fail as the Antlr generation from Grammar to Java Source files is ignored.

I need to explicit generate-sources in : mvn clean generate-sources quarkus:devto have it actually working.

It’s not clear why, since every maven based app using org.antlr:antlr4-maven-plugin would have mvn clean compile mvn clean install working in the generate-sources out of the box.

How to Reproduce?

see “expected behaviour” for steps to reproduce.

Output of uname -a or ver

20.6.0 Darwin Kernel Version 20.6.0: Mon Aug 30 06:12:21 PDT 2021; root:xnu-7195.141.6~3/RELEASE_X86_64 x86_64

Output of java -version

openjdk version “11.0.7” 2020-04-14 OpenJDK Runtime Environment (build 11.0.7+10) OpenJDK 64-Bit Server VM (build 11.0.7+10, mixed mode)

GraalVM version (if different from Java)

No response

Quarkus version or git rev

Quarkus 2.3.0.Final

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.8.3 (ff8e977a158738155dc465c6a97ffaf31982d739)

Additional information

I am available if further information is needed. Thanks in advance!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
famodcommented, Nov 8, 2021

@tarilabs you can mitigate that “limitation” by using a Maven profile with defaultGoals (in which you can put whatever you need). You’d then only pass that profile to mvn, no goals whatsoever.

1reaction
geoandcommented, Nov 8, 2021

Yes, that is correct.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Building Quarkus apps with Gradle
These can be overridden by setting the compilerArgs property in the task. By default, quarkusDev sets the debug host to localhost (for security...
Read more >
Using the Quarkus dev mode for non-Quarkus projects (Video)
The Quarkus dev mode increases our development productivity and especially reduces the turnaround times how long it takes to get test feedback. ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found