Skip to content

Have a way to manage XML Attribute in YAML pom #118

Closed
@ChtiDkois

Description

@ChtiDkois

Some plugins have configuration with no other way than an XML Attribute, but there is no equivalent in YAML for this.

As example, this is a maven-antrun-plugin configuration :

            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <id>generate-surefire-workdir</id>
                        <phase>generate-test-sources</phase>
                        <configuration>
                            <!-- do not generate if tests are skipped -->
                            <skip>${maven.test.skip}</skip>
                            <target>
                                <mkdir dir="${basedir}/target/surefire-workdir" />
                            </target>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

Here, the mkdir element contains a "dir" attribute that cannot be transform into element.
I haven't found a way in YAML to describe this behavior.

  - groupId: org.apache.maven.plugins
    artifactId: maven-antrun-plugin
    executions:
    - id: generate-surefire-workdir
      phase: generate-test-sources
      # Do not generate if tests are skipped
      configuration:
        skip: ${maven.test.skip}
        target:
          mkdir: {dir: '${basedir}/target/surefire-workdir'}
      goals: [run]

I tried several way to put the "dir" value, no success.

Maybe we could have something like


        target:
          mkdir: 
            attr : {dir: '${basedir}/target/surefire-workdir'}

to specify we want it as a XML attribute ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions