Quantcast

[sonar-dev]How to compile a SVN checked out plugin using Maven?

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

[sonar-dev]How to compile a SVN checked out plugin using Maven?

00se
This post was updated on .
Hello all,

Probably this is an absolute simple question to answer, for me it is still a challenge how to do things;

Recently I encountered a problem with the stylecop runner functionality using Stylecop4.7, having to do with dll naming etc. (see also: http://jira.codehaus.org/browse/SONARPLUGINS-1405)

I decided to change to code a bit so that when I assign StyleCop 4.7 it will work (or at least writes the right dll name using the MSBuildFileGenerator on runtime)

What I did:
- Installed Eclipse
- Installed Maven 2.21
- Installed SVN plugins for Eclipse

Checked out project: http://svn.codehaus.org/sonar-plugins/trunk/dotnet/tools/stylecop-runner
and also: http://svn.codehaus.org/sonar-plugins/trunk/dotnet/tools/dotnet-tools-commons

I have changed the code in the aforementioned MSBuildFileGenerator and now I want to compile. (and distribute the new jar for testing on my Sonar instance)

How do I do this?
mvn doesn't want to work when I select the stylecop-runner pom and exits with a [Could not find artifact org.codehaus.sonar-plugins.dotnet.tools:parent:pom:1.4-SNAPSHOT] stacktrace.

My knowledge about (plugin) development and or maven is not to big as you can see and Google didn't give me the answers I was looking for.

Perhaps someone can help me in the right direction?

What are the steps I have to take?


Thanks in advance for any answer.

Best regards,


Ed



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [sonar-dev] How to compile a SVN checked out plugin using Maven?

Fabrice Bellingard-4
Hi Ed,

to solve your problem, you have to checkout the full source code of the C# ecosystem (http://svn.codehaus.org/sonar-plugins/trunk/dotnet/) and run "mvn install" from the root folder. This will work.


Best regards,

Fabrice BELLINGARD | SonarSource
http://sonarsource.com



On Tue, Jun 19, 2012 at 10:45 AM, 00se <[hidden email]> wrote:
Hello all,

Probably this is an absolute simple question to answer, for me it is still a
challenge how to do things;

Recently I encountered a problem with the stylecop runner functionality
using Stylecop4.7, having to do with dll naming etc. (see also:
http://jira.codehaus.org/browse/SONARPLUGINS-1405
http://jira.codehaus.org/browse/SONARPLUGINS-1405 )

I decided to change to code a bit so that when I assign StyleCop 4.7 it will
work (or at least writes the right dll name using the MSBuildFileGenerator
on runtime)

What I did:
- Installed Eclipse
- Installed Maven 2.21
- Installed SVN plugins for Eclipse

Checked out project:
http://svn.codehaus.org/sonar-plugins/trunk/dotnet/tools/stylecop-runner
and also:
http://svn.codehaus.org/sonar-plugins/trunk/dotnet/tools/dotnet-tools-commons

I have changed the code in the aforementioned MSBuildFileGenerator and now I
want to compile. (and distribute the new jar for testing on my Sonar
instance)

How do I do this?
mvn doesn't want to work when I select the stylecop-runner pom and exits
with a [Could not find artifact
org.codehaus.sonar-plugins.dotnet.tools:parent:pom:1.4-SNAPSHOT] stacktrace.

My knowledge about (plugin) development and or maven is not to big as you
can see and Google didn't give me the answers I was looking for.

Perhaps someone can help me in the right direction?

What are the steps I have to take?


Thanks in advance for any answer.

Best regards,


Ed





--
View this message in context: http://sonar.15.n6.nabble.com/How-to-compile-a-SVN-checked-out-plugin-using-Maven-tp4999925.html
Sent from the Sonar dev 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
|  
Report Content as Inappropriate

Re: [sonar-dev] How to compile a SVN checked out plugin using Maven?

00se
Hi Fabrice,

Thanks! That worked (partially)
The last step fails and in this case it doesn't matter, since I just needed one .class file generated to overwrite in the lib/stylecop-runner.jar

This goes wroing to be complete:
 Failed to execute goal on project sonar-csharp-rules-plugin: Could not resolve dependencies for project org.codehaus.sonar-plugins.dotnet.csharp:sonar-csharp-rules-plugin:sonar-plugin:1.4-SNAPSHOT: Failure to find com.sonarsource.csharp:sonar-csharp-squid-plugin:jar:1.1.1 in http://repo1.maven.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]
..

probably easy to solve and not now..


The output I get now when running analysis using Stylecop v4.7:
13:01:13.578 DEBUG MsBuildFileGenerator - version found: v4.7
13:01:13.578 DEBUG MsBuildFileGenerator - Using StyleCop.dll for analysis.

I just made a really simple parser which looks for a 'v' and from that point on adds the remaning numbers and '.' to a StringBuilder. Next a really simple (ugly) match occurs if it matches v4.7|4.6 or v4.6..
It's not the most elegant solution and yet for me it works; at least the generated stylecop-msbuild.xml gets propagated with 'StyleCop.dll' when it matches the found version.

And then the analysis still fails.. So I think best thing is to wait untill v4.7 gets embedded.

BR


Ed



Loading...