diff --git a/src/it/gh-554/invoker.properties b/src/it/gh-554/invoker.properties new file mode 100644 index 00000000..9e5e2cea --- /dev/null +++ b/src/it/gh-554/invoker.properties @@ -0,0 +1,18 @@ +# 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=war:exploded diff --git a/src/it/gh-554/pom.xml b/src/it/gh-554/pom.xml new file mode 100644 index 00000000..e2613252 --- /dev/null +++ b/src/it/gh-554/pom.xml @@ -0,0 +1,53 @@ + + + + 4.0.0 + testwar + gh-554 + war + 1.0-SNAPSHOT + gh-554 Maven Webapp + https://github.com/apache/maven-war-plugin/issues/554 + + + + org.apache.commons + commons-lang3 + 3.19.0 + + + commons-io + commons-io + 2.20.0 + + + + + + + maven-war-plugin + @project.version@ + + WEB-INF/lib/*io*.jar + + + + + diff --git a/src/it/gh-554/src/main/webapp/web.xml b/src/it/gh-554/src/main/webapp/web.xml new file mode 100644 index 00000000..6a8fa709 --- /dev/null +++ b/src/it/gh-554/src/main/webapp/web.xml @@ -0,0 +1,24 @@ + + + + Archetype Created Web Application + diff --git a/src/it/gh-554/verify.groovy b/src/it/gh-554/verify.groovy new file mode 100644 index 00000000..2a8f2215 --- /dev/null +++ b/src/it/gh-554/verify.groovy @@ -0,0 +1,23 @@ +/* + * 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. + */ + +def libDirectory = new File(basedir, 'target/gh-554-1.0-SNAPSHOT/WEB-INF/lib'); + +// only one dependency should be copied +assert libDirectory.list().length == 1 \ No newline at end of file diff --git a/src/main/java/org/apache/maven/plugins/war/AbstractWarMojo.java b/src/main/java/org/apache/maven/plugins/war/AbstractWarMojo.java index 2a357b05..434ed379 100644 --- a/src/main/java/org/apache/maven/plugins/war/AbstractWarMojo.java +++ b/src/main/java/org/apache/maven/plugins/war/AbstractWarMojo.java @@ -230,6 +230,26 @@ public abstract class AbstractWarMojo extends AbstractMojo { @Parameter private String dependentWarExcludes = StringUtils.join(Overlay.DEFAULT_EXCLUDES, ","); + /** + * The comma separated list of tokens to exclude from the WAR before packaging. This option may be used to implement + * the skinny WAR use case. Note that you can use the Java Regular Expressions engine to include and exclude + * specific pattern using the expression %regex[]. Hint: read the about (?!Pattern). + * + * @since 2.1-alpha-2 + */ + @Parameter(property = "maven.war.packagingExcludes") + private String packagingExcludes; + + /** + * The comma separated list of tokens to include in the WAR before packaging. By default everything is included. + * This option may be used to implement the skinny WAR use case. Note that you can use the Java Regular Expressions + * engine to include and exclude specific pattern using the expression %regex[]. + * + * @since 2.1-beta-1 + */ + @Parameter + private String packagingIncludes; + /** * The overlays to apply. Each <overlay> element may contain: *