/******************************************************************************
 * Copyright (c) 2016 TypeFox and others.
 * 
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v. 2.0 which is available at
 * http://www.eclipse.org/legal/epl-2.0,
 * or the Eclipse Distribution License v. 1.0 which is available at
 * http://www.eclipse.org/org/documents/edl-v10.php.
 * 
 * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
 ******************************************************************************/

publishing {
	publications {
		LocalMavenRepo(MavenPublication) {
			from components.java

			artifact sourcesJar
			artifact javadocJar

			pom {
				//packaging 'jar'
				url = 'https://github.com/eclipse-lsp4j/lsp4j'
				licenses {
					license {
						name = 'Eclipse Public License, Version 2.0'
						url = 'http://www.eclipse.org/legal/epl-2.0'
					}
				}
				scm {
					connection = 'scm:git:git@github.com:eclipse/lsp4j.git'
					developerConnection = 'scm:git:git@github.com:eclipse/lsp4j.git'
					url = 'git@github.com:eclipse/lsp4j.git'
				}

				developers {
					developer {
						name = 'Sven Efftinge'
						email = 'sven.efftinge@typefox.io'
						organizationUrl = 'https://typefox.io'
					}
					developer {
						name = 'Jonah Graham'
						email = 'jonah@kichwacoders.com'
						organizationUrl = 'https://kichwacoders.com'
					}
					developer {
						name = 'Dennis Hübner'
						email = 'dennis.huebner@typefox.io'
						organizationUrl = 'https://typefox.io'
					}
					developer {
						name = 'Akos Kitta'
						email = 'kittaakos@typefox.io'
						organizationUrl = 'https://typefox.io'
					}
					developer {
						name = 'Anton Kosyakov'
						email = 'anton.kosyakov@typefox.io'
						organizationUrl = 'https://typefox.io'
					}
					developer {
						name = 'Miro Spönemann'
						email = 'miro.spoenemann@typefox.io'
						organizationUrl = 'https://typefox.io'
					}
					developer {
						name = 'Yaohai Zheng'
						email = 'yaozheng@microsoft.com'
						organizationUrl = 'https://www.microsoft.com/'
					}
					developer {
						name = 'Christian Dietrich'
						email = 'christian.dietrich@itemis.de'
						organizationUrl = 'http://www.itemis.com'
					}
				}
				// We need to wait until the project's own build file has been executed
				// so we can use the title and description settings for setting up Maven publishing.
				afterEvaluate {
					if (project.hasProperty('title')) {
						name = project.title
						description = project.description
					}
                }
			}
		}
    }
	repositories {
		maven {
			url = "$rootProject.buildDir/maven-repository"
		}
	}
}
