ReportSets non reconnu dans le pom : build Maven non possible

Résolu
astralangel Messages postés 37 Date d'inscription   Statut Membre Dernière intervention   -  
astralangel Messages postés 37 Date d'inscription   Statut Membre Dernière intervention   -
Bonjour,

Je suis actuellement en train de faire du codage en java pour déployer un jar. Je passe par Maven pour faire mes builds. Bien sur, le fichier POM.xml est indispensable.

J'ai décidé d'ajouter les plugins checkstyle et findbugs pour faire du report après avoir généré le build. Voici la configuration de ces deux plugins dans mon POM :

	<!--rapport checkstyle -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-checkstyle-plugin</artifactId>
				<version>2.15</version>
				<reportSets>
					<reportSet>
						<reports>
							<report>checkstyle</report>
						</reports>
					</reportSet>
				</reportSets>
			</plugin>
			
			<!-- rapport find bugs -->
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>findbugs-maven-plugin</artifactId>
				<version>3.0.0</version>
				<configuration>
					<effort>Max</effort>
					<threshold>Low</threshold>
				</configuration>
				<reportSets>
					<reportSet>
						<reports>
							<report>findbugs</report>
						</reports>
					</reportSet>
				</reportSets> 
			</plugin>


En voulant faire un Maven Clean ou un Maven Install, j'obtiens le message d'erreur suivant :


[INFO] Scanning for projects...
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project prov:prov:0.0.1-SNAPSHOT (C:\Users\FREAKER\workspace\prov\pom.xml) has 1 error
[ERROR] Malformed POM C:\Users\FREAKER\workspace\prov\pom.xml: Unrecognised tag: 'reportPlugins' (position: START_TAG seen ...<!--rapport checkstyle -->\n\t\t\t<reportPlugins>... @148:19) @ C:\Users\FREAKER\workspace\prov\pom.xml, line 148, column 19 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] https://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] https://cwiki.apache.org/confluence/display/MAVEN/ModelParseException


Du coup, je bloque un peu. Car en regardant un peu partout sur les sites proposant des exemples de configuration du POM avec checkstyle et findbugs, je ne vois pas trop d'où pourrait venir le problème.

Est-ce que vous auriez des pistes pour pouvoir pallier à ce soucis ?

Bonne journée !

A voir également:

1 réponse

KX Messages postés 16761 Date d'inscription   Statut Modérateur Dernière intervention   3 020
 
Bonjour,

Vu l'erreur "Malformed POM", il serait sûrement mieux d'avoir l'intégralité de ton pom.xml pour identifier les erreurs.
0
astralangel Messages postés 37 Date d'inscription   Statut Membre Dernière intervention  
 
Bonsoir,

le voici, le voilà : http://pastebin.com/rr3xqm1v

Bonne soirée.
0
KX Messages postés 16761 Date d'inscription   Statut Modérateur Dernière intervention   3 020
 
Le problème c'est que tu as mis ces plugins dans
<build><plugins>
alors qu'il faudrait les mettre dans
<reporting><plugins>
:

<build>
    <plugins>
        ...
    </plugins>
</build>

<reporting>
    <plugins>

        <!--rapport checkstyle -->
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-checkstyle-plugin</artifactId>
            <version>2.15</version>
            <reportSets>
                <reportSet>
                    <reports>
                        <report>checkstyle</report>
                    </reports>
                </reportSet>
            </reportSets>
        </plugin>

        <!-- rapport find bugs -->
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>findbugs-maven-plugin</artifactId>
            <version>3.0.0</version>
            <configuration>
                <effort>Max</effort>
                <threshold>Low</threshold>
            </configuration>
            <reportSets>
                <reportSet>
                    <reports>
                        <report>findbugs</report>
                    </reports>
                </reportSet>
            </reportSets>
        </plugin>

    </plugins>    
</reporting>
0
astralangel Messages postés 37 Date d'inscription   Statut Membre Dernière intervention   > KX Messages postés 16761 Date d'inscription   Statut Modérateur Dernière intervention  
 
En effet, ça fonctionne beaucoup mieux ! C'était donc les balises qui étaient mal placées.

Merci beaucoup pour ton aide ! :)

Bonne soirée.
0