Fix package tangle in CLI

pull/4242/merge
Phillip Webb 9 years ago
parent 88cc883e94
commit 9be0020f7b

@ -25,6 +25,8 @@ import org.apache.maven.settings.Profile;
import org.apache.maven.settings.Repository;
import org.springframework.boot.cli.compiler.grape.RepositoryConfiguration;
import org.springframework.boot.cli.compiler.maven.MavenSettings;
import org.springframework.boot.cli.compiler.maven.MavenSettingsReader;
import org.springframework.util.StringUtils;
/**

@ -20,8 +20,8 @@ import org.eclipse.aether.DefaultRepositorySystemSession;
import org.eclipse.aether.RepositorySystem;
import org.eclipse.aether.repository.LocalRepository;
import org.springframework.boot.cli.compiler.MavenSettings;
import org.springframework.boot.cli.compiler.MavenSettingsReader;
import org.springframework.boot.cli.compiler.maven.MavenSettings;
import org.springframework.boot.cli.compiler.maven.MavenSettingsReader;
/**
* Auto-configuration for a RepositorySystemSession that uses Maven's settings.xml to
@ -35,19 +35,21 @@ public class SettingsXmlRepositorySystemSessionAutoConfiguration
@Override
public void apply(DefaultRepositorySystemSession session,
RepositorySystem repositorySystem) {
MavenSettings settings = getSettings(session);
String localRepository = settings.getLocalRepository();
if (localRepository != null) {
session.setLocalRepositoryManager(repositorySystem.newLocalRepositoryManager(
session, new LocalRepository(localRepository)));
}
}
private MavenSettings getSettings(DefaultRepositorySystemSession session) {
MavenSettings settings = new MavenSettingsReader().readSettings();
session.setOffline(settings.getOffline());
session.setMirrorSelector(settings.getMirrorSelector());
session.setAuthenticationSelector(settings.getAuthenticationSelector());
session.setProxySelector(settings.getProxySelector());
String localRepository = settings.getLocalRepository();
if (localRepository != null) {
session.setLocalRepositoryManager(repositorySystem.newLocalRepositoryManager(
session, new LocalRepository(localRepository)));
}
return settings;
}
}

@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.cli.compiler;
package org.springframework.boot.cli.compiler.maven;
import java.io.File;
import java.io.PrintWriter;

@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.cli.compiler;
package org.springframework.boot.cli.compiler.maven;
import java.io.File;
import java.lang.reflect.Field;
Loading…
Cancel
Save