Support alternative markup for Apache Maven POM files

Related tags

polyglot-maven
Overview

Overview

Polyglot for Maven is a set of extensions for Maven 3.3.1+ that allows the POM model to be written in dialects other than XML. Several of the dialects also allow inlined plugins: the Ruby, Groovy and Scala dialects allow this.

License

Maven Central

Takari Slack

Here's an example POM written in the Ruby dialect:

project 'Polyglot :: Aggregator' do

  model_version '4.0.0'
  id 'io.tesla.polyglot:tesla-polyglot:0.0.1-SNAPSHOT'
  inherit 'io.tesla:tesla:4'
  packaging 'pom'

  properties( 'sisuInjectVersion' => '0.0.0.M2a',
              'teslaVersion' => '3.1.0' )

  modules [ 'tesla-polyglot-common',
            'tesla-polyglot-atom',
            'tesla-polyglot-ruby',
            'tesla-polyglot-groovy',
            'tesla-polyglot-yaml',
            'tesla-polyglot-clojure',
            'tesla-polyglot-scala',
            'tesla-polyglot-java',
            'tesla-polyglot-xml',
            'tesla-polyglot-cli',
            'tesla-polyglot-maven-plugin' ]

  overrides do
    jar 'org.eclipse.sisu:org.eclipse.sisu.inject:${sisuInjectVersion}'
    jar 'org.eclipse.sisu:org.eclipse.sisu.plexus:${sisuInjectVersion}'
    jar 'org.apache.maven:maven-model-builder:3.1.0'
    jar 'org.apache.maven:maven-embedder:3.1.0'
    jar( 'junit:junit:4.11', :scope => 'test' )

  end

  plugin 'org.codehaus.plexus:plexus-component-metadata:1.5.4' do
    execute_goals 'generate-metadata', 'generate-test-metadata'
  end

  build do
    execute("first", :validate) do |context|
      puts "Hello from JRuby!"
    end
  end
end

Requirements

Usage

To use Polyglot for Maven you need to edit ${maven.multiModuleProjectDirectory}/.mvn/extensions.xml and add the appropriate language extension.

The scala dialect supports a separate configuration parameter polyglot.scala.outputdir to specify a different output directory. This avoids the deletion during a Maven clean phase run, when set to a different folder such as .polyglot-cache instead of the default target. Inspect polyglot-maven-examples/scala/.mvn/maven.config for an example setup.

Available Languages

The available languages, in alphabetical order, with their artifact id are:

Language Artifact Id
Atom polyglot-atom
Groovy polyglot-groovy
Clojure polyglot-clojure
Kotlin polyglot-kotlin
Ruby polyglot-ruby
Scala polyglot-scala
YAML polyglot-yaml
Java polyglot-java
XML polyglot-xml

The groupId value is io.takari.polyglot.

Update extensions.xml

Edit the extensions.xml file and add the following, replacing ARTIFACTID with the artifactId for your chosen language.

<?xml version="1.0" encoding="UTF-8"?>
<extensions>
  <extension>
    <groupId>io.takari.polyglot</groupId>
    <artifactId>ARTIFACTID</artifactId>
    <version>0.4.6</version>
  </extension>
</extensions>

Convert existing POM

We have created a simple Maven plugin that will help you convert any existing pom.xml files:

mvn io.takari.polyglot:polyglot-translate-plugin:translate \
  -Dinput=pom.xml -Doutput=pom.{format}

Where the supported formats are rb, groovy, scala, yaml, atom, java and of course xml. See here for more info. You can even convert back to xml or cross-convert between all supported formats.

Known Limitations and Issues

Interoperability

The whole interoperability story has not been worked out but you can create a XML-formatted POM from the Polyglot version. Currently mixing different dialects within a reactor is not supported.

A pom.xml will currently not be installed or deployed except for the Ruby DSL and the Scala DSL but we are working towards this feature for all DSLs.

Tooling

Some support in IDE's like IntelliJ IDEA and Eclipse exist and the different markup languages are understood by various syntax highlighters. However, full integration of the markup syntax and the specific Maven-related aspects is not available.

Limited Plugin Support

Maven plugins or Maven plugin goals that rely on the XML format are not supported, since they are either attempting to parse the XML directly or modify it in automated fashion do not work with Polyglot Maven. Examples are:

  • Maven Release Plugin
  • Maven Versions Plugin (goals that don't edit the pom.xml (like e.g. display-dependency-updates) work as expected though)

Fixes would have to be implemented in these plugins. Workarounds or replacement workflows for most usecases exist.

Polyglot Maven in Real Life

Despite the warning above, Polyglot Maven is pretty stable right now. Have a look at the integration tests for each dialect in this repository for some examples as well as our dedicated polyglot-maven-examples project.

Some dialect folder contain specific README files with futher instructions as as test code with example projects and more. Ensure to check the ones for your specific dialect out as well.

The following projects are real world usage examples that use Polyglot Maven in their regular development and release work:

Kotlin

Specific docs and more can be found in the Kotlin dialect specific readme.

Ruby

YAML

  • http://snakeyaml.org - Extensive usage of Polyglot YAML and contributions to the project from the team.

  • https://urbanise.com - Using Polyglot YAML for building next generation strata management platform.

Scala

Java Projects

  • LambdaTest - A simple Java project with a standalone pom.scala

  • CmdOption - A Java project with a top-level reactor project and an additional shared scala file included into both pom.scalas

Scala Projects

  • Domino - A simple project using Polyglot Scala.

  • Blended - A complex multi-project using Polyglot Scala. It's also an example where the #include feature is heavily used to share common configuration but avoid Maven parent poms, which are often problematic.

Please let us know of your usage by filing an issue so we can add it here.

Issues
  • Fix #50: add support for scope blocks

    Fix #50: add support for scope blocks

    This new change introduces scope blocks, that make it cleaner to list/group dependencies, like:

    project {
       modelVersion '4.0.0'
       groupId 'foo.bar'
       artifactId 'example'
       version '0.0.1-SNAPSHOT'
       dependencies {
          $test { //junit and mockito get the test scope
              dependency 'junit:junit:4.12'
              dependency 'org.mockito:mockito-core:1.10.19'
          }
          $compile {//list all compile scoped dependencies here
              dependency 'foo:bar:x.y.z'
              ...
           }
           dependency 'a:b:1.0.0' //also compile  scope
            ...
        } 
     }
    

    The following scoped blocks are supported:

    • $compile {...}
    • $import {...}
    • $test {...}
    • $provided{...}
    • $runtime {...}
    • $system {...}

    In the current implementation, dependencies can overwrite the outer scope like

    $provided {
        'foo:bar:x.y.z:test' //will have the test scope
    }
    

    Signed-off-by: Fred Bricon [email protected]

    enhancement groovy 
    opened by fbricon 28
  • Have translator work on all projects in the reactor

    Have translator work on all projects in the reactor

    I'm not sure why it doesn't do this currently. But, the translator should act on all projects in the reactor.

    opened by Randgalt 18
  • polyglot-scala: Scala syntax friendly include preprocessor

    polyglot-scala: Scala syntax friendly include preprocessor

    This change adds an alternative preprocessor directive to the scala dialect.

    In addition to #include <file>, now also //##include <file> is supported. The motivation behind this is, to improve the editing experience. The latter added version produces syntax-correct scala files, which in turn improves editors and IDEs, e.g. parsing, formatting and highlighting. The former version does not.

    The unusual long prefix //## was choosen, to avoid confusion with a possibly commented out include (e.g. // #include).

    Also, this change adds a hint how to debug the pom.scala script to the error message in case of a compile error.

    opened by lefou 18
  • Release 0.4.2 / 0.4.3

    Release 0.4.2 / 0.4.3

    to get https://github.com/takari/polyglot-maven/pull/187 out

    opened by mosabua 17
  • Getting

    Getting "Input contained no data" on Maven 3.6.2

    After upgrading to Maven 3.6.2, all my builds that use polyglot-maven get an error like the following:

    [FATAL] Non-readable POM /.../.polyglot.pom.kt: input contained no data @ 
    

    To determine whether this was language-specific I've translated a pom.xml to ruby, groovy, and kotlin, and all of of them get the same error on Maven 3.6.2: "input contained no data".

    I suspect this may be a bug in Maven due to the nature of the changes described in the release notes, but in my testing I've so far been unable to determine the exact cause of the failure.

    I upgraded my cloned copy of polyglot-maven to Maven 3.6.2 and tests that were previously passing are now failing due to an inability to find some required components, but that might be a separate issue.

    opened by thorntonrp 17
  • Java DSL

    Java DSL

    Do you have any plans to add Java DSL as an alternative language for pom?

    opened by smartoma 16
  • Hardened used pathes for #include preprocessor in scala files

    Hardened used pathes for #include preprocessor in scala files

    By using Twitters eval util, we also derive it's #include preprocessor, which by default is a bit unexact when it comes to potential source locations for includable files. Also the include path is unstable when Maven is run in (multi-project) reactor builds.

    This patch removes the ambiguities and also makes include pathes more stable when run in reactor builds.

    opened by lefou 16
  • Release Plugin

    Release Plugin

    I'm wondering how the POM manipulations that the release plugin does could work on a polyglot maven POM. Wouldn't this require a major update to the release plugin, so it provides hooks the polyglot extensions can use to do the actual changes? Or is it feasible to reverse-engineer the changes the plugin did and re-apply those to the polyglot model? If the version is somehow derived or stored in a custom manner, these hooks would have to be passed to the model code, so e.g. a groovy script can update that source.

    I'm writing this, because I have the exactly this problem with my pomx project and I'm wondering if you have already have some concept for this. I didn't find any.

    opened by t1 15
  • Added alternative translate-project goal

    Added alternative translate-project goal

    The motivation behind this second goal is to avoid inconveniences with the 'translate' goal, which works on the complete reactor but does not handle errors well.

    With this goal, the user can control in detail which projects should be translated and how errors are handled with the known mvn commandline options (e.g.: -N, -pl, -am, -amd, -fae)

    opened by lefou 15
  • Polyglot Kotlin with complete Maven model support and other goodies

    Polyglot Kotlin with complete Maven model support and other goodies

    This pull request leverages the previous work that was done and re-worked it to support the complete Maven model as well as the following features:

    • Updates Kotlin to 1.3.21
    • Full Maven model support (including support for previously unsupported elements)
    • Gets the classpath for the Kotlin script engine from the Maven ClassRealm
    • Includes support for execute tasks both with inline lambdas and external scripts.
    • Unit tests provide 100% coverage for the Maven model.
    • Adds integration tests
    • Resolves ClassRealm issues that affected IntelliJ IDEA
    opened by thorntonrp 14
  • Bump snakeyaml from 1.17 to 1.26 in /polyglot-yaml

    Bump snakeyaml from 1.17 to 1.26 in /polyglot-yaml

    Bumps snakeyaml from 1.17 to 1.26.

    Commits
    • 9801cc7 Refactor: improve AliasEvent processing
    • a2066e3 Refactor Events: expose Event.ID via a getter
    • 72976f6 Merge
    • 03acd6b Add test for not implemented "!" tag
    • a122a5b Decide not to fix issue 459
    • 952f977 Serializer: release unused resources when closed
    • ccd45df Yaml: improve Javadoc
    • b56ada6 merge
    • bcb8a58 Clean up composer resources
    • 289c35a Apply Sonar improvements
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump commons-io from 2.6 to 2.7 in /polyglot-java

    Bump commons-io from 2.6 to 2.7 in /polyglot-java

    Bumps commons-io from 2.6 to 2.7.

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • JSON support

    JSON support

    As a newcomer to Java coming from JavaScript and PHP, I'm really used to JSON configurations. Would be pretty awesome if it was supported.

    Thanks!

    opened by dugajean 1
  • Error when use polyglot with tycho-pomless

    Error when use polyglot with tycho-pomless

    Here is the repo I used: https://github.com/duongdominhchau/tycho-example/tree/error

    It is based on the vogella example, I just added polyglot-yaml to extensions.xml and it fails. The output of mvn package is stored in maven-log-0.4.6.txt. I saw it failed injecting, my guess is the difference between polyglot-common version used in tycho-pomless and polyglot-yaml results in two choices for injection. However, when I use polyglot-yaml 0.4.5 (the version used by tycho-pomless), it fails too (maven-log-0.4.5.txt).

    I use Maven 3.6.3 with OpenJDK15 on ArchLinux.

    opened by duongdominhchau 0
  • polyglot fails with latest maven 4.0.0-alpha versions

    polyglot fails with latest maven 4.0.0-alpha versions

    using a simple sample project

    pom.yaml

    modelVersion: 4.0.0
    groupId: fr.brouillard.oss.maven.sample
    artifactId: yaml-project
    version: 0.0.1-SNAPSHOT
    name: 'Sample using YAML POM'
    

    extensions.xml

    <?xml version="1.0" encoding="UTF-8"?>
    
    <!--
      Licensed to the Apache Software Foundation (ASF) under one
      or more contributor license agreements. See the NOTICE file
      distributed with this work for additional information
      regarding copyright ownership. The ASF licenses this file
      to you under the Apache License, Version 2.0 (the
      "License"); you may not use this file except in compliance
      with the License. You may obtain a copy of the License at
      http://www.apache.org/licenses/LICENSE-2.0
      Unless required by applicable law or agreed to in writing,
      software distributed under the License is distributed on an
      "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
      KIND, either express or implied. See the License for the
      specific language governing permissions and limitations
      under the License.
    -->
    
    <extensions>
      <extension>
        <groupId>io.takari.polyglot</groupId>
        <artifactId>polyglot-yaml</artifactId>
        <version>0.4.6</version>
      </extension>
    </extensions>
    

    On latest maven versions Apache Maven 4.0.0-alpha-1-SNAPSHOT (2caed6218a5ec0a0b7fce2975743331e5ec76c89) the build fails with Internal error: java.lang.RuntimeException: Unable to determine model input format; options={transformerContext=org.apache.maven.model.[email protected]70cccd8f}

    full stack trace
    [INFO] Scanning for projects...
    [ERROR] Internal error: java.lang.RuntimeException: Unable to determine model input format; options={transformerContext=org.apache.maven.model.[email protected]70cccd8f} -> [Help 1]
    org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: Unable to determine model input format; options={transformerContext=org.apache.maven.model.[email protected]70cccd8f}
        at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:134)
        at org.apache.maven.cli.MavenCli.execute (MavenCli.java:982)
        at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:296)
        at org.apache.maven.cli.MavenCli.main (MavenCli.java:200)
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke (Method.java:566)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
    Caused by: java.lang.RuntimeException: Unable to determine model input format; options={transformerContext=org.apache.maven.model.[email protected]70cccd8f}
        at org.sonatype.maven.polyglot.PolyglotModelManager.getReaderFor (PolyglotModelManager.java:65)
        at org.sonatype.maven.polyglot.TeslaModelProcessor.read (TeslaModelProcessor.java:147)
        at org.sonatype.maven.polyglot.TeslaModelProcessor.read (TeslaModelProcessor.java:91)
        at org.apache.maven.model.building.DefaultModelBuilder.readRawModel (DefaultModelBuilder.java:743)
        at org.apache.maven.model.building.DefaultModelBuilder.readEffectiveModel (DefaultModelBuilder.java:364)
        at org.apache.maven.model.building.DefaultModelBuilder.build (DefaultModelBuilder.java:506)
        at org.apache.maven.model.building.DefaultModelBuilder.build (DefaultModelBuilder.java:494)
        at org.apache.maven.project.DefaultProjectBuilder.build (DefaultProjectBuilder.java:619)
        at org.apache.maven.project.DefaultProjectBuilder.build (DefaultProjectBuilder.java:401)
        at org.sonatype.maven.polyglot.TeslaProjectBuilder.build (TeslaProjectBuilder.java:43)
        at org.apache.maven.project.collector.DefaultProjectsSelector.selectProjects (DefaultProjectsSelector.java:63)
        at org.apache.maven.project.collector.MultiModuleCollectionStrategy.collectProjects (MultiModuleCollectionStrategy.java:71)
        at org.apache.maven.graph.DefaultGraphBuilder.getProjectsForMavenReactor (DefaultGraphBuilder.java:426)
        at org.apache.maven.graph.DefaultGraphBuilder.build (DefaultGraphBuilder.java:97)
        at org.apache.maven.DefaultMaven.buildGraph (DefaultMaven.java:559)
        at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:233)
        at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:206)
        at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:119)
        at org.apache.maven.cli.MavenCli.execute (MavenCli.java:982)
        at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:296)
        at org.apache.maven.cli.MavenCli.main (MavenCli.java:200)
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke (Method.java:566)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
    [ERROR]
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [ERROR]
    [ERROR] For more information about the errors and possible solutions, please read the following articles:
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/InternalErrorException
    

    Looking quickly at the code in PolyglotModelManager it looks like the injection of mappings did not worked as expected.

    opened by McFoggy 2
  • Conversion to Kotlin fails -- missing commons-lang3

    Conversion to Kotlin fails -- missing commons-lang3

    $ ./mvnw io.takari.polyglot:polyglot-translate-plugin:translate -Dinput=pom.xml -Doutput=pom.kts
    

    produces:

    $ ./mvnw io.takari.polyglot:polyglot-translate-plugin:translate   -Dinput=pom.xml -Doutput=pom.kts
    [ERROR] Failed to execute goal io.takari.polyglot:polyglot-translate-plugin:0.4.4:translate (default-cli) on project kotlin-rational: Execution default-cli of goal io.takari.polyglot:polyglot-translate-plugin:0.4.4:translate failed: A required class was missing while executing io.takari.polyglot:polyglot-translate-plugin:0.4.4:translate: org/apache/commons/lang3/StringEscapeUtils
    

    Is there a missing runtime dependency?

    opened by binkley 3
  • Make 'modelVersion' optional

    Make 'modelVersion' optional

    For every single maven project I've been created I had to define <modelVersion>4.0.0</modelVersion>. Luckily, Maven Polyglot YAML makes it less verbose/annoying but still an inconvenient in which sometimes, when I miss to define it, I just got my project build failing.

    What about making it optional and make it assume 4.0.0 as default value in case of being omitted?

    opened by miere 5
  • [YAML] [Structure] [Suggestion] Use lists rather than maps

    [YAML] [Structure] [Suggestion] Use lists rather than maps

    The current structure

    dependencies:
    - {groupId: ch.qos.logback, artifactId: logback-classic, version: '${logback.version}'}
    - {groupId: ch.qos.logback, artifactId: logback-core, version: '${logback.version}'}
    

    just doesn't look quite right. What I had imagined it as is something like this

    dependencies:
      - groupId: ch.qos.logback
        artifactId: logback-classic
        version: ${logback.version}
      - groupId: ch.qos.logback
        artifactId: logback-core
        version: ${logback.version}
    

    The use of lists rather than maps actually makes it easier to read (although, that is subjective).

    opened by JamesYeoman 5
  • Document what Atom IS

    Document what Atom IS

    There was this thread a couple of years ago: https://github.com/takari/polyglot-maven/issues/91

    but it doesn't look like any action was taken. As someone who just spent 10 minutes attempting to suss out what exactly Atom is via google (and was totally foiled due to the atom editor) before searching through the issues here, I think it would be very nice to actually include what atom is somewhere on the site in text. Happy to write a blurb based on what i gleaned from that that thread and put it in a PR - just don't know where you'd want it to go (main readme? readme in atom subfolder?)

    opened by madorb 0
  • [polyglot-yaml] Add ability to customise list element types

    [polyglot-yaml] Add ability to customise list element types

    Following on from #151, there should be an annotation that allows for list items to be customised in special circumstances. Given the following configuration:

    configuration:
      pluginOptions:
        - option1
        - option2
    

    The xml that gets generated ends up like this:

    <configuration>
      <pluginOptions>
        <pluginOption>option1</pluginOption>
        <pluginOption>option2</pluginOption>
      </pluginOptions>
    </configuration>
    

    Unfortunately, in my specific case, the xml generated needs to be like this:

    <configuration>
      <pluginOptions>
        <option>option1</option>
        <option>option2</option>
      <pluginOptions>
    </configuration>
    

    A potential solution is to add a tag option (http://yaml.org/spec/1.1/#id858961) which gets read and interpreted as the element type (examples here), e.g.:

    configuration:
      pluginOptions: !option
        - option1
        - option2
    

    or add parameterisation to the tag and try to find the metadata during parsing:

    configuration:
      pluginOptions: !xml:element:option
        - option1
        - option2
    

    If tags aren't usable, the parser could always look at lists and split the name on :. e.g.:

    configuration:
      pluginOptions:option:
        - option1
        - option2
    

    Or tags could be used statically to specify an element with metadata:

    configuration:
      pluginOptions: !xml:list
        elementType: option
        elements:
          - option1
          - option2
    
    opened by Tzrlk 2
Simple API, Complex Emails (JavaMail smtp wrapper)

Simple Java Mail Simple Java Mail is the simplest to use lightweight mailing library for Java, while being able to send complex emails including CLI s

Benny Bottema 858 Jun 18, 2021
The easiest way to integrate Maven into your project!

Maven Wrapper Ongoing Migration to Apache Maven The project codebase has been accepted to be included in the upstream Apache Maven project itself. Cur

null 1.5k Jun 15, 2021
Sauron, the all seeing eye! It is a service to generate automated reports and track migrations, changes and dependency versions for backend services also report on known CVE and security issues.

SAURON - VERSION AND DEPLOYMENT TRACKER DESCRIPTION Sauron, the all seeing eye! It is a service to generate automated reports and track migrations, ch

FREENOWTech 18 May 20, 2021
Ultra-fast SQL-like queries on Java collections

CQEngine - Collection Query Engine CQEngine – Collection Query Engine – is a high-performance Java collection which can be searched with SQL-like quer

Niall Gallagher 1.3k Jun 13, 2021
Detect uses of legacy Java APIs

Modernizer Maven Plugin Modernizer Maven Plugin detects uses of legacy APIs which modern Java versions supersede. These modern APIs are often more per

Andrew Gaul 242 Jun 7, 2021
An open source, modular alternative of sketchware. Create your own app in android using block programming like scratch!

OpenBlocks An open source, modular alternative of sketchware. Create your own app in android using block programming like scratch! What is OpenBlocks?

OpenBlocks 28 May 14, 2021
A lightweight, simple FTP server. Pure Java, no dependencies.

MinimalFTP A lightweight, simple FTP server. Pure Java, no libraries. Features Although it's named "minimal", it supports a bunch of features: 100% Ja

Guilherme Chaguri 100 May 31, 2021
An in-memory file system for Java 7+

Jimfs Jimfs is an in-memory file system for Java 7 and above, implementing the java.nio.file abstract file system APIs. Getting started The latest rel

Google 2k Jun 14, 2021
Tools for working with generic types

TypeTools A simple, zero-dependency library for working with types. Supports Java 1.6+ and Android. Introduction One of the sore points with Java invo

Jonathan Halterman 514 Jun 16, 2021
Sketchware Pro's sources, in Java.

Sketchware Pro This is for everyone who wants to contribute to Sketchware Pro's development. There are few things that must be taken into consideratio

Javkhlan K. 58 Jun 12, 2021
Modern Java - A Guide to Java 8

Modern Java - A Guide to Java 8 This article was originally posted on my blog. You should also read my Java 11 Tutorial (including new language and AP

Benjamin Winterberg 14.8k Jun 16, 2021
Masterful Machinery is a mod about creating customisable and complex multiblocks machines.

Masterful Machinery Masterful Machinery is a mod about creating customisable and complex multiblocks machines. Everything in the mod is customisable w

null 14 Jun 11, 2021
Quiltflower is a fork of Fernflower adding additional features for use with the Quilt toolchain.

Quiltflower Quiltflower is a fork of Fernflower adding additional features for use with the Quilt toolchain. Changes include: Javadoc application Mult

null 27 Jun 12, 2021
An MIT AI2 extension to allows developers to show media style notifications for their applications.

Media Notifications An MIT AI2 extension to allows developers to show media style notifications for their applications.

Shreyash Saitwal 5 May 12, 2021