Package org.springframework.boot.loader.tools

Examples of org.springframework.boot.loader.tools.Repackager


    return new JavaPackageFragmentRootHandler(javaProject, null);
  }

  protected void bootRepackage(final IPackageFragmentRoot[] roots,
      File packagedFile) throws CoreException {
    Repackager bootRepackager = new Repackager(packagedFile);
    try {
      bootRepackager.repackage(new Libraries() {

        public void doWithLibraries(LibraryCallback callBack)
            throws IOException {
          for (IPackageFragmentRoot root : roots) {
View Full Code Here


      return;
    }

    File source = this.project.getArtifact().getFile();
    File target = getTargetFile();
    Repackager repackager = new Repackager(source) {
      @Override
      protected String findMainMethod(JarFile source) throws IOException {
        long startTime = System.currentTimeMillis();
        try {
          return super.findMainMethod(source);
        }
        finally {
          long duration = System.currentTimeMillis() - startTime;
          if (duration > FIND_WARNING_TIMEOUT) {
            getLog().warn(
                "Searching for the main-class is taking some time, "
                    + "consider using the mainClass configuration "
                    + "parameter");
          }
        }
      }
    };
    repackager.setMainClass(this.mainClass);
    if (this.layout != null) {
      getLog().info("Layout: " + this.layout);
      repackager.setLayout(this.layout.layout());
    }

    Set<Artifact> artifacts = filterDependencies(this.project.getArtifacts(),
        getFilters());

    Libraries libraries = new ArtifactsLibraries(artifacts, this.requiresUnpack,
        getLog());
    try {
      repackager.repackage(target, libraries);
    }
    catch (IOException ex) {
      throw new MojoExecutionException(ex.getMessage(), ex);
    }
    if (!source.equals(target)) {
View Full Code Here

      File outputFile = RepackageTask.this.outputFile;
      if (outputFile != null && !file.equals(outputFile)) {
        copy(file, outputFile);
        file = outputFile;
      }
      Repackager repackager = new LoggingRepackager(file);
      setMainClass(repackager);
      if (this.extension.convertLayout() != null) {
        repackager.setLayout(this.extension.convertLayout());
      }
      repackager.setBackupSource(this.extension.isBackupSource());
      try {
        repackager.repackage(file, this.libraries);
      }
      catch (IOException ex) {
        throw new IllegalStateException(ex.getMessage(), ex);
      }
    }
View Full Code Here

TOP

Related Classes of org.springframework.boot.loader.tools.Repackager

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.