mirror of https://github.com/apache/maven.git
remove pom plugin
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163665 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
1e121e8d1a
commit
b022c6038f
|
@ -83,8 +83,8 @@ public class MBoot
|
|||
"maven-plugins/maven-compiler-plugin", "maven-plugins/maven-deploy-plugin",
|
||||
"maven-plugins/maven-ejb-plugin", "maven-plugins/maven-install-plugin",
|
||||
"maven-plugins/maven-jar-plugin", "maven-plugins/maven-plugin-plugin",
|
||||
"maven-plugins/maven-pom-plugin", "maven-plugins/maven-resources-plugin",
|
||||
"maven-plugins/maven-surefire-plugin", "maven-plugins/maven-war-plugin"};
|
||||
"maven-plugins/maven-resources-plugin", "maven-plugins/maven-surefire-plugin",
|
||||
"maven-plugins/maven-war-plugin"};
|
||||
|
||||
private static final Map MODELLO_TARGET_VERSIONS;
|
||||
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
target
|
||||
*~
|
||||
*.log
|
||||
.classpath
|
||||
.project
|
||||
*.ipr
|
||||
*.iws
|
||||
*.iml
|
|
@ -1,54 +0,0 @@
|
|||
<model>
|
||||
<parent>
|
||||
<artifactId>maven-plugin-parent</artifactId>
|
||||
<groupId>maven</groupId>
|
||||
<version>2.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<groupId>maven</groupId>
|
||||
<artifactId>maven-pom-plugin</artifactId>
|
||||
<packaging>maven-plugin</packaging>
|
||||
<name>Maven POM Plugin</name>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>maven</groupId>
|
||||
<artifactId>maven-core</artifactId>
|
||||
<version>2.0-SNAPSHOT</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>maven</groupId>
|
||||
<artifactId>maven-artifact</artifactId>
|
||||
<version>2.0-SNAPSHOT</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>maven</groupId>
|
||||
<artifactId>maven-settings</artifactId>
|
||||
<version>2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>maven</groupId>
|
||||
<artifactId>maven-model</artifactId>
|
||||
<version>2.0-SNAPSHOT</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>maven</groupId>
|
||||
<artifactId>wagon-provider-api</artifactId>
|
||||
<version>1.0-alpha-2-SNAPSHOT</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>maven</groupId>
|
||||
<artifactId>wagon-ssh</artifactId>
|
||||
<version>1.0-alpha-2-SNAPSHOT</version>
|
||||
<type>jar</type>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</model>
|
|
@ -1,94 +0,0 @@
|
|||
package org.apache.maven.plugin.pom;
|
||||
|
||||
/*
|
||||
* 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.artifact.Artifact;
|
||||
import org.apache.maven.artifact.DefaultArtifact;
|
||||
import org.apache.maven.artifact.deployer.ArtifactDeployer;
|
||||
import org.apache.maven.artifact.repository.ArtifactRepository;
|
||||
import org.apache.maven.artifact.repository.ArtifactRepositoryFactory;
|
||||
import org.apache.maven.model.Repository;
|
||||
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.settings.MavenSettings;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* @goal deploy
|
||||
* @description deploys a pom to remote repository
|
||||
* @parameter name="deployer"
|
||||
* type="org.apache.maven.artifact.deployer.ArtifactDeployer"
|
||||
* required="true"
|
||||
* validator=""
|
||||
* expression="#component.org.apache.maven.artifact.deployer.ArtifactDeployer"
|
||||
* description=""
|
||||
* @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=""
|
||||
* @parameter
|
||||
* name="deploymentRepository"
|
||||
* type="org.apache.maven.artifact.repository.ArtifactRepository"
|
||||
* required="true"
|
||||
* validator=""
|
||||
* expression="#project.distributionManagementArtifactRepository"
|
||||
* 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" );
|
||||
|
||||
ArtifactRepository deploymentRepository = (ArtifactRepository) request.getParameter( "deploymentRepository" );
|
||||
|
||||
if ( deploymentRepository == null )
|
||||
{
|
||||
String msg = "Deployment failed: repository element" + " was not specified in the pom inside"
|
||||
+ " distributionManagement element";
|
||||
throw new Exception( msg );
|
||||
}
|
||||
|
||||
if ( deploymentRepository.getAuthenticationInfo() == null )
|
||||
{
|
||||
getLog().warn(
|
||||
"Deployment repository {id: \'" + deploymentRepository.getId()
|
||||
+ "\'} has no associated authentication info!" );
|
||||
}
|
||||
|
||||
Artifact artifact = new DefaultArtifact( project.getGroupId(), project.getArtifactId(), project.getVersion(),
|
||||
"pom" );
|
||||
|
||||
File pom = new File( project.getFile().getParentFile(), "pom.xml" );
|
||||
|
||||
artifactDeployer.deploy( pom, artifact, deploymentRepository );
|
||||
}
|
||||
}
|
|
@ -1,71 +0,0 @@
|
|||
package org.apache.maven.plugin.pom;
|
||||
|
||||
/*
|
||||
* 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.artifact.Artifact;
|
||||
import org.apache.maven.artifact.DefaultArtifact;
|
||||
import org.apache.maven.artifact.installer.ArtifactInstaller;
|
||||
import org.apache.maven.artifact.repository.ArtifactRepository;
|
||||
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 java.io.File;
|
||||
|
||||
/**
|
||||
* @goal install
|
||||
* @description installs project's main artifact 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=""
|
||||
* @parameter name="localRepository"
|
||||
* type="org.apache.maven.artifact.repository.ArtifactRepository"
|
||||
* required="true"
|
||||
* validator=""
|
||||
* expression="#localRepository"
|
||||
* 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" );
|
||||
|
||||
ArtifactRepository localRepository = (ArtifactRepository) request.getParameter( "localRepository" );
|
||||
|
||||
Artifact artifact = new DefaultArtifact( project.getGroupId(), project.getArtifactId(), project.getVersion(),
|
||||
"pom" );
|
||||
|
||||
File pom = new File( project.getFile().getParentFile(), "pom.xml" );
|
||||
|
||||
artifactInstaller.install( pom, artifact, localRepository );
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue