-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #227 from stewartfrancis/finalName
Use project.build.finalName to derive artifact name
- Loading branch information
Showing
7 changed files
with
188 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
cics-bundle-maven-plugin/src/it/test-bundle-war-final-name/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<!-- | ||
#%L | ||
CICS Bundle Maven Plugin | ||
%% | ||
Copyright (C) 2024 IBM Corp. | ||
%% | ||
This program and the accompanying materials are made | ||
available under the terms of the Eclipse Public License 2.0 | ||
which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
SPDX-License-Identifier: EPL-2.0 | ||
#L% | ||
--> | ||
<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>com.ibm.cics.test-bundle-war</groupId> | ||
<artifactId>test-bundle-war</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
<packaging>war</packaging> | ||
|
||
<dependencies> | ||
<!-- provided --> | ||
<dependency> | ||
<groupId>javax.ws.rs</groupId> | ||
<artifactId>javax.ws.rs-api</artifactId> | ||
<version>2.0</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
|
||
<finalName>${project.artifactId}</finalName> | ||
|
||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-war-plugin</artifactId> | ||
<version>3.2.3</version> | ||
<configuration> | ||
<failOnMissingWebXml>false</failOnMissingWebXml> | ||
<packagingExcludes>pom.xml</packagingExcludes> | ||
<warName>test-war</warName> | ||
</configuration> | ||
</plugin> | ||
|
||
<plugin> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.5.1</version> | ||
<configuration> | ||
<source>1.8</source> | ||
<target>1.8</target> | ||
</configuration> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>@project.groupId@</groupId> | ||
<artifactId>@project.artifactId@</artifactId> | ||
<version>@project.version@</version> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>bundle-war</goal> | ||
</goals> | ||
<configuration> | ||
<jvmserver>EYUCMCIJ</jvmserver> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
1 change: 1 addition & 0 deletions
1
cics-bundle-maven-plugin/src/it/test-bundle-war-final-name/postbuild.bsh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
com.ibm.cics.cbmp.PostBuildTestBundleWarFinalName.assertOutput(basedir); |
39 changes: 39 additions & 0 deletions
39
...e-maven-plugin/src/it/test-bundle-war-final-name/src/main/java/test_war/TestEndpoint.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package test_war; | ||
|
||
/*- | ||
* #%L | ||
* CICS Bundle Maven Plugin | ||
* %% | ||
* Copyright (C) 2024 IBM Corp. | ||
* %% | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* #L% | ||
*/ | ||
|
||
import java.util.Optional; | ||
|
||
import javax.ws.rs.ApplicationPath; | ||
import javax.ws.rs.GET; | ||
import javax.ws.rs.Path; | ||
import javax.ws.rs.Produces; | ||
import javax.ws.rs.core.MediaType; | ||
import javax.ws.rs.core.Response; | ||
|
||
@ApplicationPath("") | ||
@Path("") | ||
public class TestEndpoint extends javax.ws.rs.core.Application { | ||
|
||
public TestEndpoint() { | ||
} | ||
|
||
@GET | ||
@Produces(MediaType.APPLICATION_OCTET_STREAM) | ||
public Response get() { | ||
return Response.ok().build(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
...-bundle-maven-plugin/src/test/java/com/ibm/cics/cbmp/PostBuildTestBundleWarFinalName.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package com.ibm.cics.cbmp; | ||
|
||
/*- | ||
* #%L | ||
* CICS Bundle Maven Plugin | ||
* %% | ||
* Copyright (C) 2024 IBM Corp. | ||
* %% | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* #L% | ||
*/ | ||
|
||
import static com.ibm.cics.cbmp.BundleValidator.assertBundleContents; | ||
import static com.ibm.cics.cbmp.BundleValidator.bfv; | ||
import static com.ibm.cics.cbmp.BundleValidator.manifestValidator; | ||
|
||
import static org.junit.Assert.assertThat; | ||
|
||
import java.io.File; | ||
|
||
import org.xmlunit.matchers.CompareMatcher; | ||
|
||
public class PostBuildTestBundleWarFinalName { | ||
|
||
private static final String EXPECTED_MANIFEST = | ||
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n" + | ||
"<manifest xmlns=\"http://www.ibm.com/xmlns/prod/cics/bundle\" bundleMajorVer=\"0\" bundleMicroVer=\"1\" bundleMinorVer=\"0\" bundleRelease=\"0\" bundleVersion=\"1\" id=\"test-bundle-war\">\n" + | ||
" <meta_directives>\n" + | ||
" <timestamp>2019-09-10T20:24:32.893Z</timestamp>\n" + | ||
" </meta_directives>\n" + | ||
" <define name=\"test-bundle-war-0.0.1-SNAPSHOT\" path=\"test-bundle-war-0.0.1-SNAPSHOT.warbundle\" type=\"http://www.ibm.com/xmlns/prod/cics/bundle/WARBUNDLE\"/>\n" + | ||
"</manifest>"; | ||
|
||
private static final String EXPECTED_BUNDLE_PART = | ||
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n" + | ||
"<warbundle jvmserver=\"EYUCMCIJ\" symbolicname=\"test-bundle-war-0.0.1-SNAPSHOT\"/>"; | ||
|
||
static void assertOutput(File root) throws Exception { | ||
assertBundleContents( | ||
root.toPath().resolve("target/test-bundle-war-cics-bundle.zip"), | ||
manifestValidator(EXPECTED_MANIFEST), | ||
bfv( | ||
"/test-bundle-war-0.0.1-SNAPSHOT.warbundle", | ||
is -> assertThat(is, CompareMatcher.isIdenticalTo(EXPECTED_BUNDLE_PART)) | ||
), | ||
bfv( | ||
"/test-bundle-war-0.0.1-SNAPSHOT.war", | ||
is -> {} | ||
) | ||
); | ||
} | ||
} |