Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugins</artifactId>
<version>41</version>
<version>44</version>
<relativePath />
</parent>

Expand Down Expand Up @@ -127,6 +127,7 @@
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<version>${version.maven-plugin-tools}</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,7 @@ private class DefaultWarPackagingContext implements WarPackagingContext {
* @param failOnMissingWebXml Flag to check whether we should ignore missing web.xml or not
* @param outputTimestamp the output timestamp for reproducible archive creation
*/
@SuppressWarnings("checkstyle:ParameterNumber")
DefaultWarPackagingContext(
final File webappDirectory,
final WebappStructure webappStructure,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ class FileFilterImpl implements FileFilter {

private final int webAppDirIndex;

public FileFilterImpl(File webAppDirectory, String[] rejectedFilePaths) {
FileFilterImpl(File webAppDirectory, String[] rejectedFilePaths) {
if (rejectedFilePaths != null) {
this.rejectedFilePaths = Arrays.asList(rejectedFilePaths);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public abstract class AbstractWarMojoTest extends AbstractMojoTestCase {
*
* @param mojo The mojo to be tested.
* @param filters The list of filters.
* @param classesDir The classes directory.
* @param classesDir The classes' directory.
* @param webAppSource The webAppSource.
* @param webAppDir The webAppDir folder.
* @param project The Maven project.
Expand Down Expand Up @@ -94,14 +94,14 @@ protected void configureMojo(
*/
protected File createXMLConfigDir(String id, String[] xmlFiles) throws Exception {
File xmlConfigDir = new File(getTestDirectory(), "/" + id + "-test-data/xml-config");
File XMLFile;
File xmlFile;

createDir(xmlConfigDir);

if (xmlFiles != null) {
for (String o : xmlFiles) {
XMLFile = new File(xmlConfigDir, o);
createFile(XMLFile);
xmlFile = new File(xmlConfigDir, o);
createFile(xmlFile);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,10 @@ protected File getTestDirectory() {
/**
* @throws Exception in case of an error.
*/
public void testExplodedWar_WithResourceFiltering() throws Exception {
@SuppressWarnings("checkstyle:MethodLength")
public void testExplodedWarWithResourceFiltering() throws Exception {
// setup test data
String testId = "ExplodedWar_WithResourceFiltering";
String testId = "ExplodedWarWithResourceFiltering";
MavenProjectBasicStub project = new MavenProjectBasicStub();
File webAppDirectory = new File(getTestDirectory(), testId);
File webAppSource = createWebAppSource(testId);
Expand Down
48 changes: 24 additions & 24 deletions src/test/java/org/apache/maven/plugins/war/WarExplodedMojoTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ public void testSimpleExplodedWarWTargetPath() throws Exception {
/**
* @throws Exception in case of an error.
*/
public void testExplodedWar_WithCustomWebXML() throws Exception {
public void testExplodedWarWithCustomWebXML() throws Exception {
// setup test data
String testId = "ExplodedWar_WithCustomWebXML";
String testId = "ExplodedWarWithCustomWebXML";
MavenProjectBasicStub project = new MavenProjectBasicStub();
File webAppSource = createWebAppSource(testId);
File classesDir = createClassesDir(testId, true);
Expand Down Expand Up @@ -179,9 +179,9 @@ public void testExplodedWar_WithCustomWebXML() throws Exception {
/**
* @throws Exception in case of an error.
*/
public void testExplodedWar_WithContainerConfigXML() throws Exception {
public void testExplodedWarWithContainerConfigXML() throws Exception {
// setup test data
String testId = "ExplodedWar_WithContainerConfigXML";
String testId = "ExplodedWarWithContainerConfigXML";
MavenProjectBasicStub project = new MavenProjectBasicStub();
File classesDir = createClassesDir(testId, true);
File webAppSource = createWebAppSource(testId);
Expand Down Expand Up @@ -216,12 +216,12 @@ public void testExplodedWar_WithContainerConfigXML() throws Exception {
/**
* @throws Exception in case of an error.
*/
public void testExplodedWar_WithSimpleExternalWARFile() throws Exception {
public void testExplodedWarWithSimpleExternalWARFile() throws Exception {
// setup test data
MavenProjectArtifactsStub project = new MavenProjectArtifactsStub();
WarArtifactStub warArtifact = new WarArtifactStub(getBasedir());

String testId = "ExplodedWar_WithSimpleExternalWARFile";
String testId = "ExplodedWarWithSimpleExternalWARFile";
File webAppDirectory = new File(getTestDirectory(), testId);
File webAppSource = createWebAppSource(testId);
File classesDir = createClassesDir(testId, true);
Expand Down Expand Up @@ -310,9 +310,9 @@ public void testExplodedWarMergeWarLocalFileOverride() throws Exception {
/**
* @throws Exception in case of an error.
*/
public void testExplodedWar_WithEJB() throws Exception {
public void testExplodedWarWithEJB() throws Exception {
// setup test data
String testId = "ExplodedWar_WithEJB";
String testId = "ExplodedWarWithEJB";
MavenProjectArtifactsStub project = new MavenProjectArtifactsStub();
File webAppDirectory = new File(getTestDirectory(), testId);
File webAppSource = createWebAppSource(testId);
Expand Down Expand Up @@ -381,9 +381,9 @@ public void testExplodedWarWithJar() throws Exception {
/**
* @throws Exception in case of an error.
*/
public void testExplodedWar_WithEJBClient() throws Exception {
public void testExplodedWarWithEJBClient() throws Exception {
// setup test data
String testId = "ExplodedWar_WithEJB";
String testId = "ExplodedWarWithEJB";
MavenProjectArtifactsStub project = new MavenProjectArtifactsStub();
File webAppDirectory = new File(getTestDirectory(), testId);
File webAppSource = createWebAppSource(testId);
Expand Down Expand Up @@ -417,9 +417,9 @@ public void testExplodedWar_WithEJBClient() throws Exception {
/**
* @throws Exception in case of an error.
*/
public void testExplodedWar_WithTLD() throws Exception {
public void testExplodedWarWithTLD() throws Exception {
// setup test data
String testId = "ExplodedWar_WithTLD";
String testId = "ExplodedWarWithTLD";
MavenProjectArtifactsStub project = new MavenProjectArtifactsStub();
File webAppDirectory = new File(getTestDirectory(), testId);
File webAppSource = createWebAppSource(testId);
Expand Down Expand Up @@ -453,9 +453,9 @@ public void testExplodedWar_WithTLD() throws Exception {
/**
* @throws Exception in case of an error.
*/
public void testExplodedWar_WithPAR() throws Exception {
public void testExplodedWarWithPAR() throws Exception {
// setup test data
String testId = "ExplodedWar_WithPAR";
String testId = "ExplodedWarWithPAR";
MavenProjectArtifactsStub project = new MavenProjectArtifactsStub();
File webAppDirectory = new File(getTestDirectory(), testId);
File webAppSource = createWebAppSource(testId);
Expand Down Expand Up @@ -603,9 +603,9 @@ public void testExplodedWarWithXar() throws Exception {
/**
* @throws Exception in case of an error.
*/
public void testExplodedWar_WithDuplicateDependencies() throws Exception {
public void testExplodedWarWithDuplicateDependencies() throws Exception {
// setup test data
String testId = "ExplodedWar_WithDuplicateDependencies";
String testId = "ExplodedWarWithDuplicateDependencies";
MavenProjectArtifactsStub project = new MavenProjectArtifactsStub();
File webAppDirectory = new File(getTestDirectory(), testId);
File webAppSource = createWebAppSource(testId);
Expand Down Expand Up @@ -647,9 +647,9 @@ public void testExplodedWar_WithDuplicateDependencies() throws Exception {
/**
* @throws Exception in case of an error.
*/
public void testExplodedWar_DuplicateWithClassifier() throws Exception {
public void testExplodedWarDuplicateWithClassifier() throws Exception {
// setup test data
String testId = "ExplodedWar_DuplicateWithClassifier";
String testId = "ExplodedWarDuplicateWithClassifier";
MavenProjectArtifactsStub project = new MavenProjectArtifactsStub();
File webAppDirectory = new File(getTestDirectory(), testId);
File webAppSource = createWebAppSource(testId);
Expand Down Expand Up @@ -697,9 +697,9 @@ public void testExplodedWar_DuplicateWithClassifier() throws Exception {
/**
* @throws Exception in case of an error.
*/
public void testExplodedWar_WithClasses() throws Exception {
public void testExplodedWarWithClasses() throws Exception {
// setup test data
String testId = "ExplodedWar_WithClasses";
String testId = "ExplodedWarWithClasses";
MavenProjectBasicStub project = new MavenProjectBasicStub();
File webAppDirectory = new File(getTestDirectory(), testId);
File webAppSource = createWebAppSource(testId);
Expand Down Expand Up @@ -728,9 +728,9 @@ public void testExplodedWar_WithClasses() throws Exception {
/**
* @throws Exception in case of an error.
*/
public void testExplodedWar_WithSourceIncludeExclude() throws Exception {
public void testExplodedWarWithSourceIncludeExclude() throws Exception {
// setup test data
String testId = "ExplodedWar_WithSourceIncludeExclude";
String testId = "ExplodedWarWithSourceIncludeExclude";
MavenProjectBasicStub project = new MavenProjectBasicStub();
File webAppSource = createWebAppSource(testId);
File classesDir = createClassesDir(testId, true);
Expand Down Expand Up @@ -763,9 +763,9 @@ public void testExplodedWar_WithSourceIncludeExclude() throws Exception {
/**
* @throws Exception in case of an error.
*/
public void testExplodedWar_WithWarDependencyIncludeExclude() throws Exception {
public void testExplodedWarWithWarDependencyIncludeExclude() throws Exception {
// setup test data
String testId = "ExplodedWar_WithWarDependencyIncludeExclude";
String testId = "ExplodedWarWithWarDependencyIncludeExclude";
MavenProjectArtifactsStub project = new MavenProjectArtifactsStub();
IncludeExcludeWarArtifactStub includeexcludeWarArtifact = new IncludeExcludeWarArtifactStub(getBasedir());
File webAppDirectory = new File(getTestDirectory(), testId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import org.apache.maven.plugins.war.stub.ResourceStub;

public class WarInPlaceMojoTest extends AbstractWarMojoTest {
protected static final String pomFilePath =
protected static final String POM_FILE_PATH =
getBasedir() + "/target/test-classes/unit/warexplodedinplacemojo/plugin-config.xml";

protected File getTestDirectory() throws Exception {
Expand All @@ -37,7 +37,7 @@ protected File getTestDirectory() throws Exception {
public void setUp() throws Exception {
super.setUp();

mojo = (WarInPlaceMojo) lookupMojo("inplace", pomFilePath);
mojo = (WarInPlaceMojo) lookupMojo("inplace", POM_FILE_PATH);
assertNotNull(mojo);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
*/
package org.apache.maven.plugins.war.stub;

import java.util.Objects;

import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.handler.ArtifactHandler;
import org.apache.maven.artifact.handler.DefaultArtifactHandler;
Expand All @@ -27,8 +29,8 @@
public abstract class AbstractArtifactStub extends ArtifactStub {
protected String basedir;

public AbstractArtifactStub(String _basedir) {
basedir = _basedir;
public AbstractArtifactStub(String basedir) {
this.basedir = basedir;
}

public String getVersion() {
Expand Down Expand Up @@ -128,4 +130,9 @@ public boolean equals(Object o) {

return true;
}

@Override
public int hashCode() {
return Objects.hashCode(basedir);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
public class EJBArtifactStub extends AbstractArtifactStub {
protected String groupId;

public EJBArtifactStub(String _basedir) {
super(_basedir);
public EJBArtifactStub(String basedir) {
super(basedir);
}

public void setGroupId(String id) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ public class EJBArtifactStubWithClassifier extends AbstractArtifactStub {
protected String groupId;
protected String classifier;

public EJBArtifactStubWithClassifier(String _basedir) {
super(_basedir);
public EJBArtifactStubWithClassifier(String basedir) {
super(basedir);
}

public void setGroupId(String id) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
public class EJBClientArtifactStub extends AbstractArtifactStub {
protected String groupId;

public EJBClientArtifactStub(String _basedir) {
super(_basedir);
public EJBClientArtifactStub(String basedir) {
super(basedir);
}

public void setGroupId(String id) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
import java.io.File;

public class PARArtifactStub extends AbstractArtifactStub {
public PARArtifactStub(String _basedir) {
super(_basedir);
public PARArtifactStub(String basedir) {
super(basedir);
}

public String getType() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ public void attachArtifact(MavenProject project, File artifactFile, String artif
public void attachArtifact(MavenProject project, String artifactType, File artifactFile) {}

public void attachArtifact(
MavenProject project, String _artifactType, String _artifactClassifier, File _artifactFile) {
artifactType = _artifactType;
artifactClassifier = _artifactClassifier;
artifactFile = _artifactFile;
MavenProject project, String artifactType, String artifactClassifier, File artifactFile) {
this.artifactType = artifactType;
this.artifactClassifier = artifactClassifier;
this.artifactFile = artifactFile;
}

@SuppressWarnings("rawtypes")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ public List<String> getExcludes() {
return new ArrayList<>();
}

public void setDirectory(String _directory) {
directory = _directory;
public void setDirectory(String directory) {
this.directory = directory;
}

public String getDirectory() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
import java.io.File;

public class TLDArtifactStub extends AbstractArtifactStub {
public TLDArtifactStub(String _basedir) {
super(_basedir);
public TLDArtifactStub(String basedir) {
super(basedir);
}

public String getType() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ public class WarArtifactStub extends AbstractArtifactStub {

private File file;

public WarArtifactStub(String _basedir) {
super(_basedir);
public WarArtifactStub(String basedir) {
super(basedir);
}

public String getType() {
Expand All @@ -49,8 +49,8 @@ public String getArtifactId() {
}
}

public void setArtifactId(String _artifactId) {
artifactId = _artifactId;
public void setArtifactId(String artifactId) {
this.artifactId = artifactId;
}

public String getGroupId() {
Expand All @@ -73,8 +73,8 @@ public File getFile() {
}
}

public void setFile(File _file) {
file = _file;
public void setFile(File file) {
this.file = file;
}

public String getClassifier() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ public class WarOverlayStub extends AbstractArtifactStub {

private File file;

public WarOverlayStub(String _basedir, String artifactId, File warFile) {
super(_basedir);
public WarOverlayStub(String basedir, String artifactId, File warFile) {
super(basedir);
if (artifactId == null) {
throw new NullPointerException("Id could not be null.");
}
Expand Down
Loading