Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2006-2014 smartics, Kronseder & Reiner GmbH
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 package com.redhat.rcm.maven.plugin.buildmetadata;
 
 import java.io.File;
 import java.util.List;
 
Maps project types to property files.

Author(s):
Robert Reiner
 
 {
   // ********************************* Fields *********************************
 
   // --- constants ------------------------------------------------------------
 
   // --- members --------------------------------------------------------------
 
  
The Maven project.
 
   private final MavenProject project;

  
The mapping property.
 
The name of the file to create the path for.
 
   private final String fileName;
 
   // ****************************** Initializer *******************************
 
   // ****************************** Constructors ******************************
 
       final List<FileMappingpropertyOutputFileMappingfinal String fileName)
   {
     this. = project;
     this. = propertyOutputFileMapping;
     this. = fileName;
   }
 
   // ****************************** Inner Classes *****************************
 
   // ********************************* Methods ********************************
 
   // --- init -----------------------------------------------------------------
 
   // --- get&set --------------------------------------------------------------
 
   // --- business -------------------------------------------------------------
 
   {
     if ( == null)
     {
       final Build build = .getBuild();
       final String classesDir = build.getOutputDirectory();
       final File jarFile = new File(classesDir"META-INF/" + );
       final File targetDir = new File(build.getDirectory());
       final String finalName = build.getFinalName();
       final File deploymentUnitFile =
           new File(targetDirfinalName + "/META-INF/" + );
 
       .add(new FileMapping("pom"new File(targetDir,
           ))); // NOPMD
       .add(new FileMapping("war"deploymentUnitFile));
       .add(new FileMapping("ear"deploymentUnitFile));
       .add(new FileMapping("sar"deploymentUnitFile));
       .add(new FileMapping("rar"deploymentUnitFile));
       .add(new FileMapping("par"deploymentUnitFile));
       .add(new FileMapping("jar"jarFile));
       .add(new FileMapping("bundle"jarFile));
       .add(new FileMapping("ejb"jarFile));
       .add(new FileMapping("maven-plugin"jarFile));
       .add(new FileMapping("atlassian-plugin"jarFile));
          .add(new FileMapping("maven-archetype"jarFile));
      .add(new FileMapping("eclipse-plugin"new File(
          targetDir)));
      .add(new FileMapping("eclipse-feature",
          new File(targetDir)));
      .add(new FileMapping("eclipse-repository",
          new File(targetDir)));
      .add(new FileMapping("eclipse-update-site",
          new File(targetDir)));
      .add(new FileMapping("targetplatform"new File(
          targetDir)));
      return ;
    }
  }

  
Returns the output location for the build meta data properties.

Returns:
the output location for the build meta data properties.
  File getPropertiesOutputFile(final boolean activatePropertyOutputFileMapping,
      final File propertiesOutputFile)
  {
    if (activatePropertyOutputFileMapping)
    {
      final String packaging = .getPackaging();
      for (final FileMapping mapping : )
      {
        if (packaging.equals(mapping.getPackaging()))
        {
          return mapping.getOutputFile();
        }
      }
    }
    return propertiesOutputFile;
  }
  // --- object basics --------------------------------------------------------
New to GrepCode? Check out our FAQ X