You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by kh...@apache.org on 2016/04/23 14:03:02 UTC

svn commit: r1740651 - in /maven/plugins/trunk/maven-jar-plugin: ./ src/it/MJAR-183/ src/it/MJAR-183/src/ src/it/MJAR-183/src/main/ src/it/MJAR-183/src/main/java/ src/main/resources/ src/main/resources/META-INF/ src/main/resources/META-INF/plexus/

Author: khmarbaise
Date: Sat Apr 23 12:03:02 2016
New Revision: 1740651

URL: http://svn.apache.org/viewvc?rev=1740651&view=rev
Log:
[MJAR-183] Move LifecycleMapping and ArtifactHandler from maven-core to target packaging plugin
 o Added components.xml which contains
   ArtifactHandler mapping and life cycle mapping and
   the appropriate plugin versions.
 o Added basic integration tests which checks if
   by using the maven-jar-plugin with extensions=true
   the build will successfully end.

Added:
    maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-183/
    maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-183/invoker.properties
    maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-183/pom.xml   (with props)
    maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-183/src/
    maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-183/src/main/
    maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-183/src/main/java/
    maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-183/src/main/java/A.java   (with props)
    maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-183/verify.bsh
    maven/plugins/trunk/maven-jar-plugin/src/main/resources/
    maven/plugins/trunk/maven-jar-plugin/src/main/resources/META-INF/
    maven/plugins/trunk/maven-jar-plugin/src/main/resources/META-INF/plexus/
    maven/plugins/trunk/maven-jar-plugin/src/main/resources/META-INF/plexus/components.xml
Modified:
    maven/plugins/trunk/maven-jar-plugin/pom.xml

Modified: maven/plugins/trunk/maven-jar-plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jar-plugin/pom.xml?rev=1740651&r1=1740650&r2=1740651&view=diff
==============================================================================
--- maven/plugins/trunk/maven-jar-plugin/pom.xml (original)
+++ maven/plugins/trunk/maven-jar-plugin/pom.xml Sat Apr 23 12:03:02 2016
@@ -132,6 +132,13 @@ under the License.
   </dependencies>
 
   <build>
+    <resources>
+      <resource>
+        <directory>src/main/resources/META-INF/plexus</directory>
+        <filtering>true</filtering>
+        <targetPath>META-INF/plexus</targetPath>
+      </resource>
+    </resources>
     <pluginManagement>
       <plugins>
         <plugin>

Added: maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-183/invoker.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-183/invoker.properties?rev=1740651&view=auto
==============================================================================
--- maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-183/invoker.properties (added)
+++ maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-183/invoker.properties Sat Apr 23 12:03:02 2016
@@ -0,0 +1,19 @@
+# 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.
+
+invoker.description = This test only checks if using extensions works without any issue.
+invoker.goals = clean package

Added: maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-183/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-183/pom.xml?rev=1740651&view=auto
==============================================================================
--- maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-183/pom.xml (added)
+++ maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-183/pom.xml Sat Apr 23 12:03:02 2016
@@ -0,0 +1,41 @@
+<?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>
+  <groupId>org.apache.maven.plugins</groupId>
+  <artifactId>maven-jar-plugin-test-mjar-183</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <description>MJAR-183 integration test</description>
+  <build>
+    <plugins>
+      <plugin>
+        <inherited>false</inherited>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>
+        <version>@project.version@</version>
+        <extensions>true</extensions>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Propchange: maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-183/pom.xml
------------------------------------------------------------------------------
    svn:executable = *

Added: maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-183/src/main/java/A.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-183/src/main/java/A.java?rev=1740651&view=auto
==============================================================================
--- maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-183/src/main/java/A.java (added)
+++ maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-183/src/main/java/A.java Sat Apr 23 12:03:02 2016
@@ -0,0 +1,25 @@
+
+/*
+ * 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.
+ */
+
+public class A {
+    public static void main(String[] args) {
+
+    }
+}

Propchange: maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-183/src/main/java/A.java
------------------------------------------------------------------------------
    svn:executable = *

Added: maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-183/verify.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-183/verify.bsh?rev=1740651&view=auto
==============================================================================
--- maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-183/verify.bsh (added)
+++ maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-183/verify.bsh Sat Apr 23 12:03:02 2016
@@ -0,0 +1,52 @@
+
+/*
+ * 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 java.io.*;
+import java.util.*;
+import java.util.jar.*;
+import org.codehaus.plexus.util.*;
+
+boolean result = true;
+
+try
+{
+    File target = new File( basedir, "target" );
+    if ( !target.exists() || !target.isDirectory() )
+    {
+        System.err.println( "target file is missing or not a directory." );
+        return false;
+    }
+
+    File artifact = new File( target, "maven-jar-plugin-test-mjar-183-1.0-SNAPSHOT.jar" );
+    if ( !artifact.exists() )
+    {
+        System.err.println( "default artifact should exist." );
+        return false;
+    }
+
+    return true;
+}
+catch( Throwable e )
+{
+    e.printStackTrace();
+    return false;
+}
+
+return false;

Added: maven/plugins/trunk/maven-jar-plugin/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jar-plugin/src/main/resources/META-INF/plexus/components.xml?rev=1740651&view=auto
==============================================================================
--- maven/plugins/trunk/maven-jar-plugin/src/main/resources/META-INF/plexus/components.xml (added)
+++ maven/plugins/trunk/maven-jar-plugin/src/main/resources/META-INF/plexus/components.xml Sat Apr 23 12:03:02 2016
@@ -0,0 +1,101 @@
+<?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.
+-->
+
+<component-set>
+  <components>
+    <!--
+      | JAR
+    -->
+    <component>
+      <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
+      <role-hint>jar</role-hint>
+      <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
+      <configuration>
+        <type>jar</type>
+        <language>java</language>
+        <addedToClasspath>true</addedToClasspath>
+      </configuration>
+    </component>
+    <!--
+     | TEST JAR
+     |-->
+    <component>
+      <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
+      <role-hint>test-jar</role-hint>
+      <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
+      <configuration>
+        <classifier>tests</classifier>
+        <extension>jar</extension>
+        <type>test-jar</type>
+        <packaging>jar</packaging>
+        <language>java</language>
+        <addedToClasspath>true</addedToClasspath>
+      </configuration>
+    </component>
+
+    <!--
+      | Defining the phases with their appropriate plugins
+      ! and versions which will be executed during the 'default'
+      ! life cycle.
+    -->
+    <component>
+      <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role>
+      <role-hint>jar</role-hint>
+      <implementation>org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping</implementation>
+      <configuration>
+        <lifecycles>
+          <lifecycle>
+            <id>default</id>
+            <!-- START SNIPPET: jar-lifecycle -->
+            <phases>
+              <process-resources>
+                org.apache.maven.plugins:maven-resources-plugin:2.7:resources
+              </process-resources>
+              <compile>
+                org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile
+              </compile>
+              <process-test-resources>
+                org.apache.maven.plugins:maven-resources-plugin:2.7:testResources
+              </process-test-resources>
+              <test-compile>
+                org.apache.maven.plugins:maven-compiler-plugin:3.5.1:testCompile
+              </test-compile>
+              <test>
+                org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test
+              </test>
+              <package>
+                org.apache.maven.plugins:maven-jar-plugin:${project.version}:jar
+              </package>
+              <install>
+                org.apache.maven.plugins:maven-install-plugin:2.5.2:install
+              </install>
+              <deploy>
+                org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy
+              </deploy>
+            </phases>
+            <!-- END SNIPPET: jar-lifecycle -->
+          </lifecycle>
+        </lifecycles>
+      </configuration>
+    </component>
+
+  </components>
+</component-set>