maven-m2-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject cvs commit: maven-components/maven-plugins/maven-pom-plugin/src/main/java/org/apache/maven/plugin/pom PomDeployMojo.java PomInstallMojo.java
Date Mon, 05 Jul 2004 10:54:50 GMT
evenisse    2004/07/05 03:54:50

  Added:       maven-plugins/maven-pom-plugin .cvsignore pom.xml
               maven-plugins/maven-pom-plugin/src/main/java/org/apache/maven/plugin/pom
                        PomDeployMojo.java PomInstallMojo.java
  Log:
  Initial version of pom plugin
  
  Revision  Changes    Path
  1.1                  maven-components/maven-plugins/maven-pom-plugin/.cvsignore
  
  Index: .cvsignore
  ===================================================================
  *~
  *.log
  target
  .classpath
  .project
  *.ipr
  *.iws
  
  
  
  1.1                  maven-components/maven-plugins/maven-pom-plugin/pom.xml
  
  Index: pom.xml
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  
  <project>
    <parent>
      <groupId>maven</groupId>
      <artifactId>maven-plugin-parent</artifactId>
      <version>2.0-SNAPSHOT</version>
    </parent>
    <groupId>maven</groupId>
    <artifactId>maven-pom-plugin</artifactId>
    <type>plugin</type>  
    <name>Maven POM Plugin</name>
    <version>1.0-SNAPSHOT</version>
    <package>org.apache.maven.plugin.pom</package>
  
    <dependencies>
      <dependency>
        <groupId>maven</groupId>
        <artifactId>maven-core</artifactId>
        <version>2.0-SNAPSHOT</version>
      </dependency>
    </dependencies>
  
  
  </project>
  
  
  
  1.1                  maven-components/maven-plugins/maven-pom-plugin/src/main/java/org/apache/maven/plugin/pom/PomDeployMojo.java
  
  Index: PomDeployMojo.java
  ===================================================================
  package org.apache.maven.plugin.jar;
  
  /*
   * Copyright 2001-2004 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;
  import org.apache.maven.project.MavenProject;
  import org.apache.maven.artifact.installer.ArtifactInstaller;
  import org.apache.maven.artifact.deployer.ArtifactDeployer;
  import org.codehaus.plexus.util.FileUtils;
  
  import java.io.File;
  
  /**
   * @goal deploy
   *
   * @description deploys a pom to remote repository
   *
   * @parameter
   *  name="project"
   *  type="org.apache.maven.project.MavenProject"
   *  required="true"
   *  validator=""
   *  expression="#project"
   *  description=""
   *
   * @parameter
   *  name="deployer"
   *  type="org.apache.maven.artifact.deployer.ArtifactDeployer"
   *  required="true"
   *  validator=""
   *  expression="#component.org.apache.maven.artifact.deployer.ArtifactDeployer"
   *  description=""
   */
  public class PomDeployMojo
      extends AbstractPlugin
  {
      public void execute( PluginExecutionRequest request, PluginExecutionResponse response
)
          throws Exception
      {
          MavenProject project = (MavenProject) request.getParameter( "project" );
  
          ArtifactDeployer artifactDeployer = (ArtifactDeployer) request.getParameter( "deployer"
);
  
          artifactDeployer.deploy( project.getFile(), "pom", project );
      }
  }
  
  
  
  1.1                  maven-components/maven-plugins/maven-pom-plugin/src/main/java/org/apache/maven/plugin/pom/PomInstallMojo.java
  
  Index: PomInstallMojo.java
  ===================================================================
  package org.apache.maven.plugin.jar;
  
  /*
   * Copyright 2001-2004 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;
  import org.apache.maven.project.MavenProject;
  import org.apache.maven.artifact.installer.ArtifactInstaller;
  import org.codehaus.plexus.util.FileUtils;
  
  import java.io.File;
  
  /**
   * @goal install
   *
   * @description install a jar in local repository
   *
   * @parameter
   *  name="project"
   *  type="org.apache.maven.project.MavenProject"
   *  required="true"
   *  validator=""
   *  expression="#project"
   *  description=""
   *
   * @parameter
   *  name="installer"
   *  type="org.apache.maven.artifact.installer.ArtifactInstaller"
   *  required="true"
   *  validator=""
   *  expression="#component.org.apache.maven.artifact.installer.ArtifactInstaller"
   *  description=""
   */
  public class PomInstallMojo
      extends AbstractPlugin
  {
      public void execute( PluginExecutionRequest request, PluginExecutionResponse response
)
          throws Exception
      {
          MavenProject project = (MavenProject) request.getParameter( "project" );
  
          ArtifactInstaller artifactInstaller = (ArtifactInstaller) request.getParameter(
"installer" );
  
          artifactInstaller.install( project.getFile(), "pom", project );
      }
  }
  
  
  

Mime
View raw message