민서네집

[osgi] Spring Framework Library Bundle 한꺼번에 받기 본문

Spring

[osgi] Spring Framework Library Bundle 한꺼번에 받기

브라이언7 2013. 1. 14. 01:57

maven 프로젝트를 하나 만들어서 pom.xml 을 다음과 같이 만든다.

프로젝트 루트 폴더에 target 이라는 디렉터리를 생성한다.

maven install 을 실행시키면 target 디렉터리에 pom.xml 에 설정된 라이브러리가 의존성 있는 jar들과 함께 다운로드 될 것이다.

<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>
	<groupId>com.acme.springdm</groupId>
	<artifactId>com.acme.springdm.target</artifactId>
	<packaging>pom</packaging>
	<name>SpringDM with Jetty</name>
	<version>1.0.0</version>
	<description>
		Spring Framework Bundle 
	</description>

	<properties>
		<!-- 다운로드한 번들을 복사할 위치 -->
		<taget-platform.root>.\target</taget-platform.root>
	</properties>

	<dependencies>

		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>org.springframework.spring-library</artifactId>
			<type>libd</type>
			<version>3.2.0.RELEASE</version>
		</dependency>

	</dependencies>

	<repositories>

		<repository>
			<id>com.springsource.repository.bundles.release</id>
			<name>SpringSource Enterprise Bundle Repository - SpringSource Bundle Releases</name>
			<url>http://repository.springsource.com/maven/bundles/release</url>
		</repository>

		<repository>
			<id>com.springsource.repository.bundles.external</id>
			<name>SpringSource Enterprise Bundle Repository - External Bundle Releases</name>
			<url>http://repository.springsource.com/maven/bundles/external</url>
		</repository>

		<repository>
			<id>com.springsource.repository.libraries.release</id>
			<name>SpringSource Enterprise Bundle Repository - SpringSource Library Releases</name>
			<url>http://repository.springsource.com/maven/libraries/release</url>
		</repository>

		<repository>
			<id>com.springsource.repository.libraries.external</id>
			<name>SpringSource Enterprise Bundle Repository - External Library Releases</name>
			<url>http://repository.springsource.com/maven/libraries/external</url>
		</repository>

	</repositories>
	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<executions>
					<execution>
						<id>copy-dependencies</id>
						<phase>package</phase>
						<goals>
							<goal>copy-dependencies</goal>
						</goals>
						<configuration>
							<outputDirectory>
								${taget-platform.root}
							</outputDirectory>
							<overWriteReleases>false</overWriteReleases>
							<overWriteIfNewer>true</overWriteIfNewer>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

</project>


pom.xml


Comments