Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

215
Visualizações
Maven How to show warnings of codes when compiling

I'm using maven to build a new project. There are some warnings in my codes which are underlined by yellow line. I wish maven could report these warnings in console. How can I accomplish that? Can I just add some parameters in the command such as mvn -XXX clean compile?

about 4 years ago · Santiago Trujillo
3 Respostas
Responde à pergunta

0

<showDeprecation>
Sets whether to show source locations where deprecated APIs are used.

  • Default value is: false
  • User property is: maven.compiler.showDeprecation

<showWarnings>
Set to true to show compilation warnings.

  • Default value is: false
  • User property is: maven.compiler.showWarnings

-- Maven Doku

As simple as mvn clean install -Dmaven.compiler.showDeprecation=true -Dmaven.compiler.showWarnings=true all in one line.

You could even remove the =true part because, when you add a maven parameter with -D it automatically sets its value to true, if not set to something else.

about 4 years ago · Santiago Trujillo Relatório

0

With maven 3.3.9, using the maven-compiler-plugin and Java 1.8, you need a <configuration> section like the following:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.8.0</version>
    <executions>
        <execution>
            <id>compile</id>
            <phase>compile</phase>
            <goals>
                <goal>compile</goal>
            </goals>
        </execution>
        <execution>
            <id>testCompile</id>
            <phase>test-compile</phase>
            <goals>
                <goal>testCompile</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <compilerArgument>-Xlint:all</compilerArgument>
        <showWarnings>true</showWarnings>
        <showDeprecation>true</showDeprecation>
    </configuration>
</plugin>

I got this answer from here when none of the above worked for me: http://frequal.com/java/EnableWarningsInMaven.html

about 4 years ago · Santiago Trujillo Relatório

0

I am guessing you are using the compiler plugin. Have you tried this?

about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda