mirror of https://github.com/apache/maven.git
Initial version of pom plugin
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@162852 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8574ef445c
commit
85107479c0
|
@ -0,0 +1,7 @@
|
|||
*~
|
||||
*.log
|
||||
target
|
||||
.classpath
|
||||
.project
|
||||
*.ipr
|
||||
*.iws
|
|
@ -0,0 +1,25 @@
|
|||
<?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>
|
|
@ -0,0 +1,62 @@
|
|||
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 );
|
||||
}
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
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 );
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue