:fleche: Quels outils de métrique java utilisez-vous ?
Version imprimable
http://docs.codehaus.org/display/SONAR/Install+Sonar
en fait je suis les étapes décrites dans l'URL; mais la commande ne s'exécute pas, et à propos des outils j'ai évaluer SWAT4j,CCCC,sourcemonitor,mslocounter,RSM mais je veux vraiment tester Sonar.
Merci pour vos aides
voilà l'erreur
C:\tools\apache-maven-2.0.10\bin>mvn clean install sonar:sonar
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'sonar'.
[INFO] org.apache.maven.plugins: checking for updates from central
[WARNING] repository metadata for: 'org.apache.maven.plugins' could not be retri
eved from repository: central due to an error: Error transferring file
[INFO] Repository 'central' will be blacklisted
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] The plugin 'org.apache.maven.plugins:maven-sonar-plugin' does not exist o
r no valid version could be found
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Thu Jun 11 14:34:17 CEST 2009
[INFO] Final Memory: 1M/254M
[INFO] ------------------------------------------------------------------------
C:\tools\apache-maven-2.0.10\bin>
Bonjour, la seule manière qui a fonctionné chez moi c'est d'appeller le plugin de cette manière :
"mvn org.codehaus.sonar:sonar-maven-plugin:1.8:sonar"
Il est possible de changer le numéro de version.
De plus, il faut avoir téléchargé sonar et lancé l'application avant de faire la commande.
slt j'ai ts téléchargé mais tjrs pas de résultat
j'ai fait la commande que tu m'as dit et ça me donne le msg suivant
C:\tools\apache-maven-2.0.10\bin>mvn org.codehaus.sonar:sonar-maven-plugin:1.9.2
:sonar
[INFO] Scanning for projects...
Downloading: http://repo1.maven.org/maven2/org/co...r-maven-plugin
/1.9.2/sonar-maven-plugin-1.9.2.pom
Downloading: http://repo1.maven.org/maven2/org/co...r-maven-plugin
/1.9.2/sonar-maven-plugin-1.9.2.pom
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID: org.codehaus.sonar:sonar-maven-plugin
Reason: POM 'org.codehaus.sonar:sonar-maven-plugin' not found in repository: Una
ble to download the artifact from any repository
org.codehaus.sonar:sonar-maven-plugin:pom:1.9.2
from the specified remote repositories:
central (http://repo1.maven.org/maven2)
for project org.codehaus.sonar:sonar-maven-plugin
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Thu Jun 11 15:19:08 CEST 2009
[INFO] Final Memory: 1M/254M
[INFO] ------------------------------------------------------------------------
C:\tools\apache-maven-2.0.10\bin>[INFO] ----------------------------------------
----------------------------------
Essayes la 1.8 (dans la commande maven), normalement elle marche avec Sonar 1.9
@romaintaz
oui effectivement j'arrive à acceder au service web de sonar (vide), alors je ferai koi après??:(
mercii
C'est un bug Maven qui empêche la mise à jour des plugins Codehaus. La solution est de supprimer le répertoire org/codehaus/mojo de son repository local maven (voir "Plugin not found" dans le tutorial en 2 minutes)
Pas de panique, cette manipulation n'est à effectuer qu'une seule fois. Le problème ne se reproduira pas lors des prochaines versions.
Juste pour être sûr, tu peux essayer de renommer ton repository local. Par exemple, si c'est C:\maven2\repository, tu le renommes en C:\maven2\repository-backup.
Ensuite, tu relances la commande mvn sonar:sonar. Là, Maven2 devrait tout re-télécharger.
Si ça ne marche toujours pas, c'est que le problème vient d'ailleurs...
en fait pour mon cas, j'ai le dossier vide de Maven2 :calim2:
Es-tu derrière un proxy ?
As-tu un repository central de type Nexus, Archiva, etc. pour gérer les artifacts Maven2 dans ton entreprise ?
oui je suis derrière un proxy
et pour le repository central, franchement je sais pas car c'est la première fois que je travaille là-dessus.
merci de m'aider:(
As-tu configuré ton settings.xml (qui doit se trouver sur C:\Documents and Settings\<ton nom>\.m2\) pour que Maven2 puisse accéder à Internet ?
Toutes les valeurs xxx sont à remplacer, bien entendu ;)Code:
1
2
3
4
5
6
7
8
9
10<proxies> <proxy> <active>true</active> <protocol>http</protocol> <host>xxx</host> <port>8080</port> <username>xxx</username> <password>xxx</password> </proxy> </proxies>
le dossier m.2 est vide par contre le fichier setting.xml se trouve dans apache-maven-2.0.10\conf;
en fait je veux savoir prkoi le dossier M.2 est vide
merci:ccool:
Si le répertoire .m2 est vide, c'est que Maven2 fonctionne en mode par défaut.
Il te faut donc copier le settings.xml que tu as trouvé dans l'installation de Maven2, puis le mettre dans ce fameux répertoire .m2, et d'ajouter les informations que j'ai donné plus haut.
Ainsi, ton Maven2 sera configuré pour accéder à Internet, et donc sera capable de télécharger les artifacts...
j'ai fait ce tu m'avais dit et j'ai lancé la commande mvn sonar:sonar et ça me donne cela :calim2:
C:\tools\apache-maven-2.0.10\bin>mvn sonar:sonar
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'sonar'.
[INFO] org.apache.maven.plugins: checking for updates from central
[WARNING] repository metadata for: 'org.apache.maven.plugins' could not be retri
eved from repository: central due to an error: Error transferring file
[INFO] Repository 'central' will be blacklisted
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] The plugin 'org.apache.maven.plugins:maven-sonar-plugin' does not exist o
r no valid version could be found
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Fri Jun 12 14:26:51 CEST 2009
[INFO] Final Memory: 1M/254M
[INFO] ------------------------------------------------------------------------
C:\tools\apache-maven-2.0.10\bin>
C:\tools\apache-maven-2.0.10\bin>
Première chose à faire, afin d'être sûr que Maven2 est bien configuré :
Lance la commande mvn clean.
S'exécute-t-elle correctement ?
ayy malheureusement nn :(
C:\tools\apache-maven-2.0.10\bin>mvn clean
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Default Project
[INFO] task-segment: [clean]
[INFO] ------------------------------------------------------------------------
Downloading: http://repo1.maven.org/maven2/org/ap...ns/maven-clean
plugin/2.2/maven-clean-plugin-2.2.pom
Downloading: http://repo1.maven.org/maven2/org/ap...ns/maven-clean
plugin/2.2/maven-clean-plugin-2.2.pom
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID: org.apache.maven.plugins:maven-clean-plugin
Reason: POM 'org.apache.maven.plugins:maven-clean-plugin' not found in reposito
y: Unable to download the artifact from any repository
org.apache.maven.plugins:maven-clean-plugin:pom:2.2
from the specified remote repositories:
central (http://repo1.maven.org/maven2)
for project org.apache.maven.plugins:maven-clean-plugin
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Fri Jun 12 15:55:24 CEST 2009
[INFO] Final Memory: 1M/254M
[INFO] ------------------------------------------------------------------------
C:\tools\apache-maven-2.0.10\bin>