This commit is contained in:
Phillip Webb
2015-07-14 22:17:52 -07:00
parent 68d875bdc6
commit f0f5f78e25
17 changed files with 69 additions and 58 deletions

View File

@@ -74,8 +74,9 @@ public class MavenSettings {
private final List<Profile> activeProfiles;
/**
* @param settings
* @param decryptedSettings
* Create a new {@link MavenSettings} instance.
* @param settings the source settings
* @param decryptedSettings the decrypted settings
*/
public MavenSettings(Settings settings, SettingsDecryptionResult decryptedSettings) {
this.offline = settings.isOffline();
@@ -166,7 +167,8 @@ public class MavenSettings {
org.apache.maven.model.Profile modelProfile = new org.apache.maven.model.Profile();
modelProfile.setId(profile.getId());
if (profile.getActivation() != null) {
modelProfile.setActivation(createModelActivation(profile.getActivation()));
modelProfile
.setActivation(createModelActivation(profile.getActivation()));
}
modelProfiles.add(modelProfile);
}

View File

@@ -91,15 +91,16 @@ public class MavenSettingsReader {
return settingsDecrypter;
}
private void setField(Class<?> clazz, String fieldName, Object target, Object value) {
private void setField(Class<?> sourceClass, String fieldName, Object target,
Object value) {
try {
Field field = clazz.getDeclaredField(fieldName);
Field field = sourceClass.getDeclaredField(fieldName);
field.setAccessible(true);
field.set(target, value);
}
catch (Exception e) {
catch (Exception ex) {
throw new IllegalStateException("Failed to set field '" + fieldName
+ "' on '" + target + "'", e);
+ "' on '" + target + "'", ex);
}
}

View File

@@ -44,7 +44,6 @@ public final class RepositoryConfigurationFactory {
"spring-snapshot", URI.create("http://repo.spring.io/snapshot"), true);
private RepositoryConfigurationFactory() {
}
/**