{"id":19651313,"url":"https://github.com/embulk/gradle-embulk-plugins","last_synced_at":"2026-03-07T02:03:34.425Z","repository":{"id":37387263,"uuid":"103115276","full_name":"embulk/gradle-embulk-plugins","owner":"embulk","description":"A Gradle plugin to build and publish Embulk plugins","archived":false,"fork":false,"pushed_at":"2024-04-10T06:51:01.000Z","size":604,"stargazers_count":7,"open_issues_count":11,"forks_count":4,"subscribers_count":16,"default_branch":"master","last_synced_at":"2024-04-10T07:34:19.236Z","etag":null,"topics":["embulk","gradle-plugin"],"latest_commit_sha":null,"homepage":"https://plugins.gradle.org/plugin/org.embulk.embulk-plugins","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/embulk.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2017-09-11T09:16:00.000Z","updated_at":"2024-04-15T12:46:58.341Z","dependencies_parsed_at":"2023-09-22T09:36:52.388Z","dependency_job_id":"912fd7c1-12ce-44f7-8609-c735ee91c075","html_url":"https://github.com/embulk/gradle-embulk-plugins","commit_stats":null,"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/embulk%2Fgradle-embulk-plugins","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/embulk%2Fgradle-embulk-plugins/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/embulk%2Fgradle-embulk-plugins/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/embulk%2Fgradle-embulk-plugins/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/embulk","download_url":"https://codeload.github.com/embulk/gradle-embulk-plugins/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251345919,"owners_count":21574806,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["embulk","gradle-plugin"],"created_at":"2024-11-11T15:06:01.571Z","updated_at":"2026-03-07T02:03:29.378Z","avatar_url":"https://github.com/embulk.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"Gradle plugin for Embulk plugins\n=================================\n\nVersions\n---------\n\n| Gradle Plugin version | Expected Gradle version |\n| --------------------- | ----------------------- |\n| v0.7.0                | Gradle 8.7              |\n| v0.6.2                | Gradle 7.6 (7.6.3)      |\n| v0.6.1                | Gradle 7.6 (7.6.1)      |\n| v0.6.0                | Gradle 7.6 (7.6.1)      |\n\nQuick Start\n------------\n\n```\nplugins {\n    id \"java\"\n    id \"maven-publish\"\n    id \"signing\"\n\n    // Apply this Gradle plugin.\n    id \"org.embulk.embulk-plugins\" version \"0.7.0\"\n}\n\nrepositories {\n    mavenCentral()\n}\n\n// Set your own group ID. It would typically be:\n// - From your own domain (ex. \"com.example\"), or\n// - From your GitHub account (ex. \"io.github.your-github-user\").\n//\n// Note that you should not use \"org.embulk\" unless the plugin is maintained under: https://github.com/embulk\ngroup = \"...\"\n\n// Set the version of the plugin.\nversion = \"0.1.5-SNAPSHOT\"\n\n// Set the description of your plugin.\ndescription = \"An Embulk plugin to load example data.\"\n\nconfigurations {\n    // We'd recommend to enable dependency locking so that you are aware of transitive dependencies.\n    // See: https://docs.gradle.org/current/userguide/dependency_locking.html\n    compileClasspath.resolutionStrategy.activateDependencyLocking()\n    runtimeClasspath.resolutionStrategy.activateDependencyLocking()\n}\n\njava {\n    toolchain {\n        languageVersion = JavaLanguageVersion.of(8)\n    }\n\n    // \"javadoc\" JAR and \"sources\" JAR are required to publish the plugin to Maven Central.\n    withJavadocJar()\n    withSourcesJar()\n}\n\ndependencies {\n    // The versioning rule of \"embulk-spi\" has been independent from Embulk versions since v0.11.\n    // It would be two digits, such as \"0.11\", \"1.0\", \"1.1\", ...\n    // This is the version of Embulk SPI, as a contract between the core and plugins.\n    compileOnly \"org.embulk:embulk-spi:0.11\"\n\n    // An Embulk plugin should not depend on \"embulk-core\" if the plugin is ready for Embulk v0.11 and v1.0.\n\n    // An Embulk plugin would usually depend some \"embulk-util-*\" librarires, for example, \"embulk-util-config\".\n    // Note that Gradle 7+ needs to declare dependencies by \"implementation\", not by \"compile\".\n    implementation \"org.embulk:embulk-util-config:0.5.0\"\n\n    // ...\n\n    testImplementation \"junit:junit:4.13.2\"\n\n    // The Embulk main packages are often required for testing.\n    testImplementation \"org.embulk:embulk-spi:0.11\"\n    testImplementation \"org.embulk:embulk-core:0.11.0\"\n    testImplementation \"org.embulk:embulk-deps:0.11.0\"\n    testImplementation \"org.embulk:embulk-junit4:0.11.0\"\n}\n\nembulkPlugin {\n    // Set the plugin's main class.\n    mainClass = \"org.embulk.input.example.ExampleInputPlugin\"\n\n    // Set: \"decoder\", \"encoder\", \"filter\", \"formatter\", \"guess\", \"input\", \"output\", or \"parser\"\n    category = \"input\"\n\n    // Set the \"type\" of the Embulk plugin used in Embulk's configuration YAML.\n    // For instance, it would be \"example\" for \"embulk-input-example\".\n    type = \"example\"\n}\n\n// It would be a good habit to contain the LICENSE file(s) at \"META-INF/\" in your plugin packages.\njar {\n    metaInf {\n        from rootProject.file(\"LICENSE\")\n    }\n}\nsourcesJar {\n    metaInf {\n        from rootProject.file(\"LICENSE\")\n    }\n}\njavadocJar {\n    metaInf {\n        from rootProject.file(\"LICENSE\")\n    }\n}\n\n// The publishing settings are usually required to publish the plugin to Maven Central.\n// Publish it by: \"./gradlew publishMavenPublicationToMavenRepository\"\npublishing {\n    publications {\n        maven(MavenPublication) {\n            groupId = project.group\n            artifactId = project.name\n\n            from components.java\n            // javadocJar and sourcesJar are added by java.withJavadocJar() and java.withSourcesJar() above.\n            // See: https://docs.gradle.org/current/javadoc/org/gradle/api/plugins/JavaPluginExtension.html\n\n            // Some pom.xml attributes are mandatory in Maven Central.\n            // See: https://central.sonatype.org/pages/requirements.html\n            pom {\n                packaging \"jar\"\n\n                name = project.name\n                description = project.description\n                url = \"https://.../\"\n\n                licenses {\n                    license {\n                        // See: http://central.sonatype.org/pages/requirements.html#license-information\n                        name = \"...\"\n                        url = \"...\"\n                        distribution = \"repo\"\n                    }\n                }\n\n                developers {\n                    developer {\n                        name = \"...\"\n                        email = \"...\"\n                    }\n                    developer {\n                        name = \"...\"\n                        email = \"...\"\n                    }\n                    // ...\n                }\n\n                scm {\n                    connection = \"scm:git:git://github.com/.../....git\"\n                    developerConnection = \"scm:git:git@github.com:.../....git\"\n                    url = \"https://github.com/.../...\"\n                }\n            }\n        }\n    }\n\n    repositories {\n        maven {  // publishMavenPublicationToMavenCentralRepository\n            name = \"mavenCentral\"\n\n            // Note that the URLs may be different in your case, depending on your OSSRH / Sonatype registration.\n            // See: https://central.sonatype.org/publish/publish-maven/\n            if (project.version.endsWith(\"-SNAPSHOT\")) {\n                url \"https://oss.sonatype.org/content/repositories/snapshots\"\n            } else {\n                url \"https://oss.sonatype.org/service/local/staging/deploy/maven2\"\n            }\n\n            // Just an optional technique to specify OSSRH username and password from Gradle properties.\n            //\n            // It is sometimes useful to publish the plugin to Maven Central from CI like GitHub Actions.\n            credentials {\n                username = project.hasProperty(\"ossrhUsername\") ? ossrhUsername : \"\"\n                password = project.hasProperty(\"ossrhPassword\") ? ossrhPassword : \"\"\n            }\n        }\n    }\n}\n\n// The signing settings are usually required to publish the plugin to Maven Central.\n// See: https://central.sonatype.org/publish/requirements/gpg/\nsigning {\n    // Just an optional technique to specify a GPG key and password from Gradle properties.\n    //\n    // Set your GPG key into \"signingKey\" in the ASCII armor format.\n    // Set your GPG key password into \"signingPassword\".\n    //\n    // It is sometimes useful to publish the plugin to Maven Central from CI like GitHub Actions.\n    if (project.hasProperty(\"signingKey\") \u0026\u0026 project.hasProperty(\"signingPassword\")) {\n        logger.lifecycle(\"Signing with an in-memory key.\")\n        useInMemoryPgpKeys(signingKey, signingPassword)\n    }\n\n    sign publishing.publications.maven\n}\n\n// Enable the following \"gem\" and \"gemPush\" tasks if you want to publish your plugin also as a Ruby Gem.\n\n// gem {\n//     authors = [ \"...\" ]\n//     email = [ \"...\" ]\n//     // \"description\" of the Ruby Gem would come from \"description\" of the Gradle project.\n//     summary = \"Example input plugin for Embulk\"\n//     homepage = \"https://.../\"\n//     licenses = [ \"...\" ]  // See: https://guides.rubygems.org/specification-reference/#license=\n//\n//     from(\"LICENSE\")  // If you want to include LICENSE file(s) in the Ruby Gem package.\n// }\n\n// Push it by: \"./gradlew gemPush\"\n// gemPush {\n//     host = \"https://rubygems.org\"\n// }\n```\n\n### How to migrate from old `build.gradle`\n\n1. Upgrade your Gradle wrapper to `7.6.3`.\n2. Define `group`, `version`, and `description` in your Gradle project.\n    * `group` should **NOT** be `\"org.embulk\"` unless your project is under: https://github.com/embulk.\n      ```\n      group = \"com.example\"\n      version = \"0.1.5-SNAPSHOT\"\n      description = \"An Embulk plugin to load example data.\"\n      ```\n3. Replace dependencies on Embulk.\n    * Old (without this Gradle plugin):\n      ```\n      compile \"org.embulk:embulk-core:0.9.23\"\n      provided \"org.embulk:embulk-core:0.9.23\"\n      ```\n    * New:\n      ```\n      compileOnly \"org.embulk:embulk-spi:0.11\"\n\n      testImplementation \"org.embulk:embulk-spi:0.11\"\n      testImplementation \"org.embulk:embulk-core:0.11.0\"\n      testImplementation \"org.embulk:embulk-deps:0.11.0\"\n      testImplementation \"org.embulk:embulk-junit4:0.11.0\"\n      ```\n4. **Remove** an unnecessary configuration.\n    * `provided`\n    ```\n    configurations {\n        provided\n    }\n    ```\n5. **Remove** unnecessary tasks.\n    * `classpath`\n    ```\n    task classpath(type: Copy, dependsOn: [\"jar\"]) {\n        doFirst { file(\"classpath\").deleteDir() }\n        from (configurations.runtime - configurations.provided + files(jar.archivePath))\n        into \"classpath\"\n    }\n    clean { delete \"classpath\" }\n    ```\n    * `gem`\n    ```\n    task gem(type: JRubyExec, dependsOn: [\"gemspec\", \"classpath\"]) {\n        jrubyArgs \"-rrubygems/gem_runner\", \"-eGem::GemRunner.new.run(ARGV)\", \"build\"\n        script \"${project.name}.gemspec\"\n        doLast { ant.move(file: \"${project.name}-${project.version}.gem\", todir: \"pkg\") }\n    }\n    ```\n    * `gemPush`\n    ```\n    task gemPush(type: JRubyExec, dependsOn: [\"gem\"]) {\n        jrubyArgs \"-rrubygems/gem_runner\", \"-eGem::GemRunner.new.run(ARGV)\", \"push\"\n        script \"pkg/${project.name}-${project.version}.gem\"\n    }\n    ```\n    * `package`\n    ```\n    task \"package\"(dependsOn: [\"gemspec\", \"classpath\"]) {\n        doLast {\n            println \"\u003e Build succeeded.\"\n            println \"\u003e You can run embulk with '-L ${file(\".\").absolutePath}' argument.\"\n        }\n    }\n    ```\n    * `gemspec`\n    ```\n    task gemspec {\n        ext.gemspecFile = file(\"${project.name}.gemspec\")\n        inputs.file \"build.gradle\"\n        outputs.file gemspecFile\n        doLast { gemspecFile.write($/\n    Gem::Specification.new do |spec|\n      spec.name          = \"${project.name}\"\n      spec.version       = \"${project.version}\"\n      spec.authors       = [\"Somebody Somewhere\"]\n      spec.summary       = %[Example input plugin for Embulk]\n      spec.description   = %[An Embulk plugin to load example data.]\n      spec.email         = [\"somebody@example.com\"]\n      spec.licenses      = [\"MIT\"]\n      spec.homepage      = \"https://example.com\"\n\n      spec.files         = `git ls-files`.split(\"\\n\") + Dir[\"classpath/*.jar\"]\n      spec.test_files    = spec.files.grep(%r\"^(test|spec)/\")\n      spec.require_paths = [\"lib\"]\n\n      #spec.add_dependency 'YOUR_GEM_DEPENDENCY', ['~\u003e YOUR_GEM_DEPENDENCY_VERSION']\n      spec.add_development_dependency 'bundler'\n      spec.add_development_dependency 'rake', ['\u003e= 10.0']\n    end\n    /$)\n        }\n    }\n    clean { delete \"${project.name}.gemspec\" }\n    ```\n6. **Remove** an unnecessary file.\n    * `lib/embulk/\u003ccategory\u003e/\u003ctype\u003e.rb`\n      ```\n      Embulk::JavaPlugin.register_input(\n        \"example\", \"org.embulk.input.example.ExampleInputPlugin\",\n        File.expand_path('../../../../classpath', __FILE__))\n      ```\n7. Apply this Gradle plugin `\"org.embulk.embulk-plugins\"`.\n    * In Gradle's [plugins DSL](https://docs.gradle.org/current/userguide/plugins.html#sec:plugins_block):\n      ```\n      plugins {\n          id \"java\"\n          id \"maven-publish\"\n          id \"signing\"\n          id \"org.embulk.embulk-plugins\" version \"0.7.0\"\n      }\n8. **Remove** unnecessary JRuby/Gradle plugin.\n    * Plugin application:\n      ```\n          id \"com.github.jruby-gradle.base\" version \"0.1.5\"\n      ```\n    * Class import:\n      ```\n      import com.github.jrubygradle.JRubyExec\n      ```\n9. Configure the task `embulkPlugin`.\n    * `mainClass`, `category`, and `type` are mandatory. For example:\n      ```\n      embulkPlugin {\n          mainClass = \"org.embulk.input.dummy.DummyInputPlugin\"\n          category = \"input\"\n          type = \"dummy\"\n      }\n      ```\n10. Configure `publishing`. Recommended to publish your Embulk plugin to Maven Central.\n    * See the example above.\n11. Configure `signing`. It is mandatory to publish your Embulk plugin to Maven Central.\n    * See the example above.\n12. Configure `gem` and `gemPush` if you want to publish your Embulk plugin also as a Ruby Gem.\n    * See the example above.\n    * Note that JRuby's `rubygems` may not support multi-factor authentication (OTP) for [https://rubygems.org/](https://rubygems.org/) yet. You may need to set your authentication level to \"UI only\".\n        * https://guides.rubygems.org/setting-up-multifactor-authentication/\n\nWhat this Gradle plugin does?\n------------------------------\n\nThis Gradle plugin has two main purposes to satisfy two requirements as an Embulk plugin.\n\nOne of the requirements is to get Embulk plugin's `pom.xml` to include all dependencies as the direct first-level dependencies without any transitive dependency. This is an important restriction to keep dependencies consistent between plugin development and Embulk's runtime. (Indeed, Embulk's `PluginClassLoader` is implemented for Maven-based plugins to load only the direct first-level dependencies without any transitive dependency.)\n\nThe other requirement is to add some required attributes in `MANIFEST.MF`.\n\nIn addition, this Gradle plugin provides some support for publishing RubyGems-based plugins.\n\nThis Gradle plugin depends on Gradle's `java-plugin` and `maven-publish-plugin`.\n\nFor Maintainers of this Gradle plugin\n--------------------------------------\n\n### Release\n\nModify `version` in `build.gradle` at a detached commit, and then tag the commit with an annotation.\n\n```\ngit checkout --detach master\n\n(Edit: Remove \"-SNAPSHOT\" in \"version\" in build.gradle.)\n\ngit add build.gradle\n\ngit commit -m \"Release vX.Y.Z\"\n\ngit tag -a vX.Y.Z\n\n(Edit: Write a tag annotation in the changelog format.)\n```\n\nSee [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) for the changelog format. We adopt a part of it for Git's tag annotation like below.\n\n```\n## [X.Y.Z] - YYYY-MM-DD\n\n### Added\n- Added a feature.\n\n### Changed\n- Changed something.\n\n### Fixed\n- Fixed a bug.\n```\n\nPush the annotated tag, then. It triggers a release operation on GitHub Actions after approval.\n\n```\ngit push -u origin vX.Y.Z\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fembulk%2Fgradle-embulk-plugins","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fembulk%2Fgradle-embulk-plugins","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fembulk%2Fgradle-embulk-plugins/lists"}