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
23 changes: 11 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ under the License.
<parent>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugins</artifactId>
<version>39</version>
<version>42</version>
<relativePath />
</parent>

Expand All @@ -50,7 +50,7 @@ under the License.
</issueManagement>
<ciManagement>
<system>Jenkins</system>
<url>https://ci-builds.apache.org/job/Maven/job/maven-box/job/maven-ejb-plugin/</url>
<url>https://ci-maven.apache.org/job/Maven/job/maven-box/job/maven-ejb-plugin/</url>
</ciManagement>
<distributionManagement>
<site>
Expand All @@ -61,10 +61,6 @@ under the License.

<properties>
<mavenVersion>3.2.5</mavenVersion>
<javaVersion>8</javaVersion>
<mavenPluginToolsVersion>3.6.4</mavenPluginToolsVersion>
<mavenFilteringVersion>3.2.0</mavenFilteringVersion>
<mavenArchiverVersion>3.5.2</mavenArchiverVersion>
<project.build.outputTimestamp>2022-04-18T18:55:30Z</project.build.outputTimestamp>
</properties>

Expand Down Expand Up @@ -102,7 +98,7 @@ under the License.
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-archiver</artifactId>
<version>${mavenArchiverVersion}</version>
<version>3.6.2</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
Expand All @@ -112,27 +108,30 @@ under the License.
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-filtering</artifactId>
<version>${mavenFilteringVersion}</version>
<version>3.3.2</version>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-utils</artifactId>
<version>3.3.4</version>
<version>3.4.2</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>3.5.1</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-xml</artifactId>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-archiver</artifactId>
<version>4.8.0</version>
<version>4.9.2</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.7</version>
<version>2.16.1</version>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down
11 changes: 6 additions & 5 deletions src/it/mejb-93/verify.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import java.io.*
import java.util.*
import groovy.xml.XmlSlurper

/**
* This will filter out the version of the
Expand Down Expand Up @@ -52,17 +53,17 @@ if ( !jarFile.isFile() )

def buildLog = new File( basedir, "build.log" ).getText('UTF-8')

if (!buildLog.contains ('[INFO] --- maven-ejb-plugin:' + projectVersion + ':ejb (default-ejb) @ maven-it-mejb93 ---')) {
if (!buildLog.contains ('' + projectVersion + ':ejb (default-ejb) @ maven-it-mejb93 ---')) {
println ( "default executions did not happen.")
return false
}
if (!buildLog.contains ('[INFO] --- maven-ejb-plugin:' + projectVersion + ':ejb (second-execution) @ maven-it-mejb93 ---')) {
if (!buildLog.contains ('' + projectVersion + ':ejb (second-execution) @ maven-it-mejb93 ---')) {
println ( "second executions did not happen.")
return false
}
if (!buildLog.contains ('[ERROR] Failed to execute goal org.apache.maven.plugins:maven-ejb-plugin:' + projectVersion
+ ':ejb (second-execution) on project maven-it-mejb93: '
+ 'You have to use a classifier to attach supplemental artifacts to the '
if (!buildLog.contains ('[ERROR] Failed to execute goal org.apache.maven.plugins:maven-ejb-plugin:' + projectVersion
+ ':ejb (second-execution) on project maven-it-mejb93: '
+ 'You have to use a classifier to attach supplemental artifacts to the '
+ 'project instead of replacing them. -> [Help 1]')) {
println ( "exception message does not exists or the expected content does not exist.")
return false
Expand Down
21 changes: 9 additions & 12 deletions src/main/java/org/apache/maven/plugins/ejb/EjbMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@
import org.apache.maven.plugins.annotations.ResolutionScope;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.MavenProjectHelper;
import org.apache.maven.shared.filtering.FilterWrapper;
import org.apache.maven.shared.filtering.MavenFileFilter;
import org.apache.maven.shared.filtering.MavenFilteringException;
import org.apache.maven.shared.filtering.MavenResourcesExecution;
import org.apache.maven.shared.utils.io.FileUtils.FilterWrapper;
import org.codehaus.plexus.archiver.Archiver;
import org.codehaus.plexus.archiver.ArchiverException;
import org.codehaus.plexus.archiver.jar.JarArchiver;
Expand Down Expand Up @@ -349,18 +349,17 @@ private File generateEjb() throws MojoExecutionException {
archiver.setOutputFile(jarFile);

// configure for Reproducible Builds based on outputTimestamp value
archiver.configureReproducible(outputTimestamp);
archiver.configureReproducibleBuild(outputTimestamp);

File deploymentDescriptor = new File(sourceDirectory, ejbJar);

checkEJBVersionCompliance(deploymentDescriptor);

try {
List<String> defaultExcludes = Arrays.asList(ejbJar, "**/package.html");
List<String> defaultIncludes = DEFAULT_INCLUDES_LIST;

IncludesExcludes ie =
new IncludesExcludes(Collections.<String>emptyList(), excludes, defaultIncludes, defaultExcludes);
new IncludesExcludes(Collections.emptyList(), excludes, DEFAULT_INCLUDES_LIST, defaultExcludes);

archiver.getArchiver().addDirectory(sourceDirectory, ie.resultingIncludes(), ie.resultingExcludes());

Expand Down Expand Up @@ -399,14 +398,12 @@ private File generateEjbClient() throws MojoExecutionException {
clientArchiver.setOutputFile(clientJarFile);

// configure for Reproducible Builds based on outputTimestamp value
clientArchiver.configureReproducible(outputTimestamp);
clientArchiver.configureReproducibleBuild(outputTimestamp);

try {
List<String> defaultExcludes = DEFAULT_CLIENT_EXCLUDES_LIST;
List<String> defaultIncludes = DEFAULT_INCLUDES_LIST;

IncludesExcludes ie =
new IncludesExcludes(clientIncludes, clientExcludes, defaultIncludes, defaultExcludes);
IncludesExcludes ie = new IncludesExcludes(
clientIncludes, clientExcludes, DEFAULT_INCLUDES_LIST, DEFAULT_CLIENT_EXCLUDES_LIST);

clientArchiver.getArchiver().addDirectory(sourceDirectory, ie.resultingIncludes(), ie.resultingExcludes());

Expand Down Expand Up @@ -486,9 +483,9 @@ private boolean isClientClassifierValid() {
* @throws IOException if an error occurred while reading the file
*/
private String getEncoding(File xmlFile) throws IOException {
try (XmlStreamReader xmlReader = new XmlStreamReader(xmlFile)) {
final String encoding = xmlReader.getEncoding();
return encoding;
try (XmlStreamReader xmlReader =
XmlStreamReader.builder().setFile(xmlFile).get()) {
return xmlReader.getEncoding();
}
}

Expand Down