Code Monkey home page Code Monkey logo

Comments (15)

iwarapter avatar iwarapter commented on July 21, 2024

Do you have a small demo project? I can clone and test?

from gradle-sonar-packaging-plugin.

fge avatar fge commented on July 21, 2024

Sorry, I don't... Anyway, I have just found that one element of the packaging differs and that's in the Plugin-Dependencies entries.

While the maven plugin generates "artifact-version.jar", this plugin generates "artifact:version.jar"... Maybe that explains it, I don't know; I have just modified the source and will try again.

I'll keep you informed.

from gradle-sonar-packaging-plugin.

iwarapter avatar iwarapter commented on July 21, 2024

Yeah when i write to the manifest i generate the entries here:
https://github.com/iwarapter/gradle-sonar-packaging-plugin/blob/master/src/main/groovy/com/iadams/gradle/plugins/tasks/PackagePluginTask.groovy#L136

If the manifest is wrong thats where it will be from!

from gradle-sonar-packaging-plugin.

iwarapter avatar iwarapter commented on July 21, 2024

Also noticed this difference:
META-INF/lib/grappa-2.0.0-beta.4-all.jar
META-INF/lib/grappa-2.0.0-beta.4.jar

from gradle-sonar-packaging-plugin.

fge avatar fge commented on July 21, 2024

Spot on! I think it's the problem...

In module sonar-objectscript-squid:

dependencies {
    compile(group: "com.github.fge", name: "grappa",
        version: "2.0.0-beta.4", classifier: "all") {
        exclude(group: "com.google.guava", module: "guava");
    };
    compile(group: "org.codehaus.sonar", name: "sonar-plugin-api",
        version: "5.0.1");
    compile(group: "org.codehaus.sonar.sslr-squid-bridge",
        name: "sslr-squid-bridge", version: "2.6");
    testCompile(group: "com.fasterxml.jackson.core",
        name: "jackson-databind", version: "2.5.1");
}

Note the classifier...

from gradle-sonar-packaging-plugin.

fge avatar fge commented on July 21, 2024

OK, so, anyway, this quick patch solves the problem of : vs -:

diff --git a/src/main/groovy/com/iadams/gradle/plugins/tasks/PackagePluginTask.groovy b/src/main/groovy/com/iadams/gradle/plugins/tasks/PackagePluginTask.groovy
index 0c9642e..d19dc56 100644
--- a/src/main/groovy/com/iadams/gradle/plugins/tasks/PackagePluginTask.groovy
+++ b/src/main/groovy/com/iadams/gradle/plugins/tasks/PackagePluginTask.groovy
@@ -133,7 +133,7 @@ class PackagePluginTask extends Jar {
         if(!getSkipDependenciesPackaging()) {

             List<ResolvedDependency> dependencies = new DependencyQuery(project).getNotProvidedDependencies()
-            manifest.attributes.put(PluginManifest.DEPENDENCIES, dependencies.collect{ "META-INF/lib/${it.moduleName}:${it.moduleVersion}.jar" }.join(' '))
+            manifest.attributes.put(PluginManifest.DEPENDENCIES, dependencies.collect{ "META-INF/lib/${it.moduleName}-${it.moduleVersion}.jar" }.join(' '))

             if(dependencies.size()>0){
                 logger.info "Following dependencies are packaged in the plugin:\n"

This and the classifier stuff should solve it all, I believe

from gradle-sonar-packaging-plugin.

fge avatar fge commented on July 21, 2024

OK, now I don't know how the problem should be solved; the maven plugin, somehow, picked the correct dependency but renamed it! While the gradle plugin picked it as is but only accounted for the name and version and not a potential qualifier...

I suck at groovy, which doesn't help matters; but there are potentially two solutions:

  • do it like the maven plugin, and rename the dependency; or
  • massage the dependency list so that the qualifier be added to the dependency name, if any.

I'll try and do the second solution since it will be easier for me and keep you informed...

from gradle-sonar-packaging-plugin.

fge avatar fge commented on July 21, 2024

OK, I've just submitted a PR.

As you will see, it's far from being "groovy"... I only know Java. And I know it's not perfect... I think the collection of such information should be done earlier on.

Well, it Works For Me(tm)...

from gradle-sonar-packaging-plugin.

fge avatar fge commented on July 21, 2024

OK well, as far as I'm concerned this issue can be closed.

When do you think a first version will be published? I'd like to code an example plugin using your plugin and sonar-sslr-grappa

from gradle-sonar-packaging-plugin.

iwarapter avatar iwarapter commented on July 21, 2024

There are a few other small bits that need doing, no blockers to publishing an initial version. I'll try and get this published in the next day or two.

from gradle-sonar-packaging-plugin.

iwarapter avatar iwarapter commented on July 21, 2024

An initial version has been released https://plugins.gradle.org/plugin/com.iadams.sonar-packaging

from gradle-sonar-packaging-plugin.

iwarapter avatar iwarapter commented on July 21, 2024

@fge Have you had a chance to use the initial version?

from gradle-sonar-packaging-plugin.

fge avatar fge commented on July 21, 2024

Yes, I have been using it for several weeks straight for my language plugin without a hitch :)

I mentioned in on dev@sonar, didn't you notice?

from gradle-sonar-packaging-plugin.

iwarapter avatar iwarapter commented on July 21, 2024

Didn't see anything after i posted on the release, i just wanted to add a little bit to the readme of examples of it being used.

from gradle-sonar-packaging-plugin.

fge avatar fge commented on July 21, 2024

Argh...

Well, I use it in a project which is commercial :(

What I'll do is convert https://github.com/litesolutions/sonar-dummylanguage to use your plugin and tell you when it's done.

Sorry for that :/

from gradle-sonar-packaging-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.