{"id":13485955,"url":"https://github.com/takari/polyglot-maven","last_synced_at":"2026-01-11T16:59:52.983Z","repository":{"id":3914838,"uuid":"5003951","full_name":"takari/polyglot-maven","owner":"takari","description":"Support alternative markup for Apache Maven POM files","archived":false,"fork":false,"pushed_at":"2024-03-08T20:56:53.000Z","size":2436,"stargazers_count":868,"open_issues_count":40,"forks_count":96,"subscribers_count":48,"default_branch":"master","last_synced_at":"2024-05-19T03:18:21.168Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/takari.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2012-07-12T13:51:37.000Z","updated_at":"2024-05-17T21:08:28.000Z","dependencies_parsed_at":"2024-05-02T14:00:10.050Z","dependency_job_id":null,"html_url":"https://github.com/takari/polyglot-maven","commit_stats":{"total_commits":700,"total_committers":47,"mean_commits":"14.893617021276595","dds":0.7214285714285714,"last_synced_commit":"81a1150318821666f2f459241185658de2d1fa24"},"previous_names":["tesla/tesla-polyglot"],"tags_count":41,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takari%2Fpolyglot-maven","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takari%2Fpolyglot-maven/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takari%2Fpolyglot-maven/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takari%2Fpolyglot-maven/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/takari","download_url":"https://codeload.github.com/takari/polyglot-maven/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222313429,"owners_count":16965289,"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":[],"created_at":"2024-07-31T18:00:34.987Z","updated_at":"2026-01-11T16:59:52.978Z","avatar_url":"https://github.com/takari.png","language":"Java","funding_links":[],"categories":["Projects","Java","项目","Solutions"],"sub_categories":["Miscellaneous","杂项"],"readme":"# Overview\n\n[Polyglot for Maven](http://github.com/takari/polyglot-maven/) is a set of\nextensions for `Maven 3.3.1+` that allows the POM model to be written in\ndialects other than XML. Several of the dialects also allow inlined plugins: the\nRuby, Groovy and Scala dialects allow this.\n\n[![License](https://img.shields.io/badge/License-EPL%201.0-red.svg)](https://opensource.org/licenses/EPL-1.0)\n\n[![Maven Central](https://img.shields.io/maven-central/v/io.takari.polyglot/polyglot.svg?label=Maven%20Central)](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22io.takari.polyglot%22%20AND%20a%3A%22polyglot%22)\n\n[Takari Slack](https://takari.slack.com)\n\nHere's an example POM written in the Ruby dialect:\n\n```ruby\nproject 'Polyglot :: Aggregator' do\n\n  model_version '4.0.0'\n  id 'io.tesla.polyglot:tesla-polyglot:0.0.1-SNAPSHOT'\n  inherit 'io.tesla:tesla:4'\n  packaging 'pom'\n\n  properties( 'sisuInjectVersion' =\u003e '0.0.0.M2a',\n              'teslaVersion' =\u003e '3.1.0' )\n\n  modules [ 'tesla-polyglot-common',\n            'tesla-polyglot-atom',\n            'tesla-polyglot-ruby',\n            'tesla-polyglot-groovy',\n            'tesla-polyglot-yaml',\n            'tesla-polyglot-clojure',\n            'tesla-polyglot-scala',\n            'tesla-polyglot-java',\n            'tesla-polyglot-xml',\n            'tesla-polyglot-cli',\n            'tesla-polyglot-maven-plugin' ]\n\n  overrides do\n    jar 'org.eclipse.sisu:org.eclipse.sisu.inject:${sisuInjectVersion}'\n    jar 'org.eclipse.sisu:org.eclipse.sisu.plexus:${sisuInjectVersion}'\n    jar 'org.apache.maven:maven-model-builder:3.1.0'\n    jar 'org.apache.maven:maven-embedder:3.1.0'\n    jar( 'junit:junit:4.11', :scope =\u003e 'test' )\n\n  end\n\n  plugin 'org.codehaus.plexus:plexus-component-metadata:1.5.4' do\n    execute_goals 'generate-metadata', 'generate-test-metadata'\n  end\n\n  build do\n    execute(\"first\", :validate) do |context|\n      puts \"Hello from JRuby!\"\n    end\n  end\nend\n```\n\n# Requirements\n\nRuntime (when used in some project):\n* [Maven](http://maven.apache.org) 3.6.3+\n* [Java](http://java.sun.com/) 8+\n\nBuild time (of this project):\n* Maven 3.9+\n* Java 17+\n\n# Usage\n\nTo use Polyglot for Maven you need to edit\n`${maven.multiModuleProjectDirectory}/.mvn/extensions.xml` and add the\nappropriate language extension.\n\nThe scala dialect supports a separate configuration parameter\n`polyglot.scala.outputdir` to specify a different output directory. This avoids the\ndeletion during a Maven clean phase run, when set to a different folder such as\n`.polyglot-cache` instead of the default `target`. Inspect `polyglot-maven-examples/scala/.mvn/maven.config` for an example setup.\n\n## Available Languages\n\nThe available languages, in alphabetical order, with their artifact id are:\n\n| Language | Artifact Id        |\n|:--------:|:------------------:|\n| Atom     | `polyglot-atom`    |\n| Groovy   | `polyglot-groovy`  |\n| Clojure  | `polyglot-clojure` |\n| Kotlin   | `polyglot-kotlin`  |\n| Ruby     | `polyglot-ruby`    |\n| Scala    | `polyglot-scala`   |\n| YAML     | `polyglot-yaml`    |\n| Java     | `polyglot-java`    |\n| XML      | `polyglot-xml`     |\n\nThe groupId value is `io.takari.polyglot`.\n\n## Update extensions.xml\n\nEdit the `extensions.xml` file and add the following, replacing ARTIFACTID with\nthe artifactId for your chosen language.\n\n```\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003cextensions\u003e\n  \u003cextension\u003e\n    \u003cgroupId\u003eio.takari.polyglot\u003c/groupId\u003e\n    \u003cartifactId\u003eARTIFACTID\u003c/artifactId\u003e\n    \u003cversion\u003e0.4.6\u003c/version\u003e\n  \u003c/extension\u003e\n\u003c/extensions\u003e\n```\n\n## Convert existing POM\n\nWe have created a simple Maven plugin that will help you convert any existing\n`pom.xml` files:\n\n```\nmvn io.takari.polyglot:polyglot-translate-plugin:translate \\\n  -Dinput=pom.xml -Doutput=pom.{format}\n```\n\nWhere the supported formats are `rb`, `groovy`, `scala`, `yaml`, `atom`, `java`\nand of course `xml`.  See\n[here](http://takari.io/2015/03/21/polyglot-maven.html) for more info.  You can\neven convert back to `xml` or cross-convert between all supported formats.\n\n# Known Limitations and Issues\n\n## Interoperability\n\nThe whole interoperability story has not been worked out but you can create a\nXML-formatted POM from the Polyglot version. Currently mixing different dialects\nwithin a reactor is not supported.\n\nA `pom.xml` will currently not be installed or deployed except for the Ruby DSL\nand the Scala DSL but we are working towards this feature for all DSLs.\n\n## Tooling\n\nSome support in IDE's like IntelliJ IDEA and Eclipse exist and the different\nmarkup languages are understood by various syntax highlighters. However, full\nintegration of the markup syntax and the specific Maven-related aspects is not\navailable.\n\n## Limited Plugin Support\n\nMaven plugins or Maven plugin goals that rely on the XML format are not\nsupported, since they are either attempting to parse the XML directly or modify\nit in automated fashion do not work with Polyglot Maven. Examples are:\n\n- Maven Release Plugin\n- Maven Versions Plugin (goals that don't edit the `pom.xml` (like e.g. `display-dependency-updates`) work as expected though)\n\nFixes would have to be implemented in these plugins. Workarounds or replacement\nworkflows for most usecases exist.\n\n# Polyglot Maven in Real Life\n\nDespite the warning above, Polyglot Maven is pretty stable right now. Have a\nlook at the integration tests for each dialect in this repository for some\nexamples as well as our dedicated\n[polyglot-maven-examples project](https://github.com/takari/polyglot-maven-examples).\n\nSome dialect folder contain specific README files with futher instructions as\nas test code with example projects and more. Ensure to check the ones for your\nspecific dialect out as well.\n\nThe following projects are real world usage examples that use Polyglot Maven in\ntheir regular development and release work:\n\n## Kotlin\n\nSpecific docs and more can be found in the [Kotlin dialect specific readme](./polyglot-kotlin/README.md).\n\n## Ruby\n\n* https://github.com/jruby - Extensive usage of Polyglot Ruby and contributions\n  to the project from the team, and is recommended when creating\n  [java extensions for jruby](https://github.com/jruby/jruby-examples/tree/master/extensions/basic).\n  \n* The\n  [ruby-processing project](http://ruby-processing.github.io/building/building/)\n  has examples of creating java extensions for jruby (see\n  [JRubyArt](https://github.com/ruby-processing/JRubyArt) and\n  [propane](https://github.com/ruby-processing/propane) builds) as well as\n  simpler projects where the polyglot maven is used in creating gem wrappers for\n  processing.org java libraries (eg\n  [toxicgem](https://github.com/ruby-processing/toxicgem) and\n  [geomerative](https://github.com/ruby-processing/propane) gems).\n\n## YAML\n\n* https://bitbucket.org/snakeyaml/snakeyaml/src/master/ - Extensive usage of Polyglot YAML and contributions to\n  the project from the team.\n\n* https://urbanise.com - Using Polyglot YAML for building next generation strata\n  management platform.\n\n## Scala\n\nSpecific docs and more can be found in the [Scala dialect specific readme](./polyglot-scala/README.adoc).\n\n\n_Java Projects_\n\n* [LambdaTest](https://github.com/lefou/LambdaTest) - A simple Java project with\n  a standalone\n  [pom.scala](https://github.com/lefou/LambdaTest/blob/master/pom.scala)\n\n* [CmdOption (until version `0.6.0` )](https://github.com/ToToTec/CmdOption/tree/0.6.0) - A Java project with a\n  top-level reactor project and an additional shared scala file included into\n  both `pom.scala`s (Switched over to Mill after version `0.6.0`)\n\n_Scala Projects_\n\n* [Domino (until version `1.1.3`)](https://github.com/domino-osgi/domino/tree/1.1.3) - A simple project using\n  Polyglot Scala. (Switched over to Mill after version `1.1.3`)\n\n* [Blended (until version `2.4.0.2`)](https://github.com/woq-blended/blended/tree/2.4.0.2) - A complex multi-project\n  using Polyglot Scala. Now archived. It's also an example where the `#include` feature is\n  heavily used to share common configuration but avoid Maven parent poms, which\n  are often problematic. (Switched later to sbt and then Mill)\n\nPlease let us know of your usage by filing an issue so we can add it here.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakari%2Fpolyglot-maven","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftakari%2Fpolyglot-maven","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakari%2Fpolyglot-maven/lists"}