Package org.apache.maven.archetype.catalog

Examples of org.apache.maven.archetype.catalog.Archetype


                    archetypeCatalogs.size());

            for (Archetype candidate : candidates) {
                if (getWizard().acceptsArchetype(candidate)) {
                    String key = keyFor(candidate);
                    Archetype old = archetypesMap.put(key, candidate);

                    logger.trace("Registered archetype {0}", candidate);

                    if (old == null || !old.equals(candidate)) {
                        changed = true;
                    }

                    logger.trace("Old archetype was {0}, changed = {1}", old, changed);
                }
View Full Code Here


  private void initialize() {
    if (propertiesTable==null) {
      return;
    }
   
    Archetype archetype = parent.getChooseArchetypePage().getSelectedArchetype();
    if (archetype==null) {
      return;
    }
   
        try {
View Full Code Here

                    IOUtils.closeQuietly(fos);
                    FileUtils.deleteQuietly(tmpFile);
                }
            }

            Archetype archetype = new Archetype();
            archetype.setGroupId(groupId);
            archetype.setArtifactId(artifactId);
            archetype.setVersion(version);
            org.apache.maven.archetype.Archetype archetyper = MavenPluginActivator.getDefault().getArchetype();
            archetyper.updateLocalCatalog(archetype);
        } catch (CoreException e) {
            throw e;
        } catch (RuntimeException e) {
View Full Code Here

  }

  protected List<IProject> createProjects(IProgressMonitor monitor) throws CoreException {

        IPath location = chooseArchetypePage.getLocation();
        Archetype archetype = chooseArchetypePage.getSelectedArchetype();
        String groupId = archetypeParametersPage.getGroupId();
        String artifactId = archetypeParametersPage.getArtifactId();
        String version = archetypeParametersPage.getVersion();
        String javaPackage = archetypeParametersPage.getJavaPackage();
        Properties properties = archetypeParametersPage.getProperties();
View Full Code Here

            final FlatSearchRequest searchRequest = new FlatSearchRequest( pq );
            searchRequest.setContexts( getIndexingContexts() );
            final FlatSearchResponse searchResponse = indexer.searchFlat( searchRequest );
            for ( ArtifactInfo info : searchResponse.getResults() )
            {
                Archetype archetype = new Archetype();
                archetype.setGroupId( info.groupId );
                archetype.setArtifactId( info.artifactId );
                archetype.setVersion( info.version );
                archetype.setDescription( info.description );
                archetype.setRepository( repositories.get( info.repository ) );
                catalog.addArchetype( archetype );
            }
        }
        catch ( Exception ex )
        {
View Full Code Here

      Assert.assertNotNull(archetypeCatalogFactory);
      ArchetypeCatalog archetypes = archetypeCatalogFactory.getArchetypeCatalog();
      Assert.assertNotNull(archetypes);
      Assert.assertNotNull(archetypes.getArchetypes());
      Assert.assertEquals(1, archetypes.getArchetypes().size());
      Archetype expected = new Archetype();
      expected.setGroupId("groupId");
      expected.setArtifactId("artifactId");
      expected.setVersion("1.0.0");
      expected.setDescription("Description");
      Assert.assertEquals(expected, archetypes.getArchetypes().get(0));
   }
View Full Code Here

   @Override
   public ArchetypeCatalog getArchetypeCatalog()
   {
      ArchetypeCatalog archetypes = new ArchetypeCatalog();
      Archetype archetype = new Archetype();
      archetype.setGroupId("groupId");
      archetype.setArtifactId("artifactId");
      archetype.setVersion("1.0.0");
      archetype.setDescription("Description");
      archetypes.addArchetype(archetype);
      return archetypes;
   }
View Full Code Here

      }).setDescription(new Callable<String>()
      {
         @Override
         public String call() throws Exception
         {
            Archetype value = archetype.getValue();
            return value == null ? null : value.getDescription();
         }
      });
      builder.add(catalog).add(archetype);
   }
View Full Code Here

   @Override
   public Result execute(UIExecutionContext context) throws Exception
   {
      UIContext uiContext = context.getUIContext();
      Project project = (Project) uiContext.getAttributeMap().get(Project.class);
      Archetype chosenArchetype = archetype.getValue();
      String coordinate = chosenArchetype.getGroupId() + ":" + chosenArchetype.getArtifactId() + ":"
               + chosenArchetype.getVersion();
      DependencyQueryBuilder depQuery = DependencyQueryBuilder.create(coordinate);
      String repository = chosenArchetype.getRepository();
      if (!Strings.isNullOrEmpty(repository))
      {
         if (repository.endsWith(".xml"))
         {
            int lastRepositoryPath = repository.lastIndexOf('/');
View Full Code Here

        ArchetypeDefinition defaultDefinition = new ArchetypeDefinition();
        defaultDefinition.setGroupId( "default-groupId" );
        defaultDefinition.setArtifactId( "default-artifactId" );
        defaultDefinition.setVersion( "default-version" );
        Archetype archetype = queryer.selectArchetype( map, defaultDefinition );

        control.verify();

        assertEquals( "set-groupId", archetype.getGroupId() );
        assertEquals( "set-artifactId", archetype.getArtifactId() );
        assertEquals( "set-version", archetype.getVersion() );
    }
View Full Code Here

TOP

Related Classes of org.apache.maven.archetype.catalog.Archetype

Copyright © 2018 www.massapicom. 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.