Examples of ArchetypeCatalogXpp3Reader


Examples of org.apache.maven.archetype.catalog.io.xpp3.ArchetypeCatalogXpp3Reader

   {
      if (cachedArchetypes == null)
      {
         try (InputStream urlStream = catalogURL.openStream())
         {
            cachedArchetypes = new ArchetypeCatalogXpp3Reader().read(urlStream);
            for (Archetype archetype : cachedArchetypes.getArchetypes())
            {
               if (Strings.isNullOrEmpty(archetype.getRepository()))
               {
                  archetype.setRepository(defaultRepository);
View Full Code Here

Examples of org.apache.maven.archetype.catalog.io.xpp3.ArchetypeCatalogXpp3Reader

      assertUnmarshalling(u);
   }

   private void assertUnmarshalling(URL u) throws Exception
   {
      Assert.assertNotNull(new ArchetypeCatalogXpp3Reader().read(u.openStream()));
   }
View Full Code Here

Examples of org.apache.maven.archetype.catalog.io.xpp3.ArchetypeCatalogXpp3Reader

        sink.putArchetypes( archetypes, writer );

        StringReader reader = new StringReader( writer.toString() );

        ArchetypeCatalogXpp3Reader catalogReader = new ArchetypeCatalogXpp3Reader();

        ArchetypeCatalog catalog = catalogReader.read( reader );

        Archetype a1 = (Archetype) catalog.getArchetypes().get( 0 );

        assertEquals( "groupId", a1.getGroupId()  );
View Full Code Here

Examples of org.apache.maven.archetype.catalog.io.xpp3.ArchetypeCatalogXpp3Reader

    protected ArchetypeCatalog readCatalog( Reader reader )
        throws ArchetypeDataSourceException
    {
        try
        {
            ArchetypeCatalogXpp3Reader catalogReader = new ArchetypeCatalogXpp3Reader();

            return catalogReader.read( reader );
        }
        catch ( IOException e )
        {
            throw new ArchetypeDataSourceException( "Error reading archetype catalog.", e );
        }
View Full Code Here

Examples of org.apache.maven.archetype.catalog.io.xpp3.ArchetypeCatalogXpp3Reader

  {
    Response response;

    ArchetypeCatalog catalog;

    ArchetypeCatalogXpp3Reader acr = new ArchetypeCatalogXpp3Reader();

    // path of catalog
    String relativePath = "archetype-catalog.xml";
    String url = getRepositoryUrl(getTestRepositoryId()) + relativePath;

    // request the catalog
    response = RequestFacade.sendMessage(new URL(url), Method.GET, null);

    // read and check
    catalog = acr.read(response.getEntity().getReader());
    Assert.assertEquals(catalog.getArchetypes().size(), 1);

    // deploy one new archetype
    int httpResponseCode =
        getDeployUtils().deployUsingPomWithRest(getTestRepositoryId(), getTestFile("simple-archetype2.jar"),
            getTestFile("simple-archetype2.pom"), null, null);
    Assert.assertTrue("Unable to deploy artifact " + httpResponseCode, Status.isSuccess(httpResponseCode));

    // wait
    getEventInspectorsUtil().waitForCalmPeriod();

    // request the catalog
    response = RequestFacade.sendMessage(new URL(url), Method.GET, null);

    // read and check
    catalog = acr.read(response.getEntity().getReader());
    Assert.assertEquals(catalog.getArchetypes().size(), 2);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.