ReportSets non reconnu dans le pom : build Maven non possible

Résolu/Fermé
astralangel Messages postés 37 Date d'inscription samedi 15 décembre 2012 Statut Membre Dernière intervention 18 février 2016 - 29 juin 2015 à 15:41
astralangel Messages postés 37 Date d'inscription samedi 15 décembre 2012 Statut Membre Dernière intervention 18 février 2016 - 29 juin 2015 à 22:18
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 16733 Date d'inscription samedi 31 mai 2008 Statut Modérateur Dernière intervention 31 janvier 2024 3 015
29 juin 2015 à 18:51
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 samedi 15 décembre 2012 Statut Membre Dernière intervention 18 février 2016
29 juin 2015 à 21:18
Bonsoir,

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

Bonne soirée.
0
KX Messages postés 16733 Date d'inscription samedi 31 mai 2008 Statut Modérateur Dernière intervention 31 janvier 2024 3 015
Modifié par KX le 29/06/2015 à 21:35
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 samedi 15 décembre 2012 Statut Membre Dernière intervention 18 février 2016 > KX Messages postés 16733 Date d'inscription samedi 31 mai 2008 Statut Modérateur Dernière intervention 31 janvier 2024
29 juin 2015 à 22:18
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