1

This question is related to this one. I'm having a lot of trouble uploading a .jar file to this site. Following the documentation steps described here and here I've created a build.gradle file:

// First, apply the publishing plugin
buildscript {
  repositories {
    maven {
      url "https://plugins.gradle.org/m2/"
    }
  }
  dependencies {
    classpath "com.gradle.publish:plugin-publish-plugin:0.9.1"
  }
}

apply plugin: "com.gradle.plugin-publish"
// Apply other plugins here, e.g. java plugin for a plugin written in java or
// the groovy plugin for a plugin written in groovy
apply plugin: "java"
// If your plugin has any external java dependencies, Gradle will attempt to
// downloaded them from JCenter for anyone using the plugins DSL
// so you should probably use JCenter for dependency resolution in your own
// project.
repositories {
  jcenter()
}

dependencies {
  compile gradleApi()
  compile localGroovy() //not needed for Java plugins
  // other dependencies that your plugin requires
  compile fileTree(dir: "/usr/local/bin", include: ["*.jar"])
  compile fileTree(dir: "/usr/lib/jvm/java-8-jdk/jre/lib/", include: ["*.jar"])
  compile fileTree(dir: "/home/kiara/AppLab/KIARA/kiaragen/lib/", include: ["*.jar"])
}

pluginBundle {
  // These settings are set for the whole plugin bundle
  website = 'http://www.gradle.org/'
  vcsUrl = 'https://github.com/gradle/gradle'

  // tags and description can be set for the whole bundle here, but can also
  // be set / overridden in the config for specific plugins
  description = 'kiaragen version 0.1.0'
  version = '0.1.0'

  // The plugins block can contain multiple plugin entries.
  //
  // The name for each plugin block below (greetingsPlugin, goodbyePlugin)
  // does not affect the plugin configuration, but they need to be unique
  // for each plugin.

  // Plugin config blocks can set the id, displayName, version, description
  // and tags for each plugin.

  // id and displayName are mandatory.
  // If no version is set, the project version will be used.
  // If no tags or description are set, the tags or description from the
  // pluginBundle block will be used, but they must be set in one of the
  // two places.

  plugins {
    kiaragenPlugin {
      id = 'org.fiware.kiara.generator.kiaragen'
      displayName = 'kiaragen 0.1.0'
      tags = ['kiaragen', 'IDL', 'code', 'generator']
      version = '0.1.0'
    }
  }
}

The project directory containing the file also contains the .jar file:

$ ls
build  build.gradle  build.gradle.bak  kiaragen-0.1.0.jar  kiaragen-0.2.0.jar  META-INF

META-INF/gradle-plugins/org.fiware.kiara.generator.kiaragen.properties contains the name of the main class:

Manifest-Version: 1.0
Main-Class: org.fiware.kiara.generator.kiaragen

The .jar file I need to upload is kiaragen-0.1.0.jar and its dependencies are located in:

/home/kiara/AppLab/KIARA/kiaragen/lib/

Running:

$ gradle publishPluginJar
:publishPluginJar UP-TO-DATE

BUILD SUCCESSFUL

Total time: 4.435 secs

This build could be faster, please consider using the Gradle Daemon: http://gradle.org/docs/2.4/userguide/gradle_daemon.html

Running with the --info flag gives:

$ gradle publishPluginJar --info
Starting Build
Settings evaluated using settings file '/master/settings.gradle'.
Projects loaded. Root project using build file '/home/kiara/AppLab/KIARA/Uploadkiaragen/build.gradle'.
Included projects: [root project 'Uploadkiaragen']
Evaluating root project 'Uploadkiaragen' using build file '/home/kiara/AppLab/KIARA/Uploadkiaragen/build.gradle'.
All projects evaluated.
Selected primary task 'publishPluginJar' from project :
Tasks to be executed: [task ':publishPluginJar']
:publishPluginJar (Thread[main,5,main]) started.
:publishPluginJar
Skipping task ':publishPluginJar' as it is up-to-date (took 0.086 secs).
:publishPluginJar UP-TO-DATE
:publishPluginJar (Thread[main,5,main]) completed. Took 0.148 secs.

BUILD SUCCESSFUL

Total time: 4.792 secs
Stopped 0 compiler daemon(s).

This build could be faster, please consider using the Gradle Daemon: http://gradle.org/docs/2.4/userguide/gradle_daemon.html

The problem is that I'm not sure that the .jar file has been uploaded. Loading a different project that makes use of it shows it's not. Reading the documentation page:

Some plugins require manual acceptance by the Plugin Portal maintainers, and will not be made available immediately when they are published. This is only the case when you have specified a custom “group ID” for your plugin artifact. The plugin publishing plugin will tell you if your plugin is pending acceptance when you publish.

If your plugin requires changes before it can be accepted, you will be contacted via the email address associated with your account. You will also receive an email when your plugin is accepted.

How does the "plugin publishing plugin" tell me if my plugin is pending acceptance when I publish?

Community
  • 1
  • 1
Sebi
  • 4,262
  • 13
  • 60
  • 116
  • I'm guessing that the plugin-publishing plugin expects the build to create the JAR that needs to be uploaded. By convention, the JAR is created by the _jar_ task. You don't have any source files that can be compiled and packaged into a JAR, so all the tasks are basically "up to date". There's probably a way to attach the pre-built JAR to the publishing task, but I'd need to research how to do that. Also, why is the JAR pre-built? – Peter Ledbrook Jul 16 '15 at 21:32
  • @Peter Ledbrook There are two versions of the .jar file and I only have the code for one of them and only need the other .jar file(with no source). I can't seem to find information on uploading(publishing) a plugin to plugins.gradle.com anywhere. – Sebi Jul 17 '15 at 07:52
  • 1
    You should ask on the Gradle forums under the Plugin Portal category. There used to be a manual process (which I used in the past), but the docs for that no longer seem to exist. Even if you worked out how to do it, plugins go through a manual approval process and the Gradle team may not be happy with a plugin with no source. Hence why I think you should contact them through the forums. I also see now that I need to "reclaim" one of my plugins... – Peter Ledbrook Jul 17 '15 at 14:29

1 Answers1

0

It seems that plugins.gradle.com is only meant for plugins that extend the functionality of gradle itself.

Sebi
  • 4,262
  • 13
  • 60
  • 116