pom.xml 8.88 KB
Newer Older
Phil's avatar
Phil committed
1 2 3 4
<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>
5 6
	<groupId>artifacttemplates</groupId>
	<artifactId>DockerContainer_IA_Manage</artifactId>
Phil's avatar
Phil committed
7 8
	<packaging>war</packaging>
	<version>1.0-SNAPSHOT</version>
9
	<name>Implementation Artifact DockerContainer_IA_Manage</name>
Phil's avatar
Phil committed
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

	<repositories>
		<repository>
			<id>2471.de</id>
			<url>http://2471.de/maven2</url>
		</repository>
		<repository>
			<id>mvnrepository</id>
			<url>https://mvnrepository.com</url>
		</repository>
		<repository>
			<id>opentosca-mvn-repo</id>
			<url>https://raw.github.com/OpenTOSCA/mvn-repo/ustutt/</url>
			<snapshots>
				<enabled>true</enabled>
				<updatePolicy>always</updatePolicy>
			</snapshots>
		</repository>
	</repositories>

	<properties>
		<run.HttpPort>9090</run.HttpPort>
32
		<winery.upload.url>http://localhost:8080/winery/artifacttemplates/http%3A%2F%2Fdch.uni-koeln.de%2Ftosca%2Fnodetypes/DockerContainer_IA_Manage/files/</winery.upload.url>
Phil's avatar
Phil committed
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<cxf.version>2.7.6</cxf.version>
		<highlevelrestapi.version>0.1.6</highlevelrestapi.version>
	</properties>

	<dependencies>
		<!-- LIBRARIES ADDED FOR IMPLEMENTATION ARTIFACT IMPLEMENTATION -->

		<dependency>
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
			<version>2.4</version>
		</dependency>
		<dependency>
			<!-- NOTE: "The Commons HttpClient project is now end of life, and is
				no longer being developed." See http://hc.apache.org/httpclient-3.x/. New
				project: http://hc.apache.org/httpcomponents-client-ga/ -->
			<groupId>commons-httpclient</groupId>
			<artifactId>commons-httpclient</artifactId>
			<version>3.1</version>
			<exclusions>
				<!-- provided by jcl-over-slf4j to enable logging via logback -->
				<exclusion>
					<groupId>commons-logging</groupId>
					<artifactId>commons-logging</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

		<dependency>
			<groupId>com.jcabi</groupId>
			<artifactId>jcabi-ssh</artifactId>
			<version>1.6.1</version>
		</dependency>

		<dependency>
			<groupId>org.glassfish.jersey.core</groupId>
			<artifactId>jersey-client</artifactId>
			<version>2.25.1</version>
		</dependency>

		<dependency>
			<groupId>javax.ws.rs</groupId>
			<artifactId>javax.ws.rs-api</artifactId>
			<version>2.0</version>
		</dependency>

		<!-- END - LIBRARIES ADDED FOR IMPLEMENTATION ARTIFACT IMPLEMENTATION -->

		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.5</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-web</artifactId>
			<version>3.0.7.RELEASE</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-context</artifactId>
			<version>3.0.7.RELEASE</version>
		</dependency>
		<dependency>
			<groupId>org.apache.cxf</groupId>
			<artifactId>cxf-rt-frontend-jaxws</artifactId>
			<version>${cxf.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.cxf</groupId>
			<artifactId>cxf-rt-frontend-simple</artifactId>
			<version>${cxf.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.cxf</groupId>
			<artifactId>cxf-rt-transports-http</artifactId>
			<version>${cxf.version}</version>
		</dependency>
	</dependencies>
	<build>
115
		<finalName>DockerContainer_IA_Manage</finalName>
Phil's avatar
Phil committed
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156
		<plugins>
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.0</version>
				<configuration>
					<source>1.8</source>
					<target>1.8</target>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-eclipse-plugin</artifactId>
				<version>2.9</version>
				<configuration>
					<downloadSources>false</downloadSources>
					<downloadJavadocs>true</downloadJavadocs>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.cxf</groupId>
				<artifactId>cxf-java2ws-plugin</artifactId>
				<version>${cxf.version}</version>
				<dependencies>
					<dependency>
						<groupId>org.apache.cxf</groupId>
						<artifactId>cxf-rt-frontend-jaxws</artifactId>
						<version>${cxf.version}</version>
					</dependency>
					<dependency>
						<groupId>org.apache.cxf</groupId>
						<artifactId>cxf-rt-frontend-simple</artifactId>
						<version>${cxf.version}</version>
					</dependency>
				</dependencies>
				<executions>
					<execution>
						<id>process-classes</id>
						<phase>process-classes</phase>
						<configuration>
157 158
							<className>DockerContainer_IA_Manage</className>
							<outputFile>${basedir}/src/main/webapp/wsdl/DockerContainer_IA_Manage.wsdl</outputFile>
Phil's avatar
Phil committed
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296
							<genWsdl>true</genWsdl>
							<verbose>true</verbose>
						</configuration>
						<goals>
							<goal>java2ws</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-war-plugin</artifactId>
				<version>2.3</version>
				<configuration>
					<webXml>src/main/webapp/WEB-INF/web.xml</webXml>
				</configuration>
			</plugin>

			<!-- Inspired by: http://giallone.blogspot.de/2013/02/post-file-to-web-page-as-part-of-maven.html -->
			<plugin>
				<groupId>org.codehaus.gmaven</groupId>
				<artifactId>gmaven-plugin</artifactId>
				<version>1.4</version>
				<dependencies>
					<dependency>
						<groupId>org.codehaus.gmaven.runtime</groupId>
						<artifactId>gmaven-runtime-1.7</artifactId>
						<version>1.2</version>
					</dependency>
					<dependency>
						<groupId>org.apache.httpcomponents</groupId>
						<artifactId>httpmime</artifactId>
						<version>4.2.1</version>
					</dependency>
					<dependency>
						<groupId>org.apache.httpcomponents</groupId>
						<artifactId>httpcore</artifactId>
						<version>4.2.1</version>
					</dependency>
					<dependency>
						<groupId>org.apache.httpcomponents</groupId>
						<artifactId>httpclient</artifactId>
						<version>4.2.1</version>
					</dependency>
				</dependencies>
				<executions>
					<execution>
						<id>upload2winery</id>
						<!-- In this mvn phase... -->
						<phase>deploy</phase>
						<!-- ...run the execute goal of this plugin -->
						<goals>
							<goal>execute</goal>
						</goals>
						<configuration>
							<providerSelection>1.7</providerSelection>
							<source>
								import org.apache.http.impl.client.DefaultHttpClient
								import org.apache.http.client.methods.HttpPost
								import org.apache.http.entity.mime.MultipartEntity
								import org.apache.http.entity.mime.content.FileBody

								// Get WAR file
								def name = "target/${project.build.finalName}.war"
								println "Archive file: $name"
								def f = new File(name)

								// POST file
								DefaultHttpClient httpclient = new DefaultHttpClient()
								println "Upload URL: ${winery.upload.url}"
								def post = new HttpPost("${winery.upload.url}")
								def entity = new MultipartEntity()
								def fileBody = new FileBody(f)
								entity.addPart("files[]", fileBody)
								post.setEntity(entity)

								// Process response
								def response = httpclient.execute(post)
								def status = response.getStatusLine()
								if( !(status ==~ /.*Created.*/) )
									 fail("IA upload to Winery FAILED, please upload manually. (HTTP status code: $status)" )
								else
									 println "IA upload finished sucessfully (HTTP status code $status)"
							</source>
						</configuration>
					</execution>
				</executions>
			</plugin>

		</plugins>

		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.tomcat.maven</groupId>
					<artifactId>tomcat7-maven-plugin</artifactId>
					<version>2.1</version>
					<configuration>
						<!-- http port -->
						<port>${run.HttpPort}</port>
						<!-- application path always starts with / -->
						<path>/</path>
						<!-- if you want to use test dependencies rather than only runtime -->
						<useTestClasspath>false</useTestClasspath>
					</configuration>
				</plugin>

				<!-- Disable default install phase, because we don't install into maven
					repo but into Winery (during deploy phase). -->
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-install-plugin</artifactId>
					<executions>
						<execution>
							<id>default-install</id>
							<phase>none</phase>
						</execution>
					</executions>
				</plugin>

				<!-- Disable default deploy phase, because we don't deploy into remote
					maven repo but into remote Winery. -->
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-deploy-plugin</artifactId>
					<executions>
						<execution>
							<id>default-deploy</id>
							<phase>none</phase>
						</execution>
					</executions>
				</plugin>
			</plugins>
		</pluginManagement>

	</build>
</project>