Maven:설정하는 방법에 나 pom.xml 그래서 그것을 가져올 수 있는 종속성 HTTP 를 통해 배포하 모듈 via FTP

StackOverflow https://stackoverflow.com//questions/24022469

문제

내가 노력하고 설치 pom.xml 한 프로젝트입니다.고 나는 방법을 알아낼 수 없습니다 그것을 가져올 의존성을 통해 HTTP,배포하지만 새로운 유물 via FTP.

여기에는 상황이다.나는 멀티-모듈 프로젝트에서는 내가 공동으로 노력하고 몇 가지 다른 사람들이 있습니다.또한 일이를 임대하고 저렴한 웹 서버는 것을 허용할 수 있게 공유하 릴리스 및 스냅샷 버전의 일부 모듈을 통해 maven 장합니다.

내가 원하는 배포하는 저장소 인증(도록 권한 있는 사람들이 쓸 수 있습니다)그것을 할 수 via FTP.

반면에,나는 모두가 할 수 있 다운로드는 게시된 버전의 유물에 익명으로 합니다.

지금까지만 내가 발견되었을 추가하는 다음과 같은 섹션을 나 pom.xml

<distributionManagement>
    <snapshotRepository>
        <id>my.repo.snapshots</id>
        <name>My Repository - Snapshots</name>
        <url>${url}/snapshots</url>
    </snapshotRepository>
    <repository>
        <id>my.repo.releases</id>
        <name>My Repository - Releases</name>
        <url>${url}/releases</url>
    </repository>
</distributionManagement>

이 문제는 설정하지 않는 나에게 선택 FTP 을 위해 업로드,HTTP 다운로드 할 수 있습니다.

방법은 없을 구성 pom.xml 는 그렇게 하라고 하셨을까?

도움이 되었습니까?

해결책

밝혀 솔루션이었습니다.저장소 배포하기 위한 유물은 참으로 구성됩 <distributionManagement/>, 지만,저장소를 가져오는 유물을 통해 구성됩 <repositories> 요소 <profiles> 섹션입니다.

내 일 pom.xml 지금 구성 포함됩니다:

<distributionManagement>
    <repository>
        <id>deploy.releases</id>
        <name>Repository - Releases</name>
        <url>ftp://ftp.domain.com/releases/</url>
    </repository>
    <snapshotRepository>
        <id>deploy.snapshots</id>
        <name>Repository - Snapshots</name>
        <url>ftp://ftp.domain.com/snapshots/</url>
    </snapshotRepository>
</distributionManagement>

<profiles>
    <profile>
        <id>project.default</id>

        <activation>
            <property>
                <name>!skipProjectDefaultProfile</name>
            </property>
        </activation>

        <repositories>
            <repository>
                <id>repo.releases</id>
                <url>http://maven.domain.com/releases/</url>
            </repository>
            <repository>
                <id>repo.snapshots</id>
                <url>http://maven.domain.com/snapshots/</url>
            </repository>
        </repositories>
    </profile>
</profiles>

그 꼭대기에,나 settings.xml 인증 정보가 포함한 FTP

<servers>
    <server>
        <id>deploy.releases</id>
        <username>user</username>
        <password>pass</password>
    </server>
    <server>
        <id>deploy.snapshots</id>
        <username>user</username>
        <password>pass</password>
    </server>
</servers>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top