Author: khmarbaise
Date: Tue Apr 5 18:18:36 2016
New Revision: 1737868
URL: http://svn.apache.org/viewvc?rev=1737868&view=rev
Log:
[MJAR-210] Remove useDefaultManifestFile parameter
o Added build failure in case of the usage of the
previously removed parameter.
Added:
maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-210/
maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-210/invoker.properties
maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-210/pom.xml
Modified:
maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugins/jar/AbstractJarMojo.java
maven/plugins/trunk/maven-jar-plugin/src/site/apt/index.apt.vm
Added: maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-210/invoker.properties
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-210/invoker.properties?rev=1737868&view=auto
==============================================================================
--- maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-210/invoker.properties
(added)
+++ maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-210/invoker.properties Tue
Apr 5 18:18:36 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.goals = clean package
+invoker.buildResult = failure
Added: maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-210/pom.xml
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-210/pom.xml?rev=1737868&view=auto
==============================================================================
--- maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-210/pom.xml (added)
+++ maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-210/pom.xml Tue Apr 5
18:18:36 2016
@@ -0,0 +1,42 @@
+<?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/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin-test-mjar-210</artifactId>
+ <version>1.0</version>
+ <name>Maven</name>
+ <packaging>jar</packaging>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>@project.version@</version>
+ <configuration>
+ <useDefaultManifestFile>true</useDefaultManifestFile>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Modified:
maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugins/jar/AbstractJarMojo.java
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugins/jar/AbstractJarMojo.java?rev=1737868&r1=1737867&r2=1737868&view=diff
==============================================================================
---
maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugins/jar/AbstractJarMojo.java
(original)
+++
maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugins/jar/AbstractJarMojo.java
Tue Apr 5 18:18:36 2016
@@ -101,6 +101,16 @@ public abstract class AbstractJarMojo
private MavenArchiveConfiguration archive = new
MavenArchiveConfiguration();
/**
+ * Using this property will fail your build cause it has been removed from
the plugin configuration. See the
+ * <a href="https://maven.apache.org/plugins/maven-jar-plugin/">Major
Version Upgrade to version 3.0.0</a> for the
+ * plugin.
+ *
+ * @deprecated For version 3.0.0 this parameter is only defined here to
break the build if you use it!
+ */
+ @Parameter( property = "jar.useDefaultManifestFile", defaultValue =
"false" )
+ private boolean useDefaultManifestFile;
+
+ /**
*
*/
@Component
@@ -148,7 +158,6 @@ public abstract class AbstractJarMojo
*/
protected abstract String getType();
-
/**
* Returns the Jar file to generate, based on an optional classifier.
*
@@ -182,7 +191,6 @@ public abstract class AbstractJarMojo
/**
* Generates the JAR.
- *
*/
public File createArchive()
throws MojoExecutionException
@@ -222,11 +230,17 @@ public abstract class AbstractJarMojo
/**
* Generates the JAR.
- *
*/
public void execute()
throws MojoExecutionException
{
+ if ( useDefaultManifestFile )
+ {
+ throw new MojoExecutionException( "You are using
'useDefaultManifestFile' which has been removed"
+ + " from the maven-jar-plugin. "
+ + "Please see the >>Major Version Upgrade to version 3.0.0<<
on the plugin site." );
+ }
+
if ( skipIfEmpty && ( !getClassesDirectory().exists() ||
getClassesDirectory().list().length < 1 ) )
{
getLog().info( "Skipping packaging of the " + getType() );
Modified: maven/plugins/trunk/maven-jar-plugin/src/site/apt/index.apt.vm
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jar-plugin/src/site/apt/index.apt.vm?rev=1737868&r1=1737867&r2=1737868&view=diff
==============================================================================
--- maven/plugins/trunk/maven-jar-plugin/src/site/apt/index.apt.vm (original)
+++ maven/plugins/trunk/maven-jar-plugin/src/site/apt/index.apt.vm Tue Apr 5
18:18:36 2016
@@ -40,6 +40,38 @@ ${project.name}
[]
+* Major Version Upgrade to version 3.0.0
+
+ Please note that the following parameter has been completely removed from
the plugin configuration:
+
+ * useDefaultManifestFile
+
+ If you need to define your own <<MANIFEST.MF>> file you can simply achieve
that via
+ {{{http://maven.apache.org/shared/maven-archiver/index.html}Maven Archiver}}
configuration
+ like in the following example:
+
++-----------------+
+<project>
+ ...
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>${project.version}</version>
+ <configuration>
+ <archive>
+
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
+ </archive>
+ </configuration>
+ ...
+ </plugin>
+ </plugins>
+ </build>
+ ...
+</project>
++-----------------+
+
* Usage
General instructions on how to use the JAR Plugin can be found on the
{{{./usage.html}usage page}}. Some more