Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aether-users] Authorization Problem when Deploying

Hello everybody,

I have another problem using Eclipse Aether for deploying artifacts. It somehow seems to not obey my authorization settings in the settings.xml for the used repository Id.

I am doing the following:

final DeploymentRepository deploymentRepo = mavenProject.getDistributionManagement().getRepository();
RemoteRepository repository = new RemoteRepository.Builder(deploymentRepo.getId(), deploymentRepo.getLayout(), deploymentRepo.getUrl()).build();

final DeployRequest deployRequest = new DeployRequest();
deployRequest.setRepository(repository);
request.addArtifact(artifact); // artifact is a correctly set-up artifact

repoSystem.deploy(repoSession, deployRequest);

This means, I'm reading the repository from the injected MavenProject's pom.xml. Do I have to do anything else to correctly configure the credentials to use?

Note: A simple "mvn deploy" from the command line works as expected. This means, the problem is related to the Java code above, not to the Nexus repository manager.

Thanks for any hints.

Best regards
Timo

Back to the top