
com.thesett.catalogue.maven.CatalogueMojo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of catalogue-maven-plugin Show documentation
Show all versions of catalogue-maven-plugin Show documentation
Maven plugin for the Catalogue to generate code from a catalogue model.
/*
* Copyright The Sett Ltd, 2005 to 2014.
*
* 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.thesett.catalogue.maven;
import java.lang.reflect.Constructor;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.project.MavenProject;
import com.thesett.catalogue.config.ModelLoaderConfigBean;
import com.thesett.catalogue.generator.ChainedGenerator;
import com.thesett.catalogue.model.Catalogue;
import com.thesett.common.config.ConfigException;
import com.thesett.common.config.Configurator;
import com.thesett.common.util.ReflectionUtils;
/**
* CatalogueMojo implements a Maven 2 plugin, that invokes code generators derived from
* {@link com.thesett.catalogue.generator.BaseGenerator}, with parameters defined in the POM.
*
*
CRC Card
* Responsibilities Collaborations
* Call the source code generators with arguments passed from the POM.
*
*
* @author Rupert Smith
* @goal generate
* @phase generate-sources
* @requiresDependencyResolution compile
*/
public class CatalogueMojo extends AbstractMojo
{
/** Holds the resource name of the configuration. */
private static final String CONFIG = "generator-config.xml";
/**
* The maven project model.
*
* @parameter property="project"
* @required
* @readonly
*/
public MavenProject project;
/**
* The model file, to generate from.
*
* @parameter property="model"
*/
public String model;
/**
* The optional template override dir, to load custom templates from.
*
* @parameter property="templateDir"
*/
public String templateDir;
/**
* The debug functors file name.
*
* @parameter property="debugModelFilename"
*/
public String debugModelFilename;
/**
* The generator definitions.
*
* @parameter property="generators"
*/
public List© 2015 - 2025 Weber Informatics LLC | Privacy Policy