From abbecd7c82a50bdf8e0af6e34aee4a9b5f22af27 Mon Sep 17 00:00:00 2001 From: Emmanuel Venisse Date: Thu, 10 Mar 2005 09:37:44 +0000 Subject: [PATCH] Remove unused classes. git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163516 13f79535-47bb-0310-9956-ffa450edef68 --- .../maven/plugin/jar/AbstractJarMojo.java | 180 ------------------ .../apache/maven/plugin/war/ExplodedMojo.java | 106 ----------- 2 files changed, 286 deletions(-) delete mode 100644 maven-plugins/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/AbstractJarMojo.java delete mode 100644 maven-plugins/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/ExplodedMojo.java diff --git a/maven-plugins/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/AbstractJarMojo.java b/maven-plugins/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/AbstractJarMojo.java deleted file mode 100644 index bb2af436bb..0000000000 --- a/maven-plugins/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/AbstractJarMojo.java +++ /dev/null @@ -1,180 +0,0 @@ -package org.apache.maven.plugin.jar; - -/** - * - * Copyright 2004-2005 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. - */ - -import org.apache.maven.artifact.Artifact; -import org.apache.maven.model.Dependency; -import org.apache.maven.plugin.AbstractPlugin; -import org.apache.maven.plugin.PluginExecutionRequest; -import org.apache.maven.project.MavenProject; -import org.codehaus.plexus.archiver.jar.Manifest; - -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -/** - * Base class for tasks that build archives in JAR file format. - * - * @author Emmanuel Venisse - * @version $Revision$ $Date$ - */ -public abstract class AbstractJarMojo - extends AbstractPlugin -{ - /** - * Return a pre-configured manifest - * - * @todo Add user attributes list and user groups list - */ - public Manifest getManifest( PluginExecutionRequest request ) - throws Exception - { - MavenProject project = (MavenProject) request.getParameter( "project" ); - - String mainClass = (String) request.getParameter( "mainClass" ); - - boolean addClasspath = new Boolean( (String) request.getParameter( "addClasspath" ) ).booleanValue(); - - boolean addExtensions = new Boolean( (String) request.getParameter( "addExtensions" ) ).booleanValue(); - - // Added basic entries - Manifest m = new Manifest(); - Manifest.Attribute buildAttr = new Manifest.Attribute( "Built-By", System.getProperty( "user.name" ) ); - m.addConfiguredAttribute( buildAttr ); - Manifest.Attribute createdAttr = new Manifest.Attribute( "Created-By", "Apache Maven" ); - m.addConfiguredAttribute( createdAttr ); -/* TODO: property on plugin - Manifest.Attribute packageAttr = new Manifest.Attribute( "Package", project.getPackage() ); - m.addConfiguredAttribute( packageAttr ); -*/ - Manifest.Attribute buildJdkAttr = new Manifest.Attribute( "Build-Jdk", System.getProperty( "java.version" ) ); - m.addConfiguredAttribute( buildJdkAttr ); - - if ( addClasspath ) - { - StringBuffer classpath = new StringBuffer(); - List dependencies = project.getDependencies(); - - for ( Iterator iter = dependencies.iterator(); iter.hasNext(); ) - { - Dependency dependency = (Dependency) iter.next(); -/* TODO: property on plugin - Properties properties = dependency.getProperties(); - if ( Boolean.valueOf(properties.getProperty("jar.manifest.classpath")).booleanValue()) - { - if (classpath.length() > 0 ) - { - classpath.append( " " ); - } - - // TODO replace dependency by artifact - classpath.append( dependency.getArtifactId() + "-" + dependency.getVersion() + ".jar"); - } -*/ - } - - Manifest.Attribute classpathAttr = new Manifest.Attribute( "Class-Path", classpath.toString() ); - m.addConfiguredAttribute( classpathAttr ); - } - - // Added supplementary entries - Manifest.Attribute extensionNameAttr = new Manifest.Attribute( "Extension-Name", project.getArtifactId() ); - m.addConfiguredAttribute( extensionNameAttr ); - - if ( project.getDescription() != null ) - { - Manifest.Attribute specificationTitleAttr = new Manifest.Attribute( "Specification-Title", - project.getDescription() ); - m.addConfiguredAttribute( specificationTitleAttr ); - } - - if ( project.getOrganization() != null ) - { - Manifest.Attribute specificationVendor = new Manifest.Attribute( "Specification-Vendor", - project.getOrganization().getName() ); - m.addConfiguredAttribute( specificationVendor ); - Manifest.Attribute implementationVendorAttr = new Manifest.Attribute( "Implementation-Vendor", - project.getOrganization().getName() ); - m.addConfiguredAttribute( implementationVendorAttr ); - } - - Manifest.Attribute implementationTitleAttr = new Manifest.Attribute( "Implementation-Title", - project.getArtifactId() ); - m.addConfiguredAttribute( implementationTitleAttr ); - Manifest.Attribute implementationVersionAttr = new Manifest.Attribute( "Implementation-Version", - project.getVersion() ); - m.addConfiguredAttribute( implementationVersionAttr ); - - if ( mainClass != null && !"".equals( mainClass ) ) - { - Manifest.Attribute mainClassAttr = new Manifest.Attribute( "Main-Class", mainClass ); - m.addConfiguredAttribute( mainClassAttr ); - } - - // Added extensions - if ( addExtensions ) - { - StringBuffer extensionsList = new StringBuffer(); - Set artifacts = project.getArtifacts(); - - for ( Iterator iter = artifacts.iterator(); iter.hasNext(); ) - { - Artifact artifact = (Artifact) iter.next(); - if ( "jar".equals( artifact.getType() ) ) - { - if ( extensionsList.length() > 0 ) - { - extensionsList.append( " " ); - } - extensionsList.append( artifact.getArtifactId() ); - } - } - - if ( extensionsList.length() > 0 ) - { - Manifest.Attribute extensionsListAttr = new Manifest.Attribute( "Extension-List", - extensionsList.toString() ); - m.addConfiguredAttribute( extensionsListAttr ); - } - - for ( Iterator iter = artifacts.iterator(); iter.hasNext(); ) - { - Artifact artifact = (Artifact) iter.next(); - if ( "jar".equals( artifact.getType() ) ) - { - Manifest.Attribute archExtNameAttr = new Manifest.Attribute( artifact.getArtifactId() + - "-Extension-Name", - artifact.getArtifactId() ); - m.addConfiguredAttribute( archExtNameAttr ); - Manifest.Attribute archImplVersionAttr = new Manifest.Attribute( artifact.getArtifactId() + - "-Implementation-Version", - artifact.getVersion() ); - m.addConfiguredAttribute( archImplVersionAttr ); - Manifest.Attribute archImplUrlAttr = new Manifest.Attribute( artifact.getArtifactId() + - "-Implementation-URL", - "http://www.ibiblio.org/maven/" + - artifact.toString() ); - m.addConfiguredAttribute( archImplUrlAttr ); - } - } - } - - return m; - } -} diff --git a/maven-plugins/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/ExplodedMojo.java b/maven-plugins/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/ExplodedMojo.java deleted file mode 100644 index 280e8d3db8..0000000000 --- a/maven-plugins/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/ExplodedMojo.java +++ /dev/null @@ -1,106 +0,0 @@ -package org.apache.maven.plugin.war; - -/* - * Copyright 2001-2005 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. - */ - -import org.apache.maven.plugin.AbstractPlugin; -import org.apache.maven.plugin.PluginExecutionRequest; -import org.apache.maven.plugin.PluginExecutionResponse; - -/** - * @author Emmanuel Venisse - * @version $Id$ - * @goal exploded - * @phase process-classes - * @description build a jar - * @parameter name="jarName" - * type="String" - * required="true" - * validator="" - * expression="#project.build.finalName" - * description="" - * @parameter name="compress" - * type="String" - * required="false" - * validator="" - * expression="#maven.jar.compress" - * default="true" - * description="" - * @parameter name="index" - * type="String" - * required="false" - * validator="" - * expression="#maven.jar.index" - * default="false" - * description="" - * @parameter name="manifest" - * type="String" - * required="false" - * validator="" - * expression="#maven.jar.manifest" - * description="" - * @parameter name="mainClass" - * type="String" - * required="false" - * validator="" - * expression="#maven.jar.mainClass" - * description="" - * @parameter name="addClasspath" - * type="String" - * required="false" - * validator="" - * expression="#maven.jar.addClasspath" - * default="false" - * description="" - * @parameter name="addExtensions" - * type="String" - * required="false" - * validator="" - * expression="#maven.jar.addExtensions" - * default="false" - * description="" - * @parameter name="outputDirectory" - * type="String" - * required="true" - * validator="" - * expression="#project.build.outputDirectory" - * description="" - * @parameter name="basedir" - * type="String" - * required="true" - * validator="" - * expression="#project.build.directory" - * description="" - * @parameter name="project" - * type="org.apache.maven.project.MavenProject" - * required="true" - * validator="" - * expression="#project" - * description="current MavenProject instance" - */ -public class ExplodedMojo - extends AbstractPlugin -{ - public void execute( PluginExecutionRequest request, PluginExecutionResponse response ) - throws Exception - { - // ---------------------------------------------------------------------- - // - // ---------------------------------------------------------------------- - request.getLog().info( "webapp" ); - - } -} \ No newline at end of file