Package org.jboss.forge.project.facets

Examples of org.jboss.forge.project.facets.PackagingFacet


      return finalArtifact;
   }

   public DirectoryResource getExploded()
   {
      PackagingFacet packaging = project.getFacet(PackagingFacet.class);
      return project.getProjectRoot().getChildDirectory("target").getChildDirectory(packaging.getFinalName());
   }
View Full Code Here


      return getConfigFile(project);
   }

   private FileResource<?> getConfigFile(final Project project)
   {
      PackagingFacet packaging = project.getFacet(PackagingFacet.class);
      return getConfigFile(project, packaging.getPackagingType());
   }
View Full Code Here

      return getConfigFile(project);
   }

   private FileResource<?> getConfigFile(final Project project)
   {
      PackagingFacet packaging = project.getFacet(PackagingFacet.class);
      return getConfigFile(project, packaging.getPackagingType());
   }
View Full Code Here

                        "JBoss AS7 instance not running or handle to process was lost. Might need to shut things down manually.");
   }

   public FileResource<?> getFinalArtifact()
   {
      PackagingFacet packaging = project.getFacet(PackagingFacet.class);
      FileResource<?> finalArtifact = (FileResource<?>) packaging.getFinalArtifact();
      if (!finalArtifact.exists())
      {
         throw new RuntimeException("Project final artifact not found. Did you 'build' it?");
      }
      return finalArtifact;
View Full Code Here

      return finalArtifact;
   }

   public DirectoryResource getExploded()
   {
      PackagingFacet packaging = project.getFacet(PackagingFacet.class);
      return project.getProjectRoot().getChildDirectory("target").getChildDirectory(packaging.getFinalName());
   }
View Full Code Here

   {
      Project newProject = projectChanged.getNewProject();
      if (newProject != null && shell.isVerbose())
      {
         MetadataFacet metadata = newProject.getFacet(MetadataFacet.class);
         PackagingFacet packaging = newProject.getFacet(PackagingFacet.class);
         ShellMessages.info(shell, "Project found");
         ShellMessages.info(shell, "Name: \t" + shell.renderColor(ShellColor.BOLD, metadata.getProjectName()));
         ShellMessages.info(shell, "Version: \t" + shell.renderColor(ShellColor.BOLD, metadata.getProjectVersion()));
         ShellMessages.info(shell,
                  "Type: \t" + shell.renderColor(ShellColor.BOLD, packaging.getPackagingType().getDescription()));
         shell.println();
      }
   }
View Full Code Here

      return getConfigFile(project);
   }

   private FileResource<?> getConfigFile(final Project project)
   {
      PackagingFacet packaging = project.getFacet(PackagingFacet.class);
      return getConfigFile(project, packaging.getPackagingType());
   }
View Full Code Here

      MetadataFacet meta = project.getFacet(MetadataFacet.class);
      meta.setProjectName(name);
      meta.setTopLevelPackage(javaPackage);

      PackagingFacet packaging = project.getFacet(PackagingFacet.class);
      packaging.setPackagingType(type);

      DependencyFacet deps = project.getFacet(DependencyFacet.class);
      deps.addRepository(KnownRepository.JBOSS_NEXUS);

      if (packaging.getPackagingType().equals(PackagingType.JAR) && createMain)
      {
         project.getFacet(JavaSourceFacet.class).saveJavaSource(JavaParser
                  .create(JavaClass.class)
                  .setPackage(javaPackage)
                  .setName("Main")
                  .addMethod("public static void main(String[] args) {}")
                  .setBody("System.out.println(\"Hi there! I was forged as part of the project you call " + name
                           + ".\");")
                  .getOrigin());
      }

      if (project.hasFacet(JavaSourceFacet.class))
      {
         DirectoryResource sourceFolder = project.getFacet(JavaSourceFacet.class).getSourceFolder();
         createTopLevelPackage(sourceFolder, javaPackage);
      }

      if (finalName != null)
      {
         packaging.setFinalName(finalName);
      }
      else
      {
         packaging.setFinalName(name);
      }

      /*
       * Only change the environment after success!
       */
 
View Full Code Here

      return getConfigFile(project);
   }

   private FileResource<?> getConfigFile(final Project project)
   {
      PackagingFacet packaging = project.getFacet(PackagingFacet.class);
      return getConfigFile(project, packaging.getPackagingType());
   }
View Full Code Here

TOP

Related Classes of org.jboss.forge.project.facets.PackagingFacet

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.