You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by st...@apache.org on 2012/12/18 21:24:30 UTC
svn commit: r1423618 [2/2] - in /commons/sandbox/privilizer/trunk: ant/
ant/lib/ ant/lib/src/main/java/org/apache/commons/privilizer/
ant/lib/src/main/java/org/apache/commons/weaver/
ant/lib/src/main/java/org/apache/commons/weaver/privilizer/ ant/lib/s...
Added: commons/sandbox/privilizer/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/privilizer/maven/WeaveMojo.java
URL: http://svn.apache.org/viewvc/commons/sandbox/privilizer/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/privilizer/maven/WeaveMojo.java?rev=1423618&view=auto
==============================================================================
--- commons/sandbox/privilizer/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/privilizer/maven/WeaveMojo.java (added)
+++ commons/sandbox/privilizer/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/privilizer/maven/WeaveMojo.java Tue Dec 18 20:24:23 2012
@@ -0,0 +1,40 @@
+/*
+ * Copyright the original author or authors.
+ *
+ * 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.
+ */
+package org.apache.commons.weaver.privilizer.maven;
+
+import org.apache.commons.weaver.privilizer.Privileged;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.ResolutionScope;
+
+
+/**
+ * Goal to weave classes with {@link SecurityManager} handling code for methods marked with
+ * the {@link Privileged} annotation.
+ */
+@Mojo(name = "weave", defaultPhase = LifecyclePhase.PROCESS_CLASSES, requiresDependencyCollection = ResolutionScope.COMPILE)
+public class WeaveMojo extends PrivilegedMojo {
+
+ @Override
+ public void execute() throws MojoFailureException {
+ try {
+ createWeaver().weaveAll();
+ } catch (Exception e) {
+ throw new MojoFailureException("failed", e);
+ }
+ }
+}
Propchange: commons/sandbox/privilizer/trunk/maven-plugin/src/main/java/org/apache/commons/weaver/privilizer/maven/WeaveMojo.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: commons/sandbox/privilizer/trunk/modules/privilizer/api/pom.xml
URL: http://svn.apache.org/viewvc/commons/sandbox/privilizer/trunk/modules/privilizer/api/pom.xml?rev=1423618&r1=1423617&r2=1423618&view=diff
==============================================================================
--- commons/sandbox/privilizer/trunk/modules/privilizer/api/pom.xml (original)
+++ commons/sandbox/privilizer/trunk/modules/privilizer/api/pom.xml Tue Dec 18 20:24:23 2012
@@ -24,7 +24,7 @@
<version>0.1-SNAPSHOT</version>
</parent>
- <artifactId>commons-privilizer-api</artifactId>
+ <artifactId>commons-weaver-privilizer-api</artifactId>
<name>Commons Privilizer API</name>
</project>
Modified: commons/sandbox/privilizer/trunk/modules/privilizer/weaver/pom.xml
URL: http://svn.apache.org/viewvc/commons/sandbox/privilizer/trunk/modules/privilizer/weaver/pom.xml?rev=1423618&r1=1423617&r2=1423618&view=diff
==============================================================================
--- commons/sandbox/privilizer/trunk/modules/privilizer/weaver/pom.xml (original)
+++ commons/sandbox/privilizer/trunk/modules/privilizer/weaver/pom.xml Tue Dec 18 20:24:23 2012
@@ -33,7 +33,7 @@
<dependencies>
<dependency>
<groupId>org.apache.commons</groupId>
- <artifactId>commons-privilizer-api</artifactId>
+ <artifactId>commons-weaver-privilizer-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>