-
-
Save shibafu528/19964371c7f894e1a0bf59779105b5f5 to your computer and use it in GitHub Desktop.
家の中にプロキシMaven置いてて、そこにリクエストを向けたい時に使うやつ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: HomeRepositoryPlugin | |
class HomeRepositoryPlugin implements Plugin<Gradle> { | |
private static String HOME_REPOSITORY_URL = "http://192.168.12.36:8081/repository/maven-public/"; | |
void apply(Gradle gradle) { | |
gradle.allprojects { project -> | |
project.repositories { | |
all { ArtifactRepository repo -> | |
if (repo instanceof MavenArtifactRepository) { | |
switch (repo.url.toString()) { | |
case "https://repo.maven.apache.org/maven2/": | |
case "https://jcenter.bintray.com/": | |
case "https://maven.google.com": | |
project.logger.lifecycle "Repository ${repo.url} removed." | |
remove repo | |
break | |
} | |
} | |
} | |
maven { | |
url HOME_REPOSITORY_URL | |
if (gradle.gradleVersion >= '7.0') { | |
allowInsecureProtocol true | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment