Maven: how to setup my pom.xml so that it can fetch depencies via HTTP and deploy module via FTP -
i'm trying setup pom.xml 1 of projects. , can't figure out how make fetch dependencies via http, deploy new artifacts via ftp.
here's situation. have multi-module project on working collaboratively other people. happen rent cheap web server allow me share release , snapshot versions of of modules via maven repository.
i want deployment repository authenticated (so authorized people can write it) , done via ftp.
on other hand, want able download published version of artifacts anonymously via http.
so far, thing found add following section 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>
the problem setup doesn't let me pick ftp upload , http download.
is there way configure pom.xml that?
turns out solution right under nose. repositories deploying artifacts indeed configured through <distributionmanagement/>
, repositories fetching artifacts configured through <repositories>
element in <profiles>
section.
my working pom.xml configuration includes:
<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>
on top of that, settings.xml contains authentication information 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>
Comments
Post a Comment