Comments (2)
Custom modified plugin with extra info messages helped me troubleshoot the problem.
I had to apply maven-settings plugin to subprojects.
Here is the diff of custom changes:
diff --git a/src/main/groovy/net/linguica/gradle/maven/settings/MavenSettingsPlugin.groovy b/src/main/groovy/net/linguica/gradle/maven/settings/MavenSettingsPlugin.groovy
index bc45f2b..37c7beb 100644
--- a/src/main/groovy/net/linguica/gradle/maven/settings/MavenSettingsPlugin.groovy
+++ b/src/main/groovy/net/linguica/gradle/maven/settings/MavenSettingsPlugin.groovy
@@ -58,8 +58,8 @@ public class MavenSettingsPlugin implements Plugin<Project> {
loadSettings(project, extension)
activateProfiles(project, extension)
registerMirrors(project)
- applyRepoCredentials(project.repositories)
- applyRepoCredentials(project.extensions.findByType(PublishingExtension)?.repositories)
+ applyRepoCredentials(project, project.repositories)
+ applyRepoCredentials(project, project.extensions.findByType(PublishingExtension)?.repositories)
}
}
@@ -132,16 +132,24 @@ public class MavenSettingsPlugin implements Plugin<Project> {
}
}
- private void applyRepoCredentials(@Nullable Collection<ArtifactRepository> repositories) {
+ private void applyRepoCredentials(Project project, @Nullable Collection<ArtifactRepository> repositories) {
repositories?.all { repo ->
+ project.logger.info "Discovered repository '${repo.name}'"
if (repo instanceof MavenArtifactRepository) {
settings.servers.each { server ->
if (repo.name == server.id) {
- addCredentials(server, repo)
+ project.logger.info "Found a matching server '${server.id}' in settings.xml"
+ addCredentials(project, server, repo)
}
}
+ } else {
+ project.logger.info "Repository '${repo.name}' is not a MavenArtifactRepository"
}
}
+
+ if (repositories == null || repositories.isEmpty()) {
+ project.logger.info "No repositories found for project '${project.name}'"
+ }
}
private void createMirrorRepository(Project project, Mirror mirror) {
@@ -169,12 +177,15 @@ public class MavenSettingsPlugin implements Plugin<Project> {
}
}
- private addCredentials(Server server, MavenArtifactRepository repo) {
+ private addCredentials(Project project, Server server, MavenArtifactRepository repo) {
if (server?.username != null && server?.password != null) {
repo.credentials {
username = server.username
password = server.password
}
+ project.logger.info "Applied server '${server.id}' credentials to ${repo.name} repository"
+ } else {
+ project.logger.info "No valid credentials found for '${server.id}' in settings.xml, username and/or password is missing"
}
}
}
from gradle-maven-settings-plugin.
Some additional logging seems like a no-brainer to me. I'd appreciate a pull request for this if you wouldn't mind.
from gradle-maven-settings-plugin.
Related Issues (20)
- Not compatible with Android build tools 2.2.0
- Credentials error from Gradle HOT 1
- Apply maven settings also to buildscript repositories HOT 4
- Is there out-of-the box support to configure userSettingsFileName from command line?
- Unable to decrypt local Maven settings credentials. HOT 7
- Trouble applying the plugin to multi module project. HOT 2
- Kotlin-dsl HOT 1
- Feature Request: Support HttpHeaders in Server Configuration
- Plugin misinterprets env-references in settings.xml as encrypted values
- Gradle configuration cache support
- Plugin not working on Android library modules
- Plugin fetch returns 502 repeatedly
- Using repo url as the identifier for associated credentials
- Plugin is not compatible with repositories in dependencyResolutionManagement HOT 1
- Plugin does not work anymore in gradle 8.2 HOT 2
- Bump project version to next snapshot HOT 1
- Enable publishing plugin snapshot to local maven repository HOT 1
- Is SSH supported for repository resolution? HOT 1
- Does not find security-settings.xml if it is not in ~/.m2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gradle-maven-settings-plugin.