Uploaded image for project: 'Maven Plugin Testing'
  1. Maven Plugin Testing
  2. MPLUGINTESTING-1

Add convenience methods to MavenProjectStub to easily populate model from test resource

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.1
    • 1.2
    • plugin-testing-harness
    • None

    Description

      The following code snippet

      MavenXpp3Reader pomReader = new MavenXpp3Reader();
      Model model = null;
      
      try
      {
          File pomFile = new File( getBasedir(), "some-pom.xml" );
          model = pomReader.read( ReaderFactory.newXmlReader( pomFile ) );
          setModel( model );
      }
      catch ( Exception e )
      {
          throw new RuntimeException( e );
      }
      

      is both tiresome and error-prone (encoding). Moving this functionality into the MavenProjectStub would make life easier.

      Attachments

        Activity

          People

            bentmann Benjamin Bentmann
            bentmann Benjamin Bentmann
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: