Start line:  
End line:  

Snippet Preview

Snippet HTML Code

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

Goal that sets a property pointing to the artifact file for each project dependency. For each dependency (direct and transitive) a project property will be set which follows the groupId:artifactId:type:[classifier] form and contains the path to the resolved artifact.

Author(s):
Paul Gier
Version:
$Id: PropertiesMojo.java 1481553 2013-05-12 13:25:34Z hboutemy $
Since:
2.2
 
 @Mojo( name = "properties", requiresDependencyResolution = .,
        defaultPhase = ., threadSafe = true )
 public class PropertiesMojo
     extends AbstractMojo
 {

    
The current Maven project
 
     @Component
     protected MavenProject project;

    
Skip plugin execution completely.

Since:
2.7
 
     @Parameter( property = "mdep.skip", defaultValue = "false" )
     private boolean skip;

    
Main entry into mojo. Gets the list of dependencies and iterates through setting a property for each artifact.

Throws:
org.apache.maven.plugin.MojoExecutionException with a message if an error occurs.
 
     public void execute()
         throws MojoExecutionException
     {
         if ( isSkip() )
         {
             getLog().info"Skipping plugin execution" );
             return;
         }
 
         @SuppressWarnings"unchecked" ) Set<Artifactartifacts = getProject().getArtifacts();
 
         for ( Artifact artifact : artifacts )
         {
             .getProperties().setPropertyartifact.getDependencyConflictId(),
                                                  artifact.getFile().getAbsolutePath() );
         }
     }
 
     public MavenProject getProject()
     {
         return ;
     }
 
     public boolean isSkip()
     {
         return ;
     }
 
     public void setSkipboolean skip )
     {
         this. = skip;
     }
New to GrepCode? Check out our FAQ X