Discussion:
Sonar maven plugin problem with enforcer plugin
fabrice.mercier1
2010-01-27 14:45:44 UTC
Permalink
Hi

I used enforcer plugin in order to force all plugins declared to have a
stable version.
When I execute sonar the build failed because I call sonar without any
version.

I do not know if enforcer plugin is right because If a read the page bellow
http://maven.apache.org/enforcer/enforcer-rules/requirePluginVersions.html
the call of sonar plugin is concerned by the additionnalPlugins
configuration tags and I have no such tag in my pom.xml

my conf :
<execution>
<id>enforce-plugin-versions</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requirePluginVersions>
<message>Best Practice is to always define plugin versions!</message>
<banLatest>true</banLatest>
<banRelease>true</banRelease>
<banSnapshots>true</banSnapshots>
<phases>clean,deploy,site</phases>
</requirePluginVersions>
</rules>
</configuration>
</execution>

run in log message
[INFO] [enforcer:enforce {execution: enforce-property}]
[INFO] [enforcer:enforce {execution: enforce-plugin-versions}]
[WARNING] Rule 0: org.apache.maven.plugins.enforcer.RequirePluginVersions
failed with message:
Some plugins are missing valid versions:(LATEST RELEASE SNAPSHOT are not
allowed )
org.codehaus.mojo:taglist-maven-plugin. The version currently in use
is 2.4
org.codehaus.sonar.runtime:sonar-core-maven-plugin. The version
currently in use is 20100124120342
org.codehaus.mojo:sonar-maven-plugin. The version currently in use is
1.0-beta-1
Best Practice is to always define plugin versions!
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Can not execute Sonar

Embedded error: Unable to execute maven plugin
Some Enforcer rules have failed. Look above for specific messages explaining
why the rule failed.


My sonar command call :
mvn clean install -Dtest=false -DfailIfNoTests=false
mvn sonar:sonar -Dsonar.phase=generate-sources

Am I force to specify sonar release number ??

any other way ?



-----
Loading Image...
Architect
Almerys, activité santé d'Orange Business Services, TOULOUSE
http://www.orange-business.com http://www.orange-business.com
--
View this message in context: http://old.nabble.com/Sonar-maven-plugin-problem-with-enforcer-plugin-tp27340630p27340630.html
Sent from the Sonar user mailing list archive at Nabble.com.
Olivier Gaudin
2010-01-27 16:31:02 UTC
Permalink
Hello Fabrice,

The issue is not only on the sonar maven plugin but also on all plugin that
are handled by Sonar (Checkstyle, PMD...). Sonar sets the version on the
fly, but this is not good enough for the enforcer plugin.

The best solution for this is to run Sonar with -Denforcer.skip=true

Olivier
Post by fabrice.mercier1
Hi
I used enforcer plugin in order to force all plugins declared to have a
stable version.
When I execute sonar the build failed because I call sonar without any
version.
I do not know if enforcer plugin is right because If a read the page bellow
http://maven.apache.org/enforcer/enforcer-rules/requirePluginVersions.html
the call of sonar plugin is concerned by the additionnalPlugins
configuration tags and I have no such tag in my pom.xml
<execution>
<id>enforce-plugin-versions</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requirePluginVersions>
<message>Best Practice is to always define plugin versions!</message>
<banLatest>true</banLatest>
<banRelease>true</banRelease>
<banSnapshots>true</banSnapshots>
<phases>clean,deploy,site</phases>
</requirePluginVersions>
</rules>
</configuration>
</execution>
run in log message
[INFO] [enforcer:enforce {execution: enforce-property}]
[INFO] [enforcer:enforce {execution: enforce-plugin-versions}]
[WARNING] Rule 0: org.apache.maven.plugins.enforcer.RequirePluginVersions
Some plugins are missing valid versions:(LATEST RELEASE SNAPSHOT are not
allowed )
org.codehaus.mojo:taglist-maven-plugin. The version currently in use
is 2.4
org.codehaus.sonar.runtime:sonar-core-maven-plugin. The version
currently in use is 20100124120342
org.codehaus.mojo:sonar-maven-plugin. The version currently in use is
1.0-beta-1
Best Practice is to always define plugin versions!
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Can not execute Sonar
Embedded error: Unable to execute maven plugin
Some Enforcer rules have failed. Look above for specific messages explaining
why the rule failed.
mvn clean install -Dtest=false -DfailIfNoTests=false
mvn sonar:sonar -Dsonar.phase=generate-sources
Am I force to specify sonar release number ??
any other way ?
-----
http://old.nabble.com/file/u1297858/ft.gif
Architect
Almerys, activité santé d'Orange Business Services, TOULOUSE
http://www.orange-business.com http://www.orange-business.com
--
http://old.nabble.com/Sonar-maven-plugin-problem-with-enforcer-plugin-tp27340630p27340630.html
Sent from the Sonar user mailing list archive at Nabble.com.
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
fabrice.mercier1
2010-01-27 17:05:48 UTC
Permalink
CQFD :-)
Post by Olivier Gaudin
Hello Fabrice,
The issue is not only on the sonar maven plugin but also on all plugin that
are handled by Sonar (Checkstyle, PMD...). Sonar sets the version on the
fly, but this is not good enough for the enforcer plugin.
The best solution for this is to run Sonar with -Denforcer.skip=true
Olivier
Post by fabrice.mercier1
Hi
I used enforcer plugin in order to force all plugins declared to have a
stable version.
When I execute sonar the build failed because I call sonar without any
version.
I do not know if enforcer plugin is right because If a read the page bellow
http://maven.apache.org/enforcer/enforcer-rules/requirePluginVersions.html
the call of sonar plugin is concerned by the additionnalPlugins
configuration tags and I have no such tag in my pom.xml
<execution>
<id>enforce-plugin-versions</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requirePluginVersions>
<message>Best Practice is to always define plugin versions!</message>
<banLatest>true</banLatest>
<banRelease>true</banRelease>
<banSnapshots>true</banSnapshots>
<phases>clean,deploy,site</phases>
</requirePluginVersions>
</rules>
</configuration>
</execution>
run in log message
[INFO] [enforcer:enforce {execution: enforce-property}]
[INFO] [enforcer:enforce {execution: enforce-plugin-versions}]
[WARNING] Rule 0: org.apache.maven.plugins.enforcer.RequirePluginVersions
Some plugins are missing valid versions:(LATEST RELEASE SNAPSHOT are not
allowed )
org.codehaus.mojo:taglist-maven-plugin. The version currently in use
is 2.4
org.codehaus.sonar.runtime:sonar-core-maven-plugin. The version
currently in use is 20100124120342
org.codehaus.mojo:sonar-maven-plugin. The version currently in use is
1.0-beta-1
Best Practice is to always define plugin versions!
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Can not execute Sonar
Embedded error: Unable to execute maven plugin
Some Enforcer rules have failed. Look above for specific messages explaining
why the rule failed.
mvn clean install -Dtest=false -DfailIfNoTests=false
mvn sonar:sonar -Dsonar.phase=generate-sources
Am I force to specify sonar release number ??
any other way ?
-----
http://old.nabble.com/file/u1297858/ft.gif
Architect
Almerys, activité santé d'Orange Business Services, TOULOUSE
http://www.orange-business.com http://www.orange-business.com
--
http://old.nabble.com/Sonar-maven-plugin-problem-with-enforcer-plugin-tp27340630p27340630.html
Sent from the Sonar user mailing list archive at Nabble.com.
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
-----
http://old.nabble.com/file/u1297858/ft.gif
Architect
Almerys, activité santé d'Orange Business Services, TOULOUSE
http://www.orange-business.com http://www.orange-business.com
--
View this message in context: http://old.nabble.com/Sonar-maven-plugin-problem-with-enforcer-plugin-tp27340630p27343261.html
Sent from the Sonar user mailing list archive at Nabble.com.
Loading...