Author: stephenc Date: Tue Nov 3 22:14:46 2009 New Revision: 832580 URL: http://svn.apache.org/viewvc?rev=832580&view=rev Log: work in progress
Added: maven/sandbox/trunk/maven/maven-plugin-enforcer/pom.xml (with props) maven/sandbox/trunk/maven/maven-plugin-enforcer/src/ maven/sandbox/trunk/maven/maven-plugin-enforcer/src/main/ maven/sandbox/trunk/maven/maven-plugin-enforcer/src/main/java/ maven/sandbox/trunk/maven/maven-plugin-enforcer/src/main/java/org/ maven/sandbox/trunk/maven/maven-plugin-enforcer/src/main/java/org/apache/ maven/sandbox/trunk/maven/maven-plugin-enforcer/src/main/java/org/apache/maven/ maven/sandbox/trunk/maven/maven-plugin-enforcer/src/main/java/org/apache/maven/util/ maven/sandbox/trunk/maven/maven-plugin-enforcer/src/main/java/org/apache/maven/util/pluginenforcer/ maven/sandbox/trunk/maven/maven-plugin-enforcer/src/main/java/org/apache/maven/util/pluginenforcer/PluginEnforcingMavenLifecycleParticipant.java (with props) Modified: maven/sandbox/trunk/maven/maven-plugin-enforcer/ (props changed) Propchange: maven/sandbox/trunk/maven/maven-plugin-enforcer/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Tue Nov 3 22:14:46 2009 @@ -0,0 +1,8 @@ +target +.classpath +.settings +.project +bin +*.iml +*.ipr +*.iws Added: maven/sandbox/trunk/maven/maven-plugin-enforcer/pom.xml URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/maven/maven-plugin-enforcer/pom.xml?rev=832580&view=auto ============================================================================== --- maven/sandbox/trunk/maven/maven-plugin-enforcer/pom.xml (added) +++ maven/sandbox/trunk/maven/maven-plugin-enforcer/pom.xml Tue Nov 3 22:14:46 2009 @@ -0,0 +1,98 @@ +<?xml version="1.0" encoding="UTF-8"?> + + <!-- + Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE + file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file + to you 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. + --> + +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.maven</groupId> + <artifactId>maven-parent</artifactId> + <version>12</version> + <relativePath>../pom/maven/pom.xml</relativePath> + </parent> + + <artifactId>maven-plugin-enforcer</artifactId> + <version>3.0-SNAPSHOT</version> + + <name>Apache Maven 3.x Plugin Enforcer</name> + <inceptionYear>2001</inceptionYear> + + <scm> + <connection>scm:svn:http://svn.apache.org/repos/asf/maven/sandbox/trunk/maven/maven-plugin-enforcer</connection> + <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/sandbox/trunk/maven/maven-plugin-enforcer</developerConnection> + <url>http://svn.apache.org/viewcvs.cgi/maven/sandbox/trunk/maven/maven-plugin-enforcer</url> + </scm> + + <!-- FIXME: Remove once snapshots have been released --> + <repositories> + <repository> + <id>sonatype.public</id> + <url>http://repository.sonatype.org/content/repositories/plexus-oss-snapshots</url> + <releases> + <enabled>false</enabled> + </releases> + </repository> + </repositories> + <pluginRepositories> + <pluginRepository> + <id>sonatype.public</id> + <url>http://repository.sonatype.org/content/repositories/plexus-oss-snapshots</url> + <releases> + <enabled>false</enabled> + </releases> + </pluginRepository> + </pluginRepositories> + + <dependencies> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-core</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.2</version> + <scope>test</scope> + </dependency> + </dependencies> + <!--bootstrap-end-comment--> + + <build> + <plugins> + <plugin> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-component-metadata</artifactId> + <version>1.4.1</version> + <executions> + <execution> + <goals> + <goal>generate-metadata</goal> + <goal>generate-test-metadata</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>2.0.2</version> + <configuration> + <source>1.5</source> + <target>1.5</target> + </configuration> + </plugin> + </plugins> + </build> + +</project> Propchange: maven/sandbox/trunk/maven/maven-plugin-enforcer/pom.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/sandbox/trunk/maven/maven-plugin-enforcer/pom.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Added: maven/sandbox/trunk/maven/maven-plugin-enforcer/src/main/java/org/apache/maven/util/pluginenforcer/PluginEnforcingMavenLifecycleParticipant.java URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/maven/maven-plugin-enforcer/src/main/java/org/apache/maven/util/pluginenforcer/PluginEnforcingMavenLifecycleParticipant.java?rev=832580&view=auto ============================================================================== --- maven/sandbox/trunk/maven/maven-plugin-enforcer/src/main/java/org/apache/maven/util/pluginenforcer/PluginEnforcingMavenLifecycleParticipant.java (added) +++ maven/sandbox/trunk/maven/maven-plugin-enforcer/src/main/java/org/apache/maven/util/pluginenforcer/PluginEnforcingMavenLifecycleParticipant.java Tue Nov 3 22:14:46 2009 @@ -0,0 +1,47 @@ +package org.apache.maven.util.pluginenforcer; +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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.AbstractMavenLifecycleParticipant; +import org.apache.maven.MavenExecutionException; +import org.apache.maven.execution.MavenSession; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.component.annotations.Requirement; +import org.codehaus.plexus.logging.Logger; + +/** + * Enforces that a specific version of a plugin is used throughout a build. + * + * @author Stephen Connolly + * @since 03-Nov-2009 21:52:08 + */ +...@component(role = AbstractMavenLifecycleParticipant.class) +public class PluginEnforcingMavenLifecycleParticipant + extends AbstractMavenLifecycleParticipant +{ + + @Requirement + private Logger logger; + + public void afterProjectsRead( MavenSession mavenSession ) + throws MavenExecutionException + { + logger.info( "Hello " + mavenSession.getUserProperties().getProperty("name", "world!!!" )); + } +} Propchange: maven/sandbox/trunk/maven/maven-plugin-enforcer/src/main/java/org/apache/maven/util/pluginenforcer/PluginEnforcingMavenLifecycleParticipant.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/sandbox/trunk/maven/maven-plugin-enforcer/src/main/java/org/apache/maven/util/pluginenforcer/PluginEnforcingMavenLifecycleParticipant.java ------------------------------------------------------------------------------ svn:mime-type = text/plain