Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package org.apache.maven.plugin.ant;
  
  /*
   * 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.util.List;

Generate Ant build files.

Author(s):
Brett Porter
Version:
$Id: AntMojo.java 510478 2007-02-22 12:29:45Z vsiveton $
Goal:
ant
RequiresDependencyResolution:
test
Todo:
change this to use the artifact ant tasks instead of :get
 
 public class AntMojo
     extends AbstractMojo
 {
    
The project to create a build for.

Parameter:
expression="${project}"
Required:
 
     private MavenProject project;

    
Used for resolving artifacts

Component:
 
     private ArtifactResolver resolver;

    
Factory for creating artifact objects

Component:
 
     private ArtifactFactory factory;

    
The local repository where the artifacts are located

Parameter:
expression="${localRepository}"
Required:
 
     private ArtifactRepository localRepository;

    
The remote repositories where artifacts are located

Parameter:
expression="${project.remoteArtifactRepositories}"
 
     private List remoteRepositories;

    
The current user system settings for use in Maven.

Parameter:
expression="${settings}"
Required:
Readonly:
 
     private Settings settings;

    
Overwrite or not the build.xml

Parameter:
expression="${overwrite}" default-value="false"
 
     private boolean overwrite;

    
    public void execute()
        throws MojoExecutionException
    {
        ArtifactResolverWrapper artifactResolverWrapper = ArtifactResolverWrapper.getInstance,
                                                                                       ,
                                                                                        );
        AntBuildWriter antBuildWriter = new AntBuildWriterartifactResolverWrapper );
        try
        {
            antBuildWriter.writeBuildXmls();
            antBuildWriter.writeBuildProperties();
        }
        catch ( IOException e )
        {
            throw new MojoExecutionException"Error building Ant script: " + e.getMessage(), e );
        }
        getLog().info(
                       "Wrote Ant project for " + .getArtifactId() + " to "
                           + .getBasedir().getAbsolutePath() );
    }
New to GrepCode? Check out our FAQ X