Showing results for 
Show  only  | Search instead for 
Did you mean: 

AppDynamics Gradle Plugin (Android) does not support Maven repositories with non-password credentials



Project/environment setup:
1. Android Gradle Plugin: 8.1.1
2. AppDynamics Android agent: 23.7.1
3. Gradle version: 8.3
3. Java 17

In our company we need to migrate to new Maven repository (GitLab) and need to use header credentials for this new maven repo. Exactly as described in GitLab docs here:

So, basically our Maven repository configuration looks approximately like this:

maven {
url = uri("https://repo.url")
name = "GitLab"
credentials(HttpHeaderCredentials::class) {
name = "TokenHeader"
value = "TokenValue"
authentication {
create("header", HttpHeaderAuthentication::class)

The problem that once we add this to project configuration, the project starts failing on Gradle configuration stage with below stacktrace:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Can not use getCredentials() method when not using PasswordCredentials; please use getCredentials(Class)


* Exception is:
org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':app'.
Caused by: java.lang.IllegalStateException: Can not use getCredentials() method when not using PasswordCredentials; please use getCredentials(Class)
at org.gradle.api.internal.artifacts.repositories.AuthenticationSupporter.getCredentials(
at org.gradle.internal.metaobject.AbstractDynamicObject.getProperty(
at org.gradle.api.internal.artifacts.repositories.DefaultMavenArtifactRepository_Decorated.getProperty(Unknown Source)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at org.gradle.api.internal.artifacts.DefaultArtifactRepositoryContainer.addRepository(
at org.gradle.api.internal.artifacts.dsl.DefaultRepositoryHandler.maven(
at org.gradle.api.internal.artifacts.dsl.DefaultRepositoryHandler.maven(
at org.gradle.api.artifacts.dsl.RepositoryHandler$ Source)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(
at jdk.internal.reflect.GeneratedMethodAccessor2628.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(
at org.gradle.configuration.internal.DefaultListenerBuildOperationDecorator$BuildOperationEmittingInvocationHandler$1.lambda$run$0(

From what I understood AppDynamics plugin is trying to use somehow maven repositories mentioned in the project and trying to work with them via some reflection API. And only assume that Maven repositories can have authentication via username/password.

I also found that it is somehow related to `adeum.dependencyInjection.enabled` property, but it is poorly documented. Well, I have not found any documentation about what it is doing at all, only single sentence mentioning it here:

Anyway, after trying disabling this option, the project compiles, but app crashes in runtime when built.

So, questions are:

1. Is there any way to use Maven repository with non username/password option and AppDynamics plugin?
    We are not allowed to use different authentication for it, so AppDynamics plugin becoming a blocker for us for building the project.

2. Is there any documentation or knowledge about `adeum.dependencyInjection.enabled`, because it seems it is directly related to the issue?


Community Manager

Hi @Nick.Silin,

Since you created a Support ticket, can you share the learnings/outcome as a reply here please.


Ryan, Cisco AppDynamics Community Manager

Found something helpful? Click the Accept as Solution button to help others find answers faster.

Liked something? Click the Thumbs Up button.

Check out Observabiity in Action

new deep dive videos weekly in the Knowledge Base.