Solucionado (ver solução)
Solucionado
(ver solução)
2
respostas

O arquivo pmd.html não é gerado

Senhores, o arquivo pmd.html não é gerado após executar mvn pmp:pmp mesmo com o plugin informado no pom junto com o executions. Estou aplicando isso em um dos projetos que tenho. Este projeto funciona como um container para outros submodulos dos sistemas onde adiciono os jars e jsps desses módulos. Vejam o pom.xml

<?xml version="1.0" encoding="utf-8"?>
<project
    xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>


    <groupId>br.com.software</groupId>
    <artifactId>sistema</artifactId>

    <version>2.5.23</version>

    <packaging>war</packaging>

    <name>sistema.war</name>
    <url>http://xxx</url>
    <description>Arquivos do WAR do sistema</description>

    <organization>
        <name>sistema home office</name>
        <url>http://xxx</url>
    </organization>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.4</version>
                <configuration>
                    <warName>sistema</warName>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                    <webXml>WEB-INF/web.xml</webXml>
                    <includeEmptyDirectories>true</includeEmptyDirectories>
                    <detail>true</detail>
                    <includeEmptyDirectories>true</includeEmptyDirectories>
                    <detail>true</detail>
                    <archive>
                        <forced />
                        <index />
                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                        </manifest>
                    </archive>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>war</goal>
                        </goals>
                        <configuration>
                            <includeEmptyDirectories>true</includeEmptyDirectories>
                            <webResources>
                                <resource>
                                    <directory>app</directory>
                                    <targetPath>app</targetPath>
                                </resource>
                                <resource>
                                    <directory>arquivo</directory>
                                    <targetPath>arquivo</targetPath>
                                </resource>
                                <resource>
                                    <directory>fonts</directory>
                                    <targetPath>fonts</targetPath>
                                </resource>
                                <resource>
                                    <directory>images</directory>
                                    <targetPath>images</targetPath>
                                </resource>
                                <resource>
                                    <directory>js</directory>
                                    <targetPath>js</targetPath>
                                </resource>
                                <resource>
                                    <directory>js-bs</directory>
                                    <targetPath>js-bs</targetPath>
                                </resource>
                                <resource>
                                    <directory>jsp</directory>
                                    <targetPath>jsp</targetPath>
                                </resource>
                                <resource>
                                    <directory>properties</directory>
                                    <targetPath>properties</targetPath>
                                </resource>
                                <resource>
                                    <directory>struts</directory>
                                    <targetPath>struts</targetPath>
                                </resource>
                                <resource>
                                    <directory>styles-bs</directory>
                                    <targetPath>styles-bs</targetPath>
                                </resource>
                                <resource>
                                    <directory>styles</directory>
                                    <targetPath>styles</targetPath>
                                </resource>
                                <resource>
                                    <directory>tinymce</directory>
                                    <targetPath>tinymce</targetPath>
                                </resource>
                                <resource>
                                    <directory>tld</directory>
                                    <targetPath>tld</targetPath>
                                </resource>
                                <resource>
                                    <directory>WEB-INF</directory>
                                    <targetPath>WEB-INF</targetPath>
                                </resource>
                                <resource>
                                    <directory>.</directory>
                                    <includes>
                                        <include>*.html</include>
                                        <include>*.jsp</include>
                                    </includes>
                                </resource>
                            </webResources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-pmd-plugin</artifactId>
                <version>3.6</version>
                <executions>
                    <execution>
                        <phase>verify</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>1.7</version>
                <configuration>
                  <sources>
                    <source>${basedir}/jsp</source>
                  </sources>
                </configuration>
                <executions>
                  <execution>
                    <goals>
                      <goal>add-source</goal>
                    </goals>
                  </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <reporting>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-pmd-plugin</artifactId>
            <version>3.6</version>
            <configuration>
              <language>jsp</language>
              <rulesets>
                <ruleset>jsp-basic</ruleset>
              </rulesets>
              <includes>
                <include>**/*.jsp</include>
              </includes>
            </configuration>
          </plugin>

          <plugin>
          <groupId>org.jacoco</groupId>
          <artifactId>jacoco-maven-plugin</artifactId>
          <executions>
              <execution>
                  <goals>
                      <goal>prepare-agent</goal>
                      <goal>report</goal>
                  </goals>
              </execution>
          </executions>
        </plugin>
        </plugins>
    </reporting>
</project>
2 respostas
solução!

Bom dia Luan,

Testa primeiro diretamente nos submodulos para ver se esta funcionando ?Assim voce consegue isolar o problema.

Voce tambem pode olhar a mensagem de log para conferir se ele está pelo menos tentando rodar o PMD, e se sim, em qual projeto (base ou submodulo)

[]

Eu observei que quando você resolve tudo, ele não gera relatório. Pra forçar a criação do pmd.html na pasta site, deixe um "erro" na aplicação pro PMD apontar.

Abraços

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software