Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-7013

MavenXpp3Writer doesn't write plugin with groupId "org.apache.maven.plugins"

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Incomplete
    • 3.6.3
    • None
    • Plugins and Lifecycle
    • None

    Description

      When writing a pom.xml, when I try to create a plugin with the groupId "org.apache.maven.plugins", this is ignored and the plugin is written without groupId in the pom.xml file. If I add a space at the end like: "org.apache.maven.plugins " it seems to work though.

       

      Here's some code to reproduce:

      Model model = new Model();
      Writer writer = new FileWriter("pom.xml");
      Build build = new Build();
      List<Plugin> plugins = new ArrayList<>();
      Plugin mavenCompiler = new Plugin();
      mavenCompiler.setArtifactId("maven-compiler-plugin");
      mavenCompiler.setGroupId("org.apache.maven.plugins");
      mavenCompiler.setVersion("3.1");
      plugins.add(mavenCompiler);
      build.setPlugins(plugins);
      model.setName("test");
      model.setArtifactId("test");
      model.setModelVersion("4.0.0");
      model.setVersion("0.0.1");
      model.setGroupId("test");
      model.setBuild(build);
      new MavenXpp3Writer().write(writer, model);
      writer.close();
      
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            CarlosMatos Carlos Matos
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: