Sonar maven plugin problem with enforcer plugin

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Sonar maven plugin problem with enforcer plugin

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

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 ?

Reply | Threaded
Open this post in threaded view
|

Re: Sonar maven plugin problem with enforcer plugin

Olivier Gaudin-2
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


On Wed, Jan 27, 2010 at 3:45 PM, fabrice.mercier1 <[hidden email]> wrote:

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 ?



-----
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-tp27340630p27340630.html
Sent from the Sonar user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: Sonar maven plugin problem with enforcer plugin

fabrice.mercier1
CQFD :-)

Olivier Gaudin-2 wrote
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


On Wed, Jan 27, 2010 at 3:45 PM, fabrice.mercier1 <beufmerc@yahoo.fr> wrote:

>
> 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 ?
>
>
>
> -----
> 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-tp27340630p27340630.html
> Sent from the Sonar user mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>