File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -114,11 +114,24 @@ private File getM2HomeDirectory() {
114
114
if (StringUtils .hasLength (grapeRoot )) {
115
115
return new File (grapeRoot );
116
116
}
117
+ return getDefaultM2HomeDirectory ();
118
+ }
119
+
120
+ private File getDefaultM2HomeDirectory () {
121
+ String mavenRoot = System .getProperty ("maven.home" );
122
+ if (StringUtils .hasLength (mavenRoot )) {
123
+ return new File (mavenRoot );
124
+ }
117
125
return new File (System .getProperty ("user.home" ), ".m2" );
118
126
}
119
127
120
128
private Set <RemoteRepository > getRemoteRepositories () {
121
129
LinkedHashSet <RemoteRepository > repositories = new LinkedHashSet <RemoteRepository >();
130
+ String grapeRoot = System .getProperty ("grape.root" );
131
+ if (StringUtils .hasLength (grapeRoot )) {
132
+ addRemoteRepository (repositories , "local" , new File (
133
+ getDefaultM2HomeDirectory (), "repository" ).toURI ().toASCIIString ());
134
+ }
122
135
addRemoteRepository (repositories , "central" , "http://repo1.maven.org/maven2/" );
123
136
return repositories ;
124
137
}
You can’t perform that action at this time.
0 commit comments