org.kuali.maven.plugins.graph.mojo.MultiMojo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of graph-maven-plugin Show documentation
Show all versions of graph-maven-plugin Show documentation
Create customizable dependency graphs for Maven projects using Graphviz. The Graphviz "dot" executable needs to be installed and in your path for the plugin to produce graphs - http://www.graphviz.org/
/**
* Copyright 2011-2012 The Kuali Foundation
*
* Licensed under the Educational Community 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.opensource.org/licenses/ecl2.php
*
* 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 org.kuali.maven.plugins.graph.mojo;
import java.io.File;
import java.util.List;
import org.kuali.maven.plugins.graph.pojo.GraphDescriptor;
import org.kuali.maven.plugins.graph.pojo.MojoContext;
import org.kuali.maven.plugins.graph.util.Helper;
/**
*
* Convenience mojo for generating multiple graphs.
*
*
* @goal multi
* @requiresDependencyResolution compile|test|runtime
*/
public class MultiMojo extends BaseGraphMojo {
/**
*
* List of graph descriptors
*
*
*
* For example:
*
*
*
* <descriptors>
* <descriptor>
* <includes>org.slf4j,log4j</includes>
* </descriptor>
* <descriptor>
* <includes>commons-logging</includes>
* <filterType>PATH</filterType>
* </descriptor>
* </descriptors>
*
*
* @parameter
*/
List descriptors;
/**
*
* The directory graphs are generated into.
*
*
* @parameter expression="${graph.outputDir}" default-value="${project.build.directory}/graph"
* @required
*/
File outputDir;
/**
*
* The output format for the graph. This can be any format supported by Graphviz (png, jpg, gif, pdf, ...)
*
*
* @parameter expression="${graph.outputFormat}" default-value="png"
* @required
*/
String outputFormat;
/**
*
* If true, the default set of graphs is generated in addition to those provided in the descriptors
* list.
*
*
* @parameter expression="${graph.generateDefaultGraphs}" default-value="true"
*/
boolean generateDefaultGraphs;
@Override
public void execute() {
MojoContext mc = Helper.copyProperties(MojoContext.class, this);
GraphDescriptor gc = Helper.copyProperties(GraphDescriptor.class, this);
MojoHelper helper = new MojoHelper();
helper.executeMulti(mc, gc, Helper.toEmptyList(descriptors));
}
public File getOutputDir() {
return outputDir;
}
public void setOutputDir(File dir) {
this.outputDir = dir;
}
public boolean isGenerateDefaultGraphs() {
return generateDefaultGraphs;
}
public void setGenerateDefaultGraphs(boolean generateDefaultGraphs) {
this.generateDefaultGraphs = generateDefaultGraphs;
}
public String getOutputFormat() {
return outputFormat;
}
public void setOutputFormat(String type) {
this.outputFormat = type;
}
public List getDescriptors() {
return descriptors;
}
public void setDescriptors(List descriptors) {
this.descriptors = descriptors;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy