Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package org.apache.maven.plugin.nar;
  
  /*
   * Licensed to the Apache Software Foundation (ASF) under one
   * or more contributor license agreements.  See the NOTICE file
   * distributed with this work for additional information
   * regarding copyright ownership.  The ASF licenses this file
   * to you 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.
  */
 
 import java.io.File;
 

Author(s):
Mark Donszelmann
 
 public abstract class AbstractNarMojo
     extends AbstractMojo
     implements NarConstants
 {

    
Skip running of NAR plugins (any) altogether.

Parameter:
expression="${nar.skip}" default-value="false"
 
     private boolean skip;

    
Ignore errors and failures.

Parameter:
expression="${nar.ignore}" default-value="false"
 
     private boolean ignore;

    
The Architecture for the nar, Some choices are: "x86", "i386", "amd64", "ppc", "sparc", ... Defaults to a derived value from ${os.arch}

Parameter:
expression="${os.arch}"
Required:
 
     private String architecture;

    
The Operating System for the nar. Some choices are: "Windows", "Linux", "MacOSX", "SunOS", ... Defaults to a derived value from ${os.name} FIXME table missing

Parameter:
expression=""
 
     private String os;

    
Architecture-OS-Linker name. Defaults to: arch-os-linker.

Parameter:
expression=""
 
     private String aol;

    
Linker

Parameter:
expression=""
 
     private Linker linker;

    

Parameter:
expression="${project.build.directory}"
Readonly:
 
     private File outputDirectory;

    

Parameter:
expression="${project.basedir}"
Readonly:
 
     private File baseDir;

    

Parameter:
expression="${project.build.finalName}"
Readonly:
 
    private String finalName;

    
Target directory for Nar file construction. Defaults to "${project.build.directory}/nar" for "nar-compile" goal

Parameter:
expression=""
    private File targetDirectory;

    
Target directory for Nar test construction. Defaults to "${project.build.directory}/test-nar" for "nar-testCompile" goal

Parameter:
expression=""
    private File testTargetDirectory;

    
Target directory for Nar file unpacking. Defaults to "${targetDirectory}"

Parameter:
expression=""
    private File unpackDirectory;

    
Target directory for Nar test unpacking. Defaults to "${testTargetDirectory}"

Parameter:
expression=""
    private File testUnpackDirectory;

    
Layout to be used for building and unpacking artifacts

Parameter:
expression="${nar.layout}" default-value="org.apache.maven.plugin.nar.NarLayout21"
Required:
    private String layout;
    
    private NarLayout narLayout;

    

Parameter:
expression="${project}"
Readonly:
Required:
    private MavenProject mavenProject;
    private AOL aolId;
    protected final void validate()
    {
         = NarUtil.getLinker );
         = NarUtil.getArchitecture );
         = NarUtil.getOS );
         = NarUtil.getAOL( );
        
        Model model = .getModel();
        Properties properties = model.getProperties();
        properties.setProperty("nar.arch"getArchitecture());
        properties.setProperty("nar.os"getOS());
        properties.setProperty("nar.linker"getLinker().getName());
        properties.setProperty("nar.aol".toString());
        properties.setProperty("nar.aol.key".getKey());
        model.setProperties(properties);
        if (  == null )
        {
             = new File.getBuild().getDirectory(), "nar" );
        }
        if (  == null )
        {
             = new File.getBuild().getDirectory(), "test-nar" );
        }
        if (  == null )
        {
             = ;
        }
        if (  == null )
        {
             = ;
        }
    }
    protected final String getArchitecture()
    {
        return ;
    }
    protected final String getOS()
    {
        return ;
    }
    protected final AOL getAOL()
    {
        return ;
    }
    protected final Linker getLinker()
    {
        return ;
    }
    
    protected final File getBasedir()
    {
    	return ;
    }
    protected final File getOutputDirectory()
    {
        return ;
    }
    protected final String getFinalName()
    {
        return ;
    }
    protected final File getTargetDirectory()
    {
        return ;
    }
    protected final File getTestTargetDirectory()
    {
        return ;
    }
    protected final File getUnpackDirectory()
    {
        return ;
    }
    protected final File getTestUnpackDirectory()
    {
        return ;
    }
    protected final NarLayout getLayout()
        throws MojoExecutionException
    {
        if (  == null )
        {
             =
                AbstractNarLayout.getLayoutgetLog() );
        }
        return ;
    }
    protected final MavenProject getMavenProject()
    {
        return ;
    }
    public final void execute()
    {
        if (  )
        {
            getLog().infogetClass().getName() + " skipped" );
            return;
        }
        try
        {
            validate();
            narExecute();
        }
        catch ( MojoFailureException mfe )
        {
            if (  )
            {
                getLog().warn"IGNORED: " + mfe.getMessage() );
            }
            else
            {
                throw mfe;
            }
        }
        catch ( MojoExecutionException mee )
        {
            if (  )
            {
                getLog().warn"IGNORED: " + mee.getMessage() );
            }
            else
            {
                throw mee;
            }
        }
    }
    public abstract void narExecute()
New to GrepCode? Check out our FAQ X