org.ow2.util.maven.plugin.rmic.AbstractRmicMojo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of util-maven-plugin-antrmic Show documentation
Show all versions of util-maven-plugin-antrmic Show documentation
Execute rmic ant task with com.sun classes
The newest version!
/**
* OW2 Util
* Copyright (C) 2007-2010 Bull S.A.S.
* Contact: [email protected]
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* --------------------------------------------------------------------------
* $Id: AbstractRmicMojo.java 5515 2010-05-31 10:28:04Z loris $
* --------------------------------------------------------------------------
*/
/*
* Copyright 2005-2006 The Apache Software Foundation.
*
* 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 org.ow2.util.maven.plugin.rmic;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.DependencyResolutionRequiredException;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.project.MavenProject;
import org.apache.tools.ant.DefaultLogger;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Target;
import org.apache.tools.ant.taskdefs.Rmic;
import org.apache.tools.ant.taskdefs.Rmic.ImplementationSpecificArgument;
import org.apache.tools.ant.types.Path;
import org.codehaus.plexus.util.StringUtils;
/**
* Maven Rmic Mojo.
* @author Gael Lalire
*/
public abstract class AbstractRmicMojo extends AbstractMojo {
/**
* @parameter expression="${project}"
* @required
* @readonly
*/
private MavenProject mavenProject;
/**
* This folder is added to the list of those folders containing source to be
* compiled. Use this if your ant script generates source code.
*
* @parameter expression="${sourceRoot}"
*/
private File sourceRoot;
/**
* This folder is added to the list of those folders containing source to be
* compiled for testing. Use this if your ant script generates test source
* code.
*
* @parameter expression="${testSourceRoot}"
*/
private File testSourceRoot;
/**
* The plugin dependencies.
*
* @parameter expression="${plugin.artifacts}"
* @required
* @readonly
*/
private List artifacts;
/* BEGIN APACHE ANT RMIC (these variables are specific to rmic plugin) */
/**
* Compiler.
*
* @parameter expression="${compiler}"
* @readonly
*/
private String compiler;
/**
* Ant rmic task param.
* @parameter expression="${classname}"
* @required
*/
private String classname;
/**
* Ant rmic task param.
* @parameter expression="${stubVersion}"
*/
private String stubVersion;
/**
* Ant rmic task param.
* @parameter expression="${verify}" default-value="false"
*/
private boolean verify;
/**
* Ant rmic task param.
* @parameter expression="${filtering}" default-value="false"
*/
private boolean filtering;
/**
* Ant rmic task param.
* @parameter expression="${iiop}" default-value="false"
*/
private boolean iiop;
/**
* Ant rmic task param.
* @parameter expression="${iiopOpts}"
*/
private String iiopOpts;
/**
* Ant rmic task param.
* @parameter expression="${idl}" default-value="false"
*/
private boolean idl;
/**
* Ant rmic task param.
* @parameter expression="${idlOpts}"
*/
private String idlOpts;
/**
* Ant rmic task param.
* @parameter expression="${debug}" default-value="false"
*/
private boolean debug;
// TODO extDir create a pojo for creation of a path
// IGNORE private Path compileClasspath;
// IGNORE private Path extDirs;
// IGNORE private boolean includeAntRuntime = true;
// IGNORE private boolean includeJavaRuntime = false;
// IGNORE private Vector compileList = new Vector();
// IGNORE private ClassLoader loader = null;
// IGNORE private FacadeTaskHelper facade;
/* END APACHE ANT RMIC */
/**
* Compiler args.
* @parameter expression="${compilerarg}"
*/
private String compilerarg;
/**
* Create ant task with properties of the mojo.
* @return Ant target which contain rmic Task
* @throws DependencyResolutionRequiredException when getCompileClasspathElements failed
*/
@SuppressWarnings("unchecked")
public Target createAntTask() throws DependencyResolutionRequiredException {
Target target = new Target();
Project antProject = new Project();
target.setName("");
antProject.setName("DummyProject");
target.setProject(antProject);
antProject.addTarget(target);
Rmic antRmic = new Rmic();
antRmic.setTaskName("rmic");
antRmic.setProject(antProject);
antProject.init();
final ArrayList © 2015 - 2025 Weber Informatics LLC | Privacy Policy