Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Each country must build their own jar file containing their own implementations, dependencies and supporting files.

This National jar file can be bundled into the There are a number of strategies for bundling the local classes

  1. Build epsos-ws-server.war

...

  1. in a local build environment using maven profile "national-connector-impl" to include the local classes as a dependency.  The disadvantage with this approach is that the local build server must download all the source files from Google Code repository plus all dependencies from Joinup.
  2. Download a released epsos-ws-server.war from Joinup.  Use a local build script to unpack the archive, bundle in the local classes and then repackage.  This is the preferred approach in Sweden.
  3. Download epsos-ws-server.war from Joinup.  Add local classes to tomcat/lib.  This has been briefly tested and did not work due to class loader errors.  Furthermore it is never a good idea to deploy application-specific classes into tomcat/lib.

Local build using profile

Code Block
languagehtml/xml
	<profiles>
		<profile>
			<!-- This profile bundles a mock National Connector implementation -->
			<id>national-connector-mock-impl</id>
			<dependencies>
				<dependency>
                    <groupId>eu.europa.ec.joinup.ecc.epsos-protocol-terminators.epsos-ncp-server</groupId>
                    <artifactId>epsos-nc-mock-it</artifactId>
                    <version>0.1-SNAPSHOT</version>
                    <scope>runtime</scope>
                </dependency>
			</dependencies>
		</profile>
		<profile>
			<!-- This profile bundles the real National Connector implementation -->
			<id>national-connector-impl</id>
			<dependencies>
				<dependency>
					<groupId>${national-connector-impl.groupId}</groupId>
					<artifactId>${national-connector-impl.artifactId}</artifactId>
					<version>${national-connector-impl.version}</version>
					<scope>runtime</scope>
				</dependency>
			</dependencies>
		</profile>
	</profiles>

...

Code Block
languagenone
# build epsos-ws-serverwith no implementation
mvn clean install
 
# build epsos-ws-server with mock implementations
mvn clean install -P national-connector-mock-impl
 
# build epsos-ws-server with real implementations
mvn clean install -P national-connector-impl

...

Manipulation of epsos-ws-server.war

Here is the Maven pom that Sweden uses to download OpenNCP from Joinup Nexus repository and then bundle in the jar containing the National implementations.

Code Block
languagehtml/xml
<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>
	<parent>
		<artifactId>epsos</artifactId>
		<groupId>se.apotekensservice</groupId>
		<version>1.0-SNAPSHOT<1</version>
	</parent>
	<groupId>se.apotekensservice</groupId>
	<artifactId>epsos-ncp<ws-server</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<packaging>war</packaging>
	<name>Package OpenNCP<<name>OpenNCP Server (Country A)</name>
	<description>This project fetchesdownloads the OpenNCP epsos-ws-server.war. and It then unpacks it, adds the shelob.jar dependency and creates a new web archive</description>bundles in the Swedish functionality (Shelob)</description>
    
	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<version>2.5.1</version>
				<executions>
					<execution>
						<id>unpack</id>
						<phase>package</phase>
						<goals>
							<goal>unpack</goal>
						</goals>
						<configuration>
							<artifactItems>
								<artifactItem>
									<groupId>${project.openNcpGroupId}</groupId>
									<artifactId>${project.openNcpArtifactId}</artifactId>
									<version>${project.openNcpVersion}</version>
									<type>war</type>
									<overWrite>true</overWrite>
									<outputDirectory>${project.build.directory}/epsos-ws-server</outputDirectory>
									<includes></includes>
									<excludes>epsos-ws-server-mock<excludes>**/epsos*-mock-*.jar</excludes>
								</artifactItem>
							</artifactItems>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
	<dependencies>
		<dependency>
			<groupId>${project.shelobGroupId}</groupId>
			<artifactId>${project.shelobArtifactId}</artifactId>
			<version>${project.shelobVersion}</version>
		</dependency>
		<dependency>
			<groupId>${project.openNcpGroupId}</groupId>
			<artifactId>${project.openNcpArtifactId}</artifactId>
			<version>${project.openNcpVersion}</version>
			<type>war</type>
		</dependency>
	</dependencies>
	<properties>
		<!-- OpenNCP war -->
		<project.openNcpGroupId>eu.europa.ec.joinup.ecc.epsos-protocol-terminators.epsos-ncp-server</project.openNcpGroupId>
		<project.openNcpArtifactId>epsos-ws-server</project.openNcpArtifactId>
		<project.openNcpVersion>0openNcpVersion>2.20.10-SNAPSHOT</project.openNcpVersion>
		<!-- Shelob jar (National implementations for bundling into OpenNCP -->
		<project.shelobGroupId>se.apotekensservice</project.shelobGroupId>
		<project.shelobArtifactId>epsos-shelob</project.shelobArtifactId>
		<project.shelobVersion>0.0.1-SNAPSHOT<shelobVersion>1.1</project.shelobVersion>
	</properties>
</project>

...