summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
c0eff4a)
package org.argeo.slc.aether.spring;
package org.argeo.slc.aether.spring;
+import org.sonatype.aether.repository.Authentication;
import org.sonatype.aether.repository.RemoteRepository;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.beans.factory.FactoryBean;
import org.sonatype.aether.repository.RemoteRepository;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.beans.factory.FactoryBean;
private String id;
private String url;
private String type = "default";
private String id;
private String url;
private String type = "default";
+ private String username;
+ private String password;
public Object getObject() throws Exception {
public Object getObject() throws Exception {
- return new RemoteRepository(id != null ? id : beanName, type, url);
+ RemoteRepository remoteRepository = new RemoteRepository(
+ id != null ? id : beanName, type, url);
+ if (username != null) {
+ Authentication authentication = new Authentication(username,
+ password);
+ remoteRepository.setAuthentication(authentication);
+ }
+ return remoteRepository;
}
public Class<?> getObjectType() {
}
public Class<?> getObjectType() {
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
+