- public Object getObject() throws Exception {
- RemoteRepository remoteRepository = new RemoteRepository.Builder(
- id != null ? id : beanName, type, url).build();
- // FIXME Adapt to changes in Aether
- // if (username != null) {
- // Authentication authentication = new Authentication(username,
- // password);
- // remoteRepository.setAuthentication(authentication);
- // }
- return null;
+ public RemoteRepository getObject() throws Exception {
+ RemoteRepository.Builder builder = new RemoteRepository.Builder(
+ id != null ? id : beanName, type, url);
+ if (username != null) {
+ AuthenticationBuilder authBuilder = new AuthenticationBuilder();
+ authBuilder.addUsername(username);
+ authBuilder.addPassword(password);
+ builder.setAuthentication(authBuilder.build());
+ }
+ RemoteRepository remoteRepository = builder.build();
+ return remoteRepository;