quarkus: Dev mode compiler does not use `-parameters`

Due to the RESTEasy version of @*Param which requires no value and uses the reflection parameter name, we’d ideally like the compiler to default to -parameters but we can’t, so we tell users to set <maven.compiler.parameters>true</...> in their pom.xml.

This setting is ignored by the dev mojo. Similarly the longer configuration is also ignored:

<configuration>
 <parameters>true</parameters>
</configuration>

I’d rather we just always add the -parameters flag to javac, but it would behave differently in dev mode than when generating jar/native, so I think we should respect the user’s config. I can make a PR for this.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 1
  • Comments: 23 (22 by maintainers)

Most upvoted comments

@gsmet It does not, but we in out gradle templates we enable it with

compileJava {
    options.compilerArgs << '-parameters'
}
import java.util.Set;
import java.util.concurrent.CompletionStage;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;

import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;
import org.jboss.resteasy.annotations.jaxrs.PathParam;

@Path("/v2")
@RegisterRestClient
public interface CountriesService {

    @GET
    @Path("/name/{name}")
    @Produces("application/json")
    CompletionStage<Set<Country>> getByName(@PathParam String name);
}

This is enough to see this in the logs:

2019-10-17 11:25:33,723 WARN  [io.qua.resteasy] (build-7) Detected RESTEasy annotation org.jboss.resteasy.annotations.jaxrs.PathParam on method parameter org.acme.CountriesService.getByName with no name. Either specify its name, or tell your compiler to enable debug info (-g) or parameter names (-parameters). This message is only logged for the first such parameter.