1 package org.apache.maven.settings; 2 3 import java.io.File ; 4 import java.util.HashMap ; 5 import java.util.Map ; 6 7 22 23 public class RuntimeInfo 24 { 25 26 private File file; 27 28 private Boolean pluginUpdateForced; 30 31 private Boolean applyToAllPluginUpdates; 33 34 36 39 private Map activeProfileToSourceLevel = new HashMap (); 40 41 private String localRepositorySourceLevel = TrackableBase.USER_LEVEL; 42 43 private Map pluginGroupIdSourceLevels = new HashMap (); 44 45 private final Settings settings; 46 47 public RuntimeInfo( Settings settings ) 48 { 49 this.settings = settings; 50 } 51 52 public void setFile( File file ) 53 { 54 this.file = file; 55 } 56 57 public File getFile() 58 { 59 return file; 60 } 61 62 public void setPluginUpdateOverride( Boolean pluginUpdateForced ) 63 { 64 this.pluginUpdateForced = pluginUpdateForced; 65 } 66 67 public Boolean getPluginUpdateOverride() 68 { 69 return pluginUpdateForced; 70 } 71 72 public Boolean getApplyToAllPluginUpdates() 73 { 74 return applyToAllPluginUpdates; 75 } 76 77 public void setApplyToAllPluginUpdates( Boolean applyToAll ) 78 { 79 this.applyToAllPluginUpdates = applyToAll; 80 } 81 82 public void setActiveProfileSourceLevel( String activeProfile, String sourceLevel ) 83 { 84 activeProfileToSourceLevel.put( activeProfile, sourceLevel ); 85 } 86 87 public String getSourceLevelForActiveProfile( String activeProfile ) 88 { 89 String sourceLevel = (String ) activeProfileToSourceLevel.get( activeProfile ); 90 91 if ( sourceLevel != null ) 92 { 93 return sourceLevel; 94 } 95 else 96 { 97 return settings.getSourceLevel(); 98 } 99 } 100 101 public void setPluginGroupIdSourceLevel( String pluginGroupId, String sourceLevel ) 102 { 103 pluginGroupIdSourceLevels.put( pluginGroupId, sourceLevel ); 104 } 105 106 public String getSourceLevelForPluginGroupId( String pluginGroupId ) 107 { 108 String sourceLevel = (String ) pluginGroupIdSourceLevels.get( pluginGroupId ); 109 110 if ( sourceLevel != null ) 111 { 112 return sourceLevel; 113 } 114 else 115 { 116 return settings.getSourceLevel(); 117 } 118 } 119 120 public void setLocalRepositorySourceLevel( String localRepoSourceLevel ) 121 { 122 this.localRepositorySourceLevel = localRepoSourceLevel; 123 } 124 125 public String getLocalRepositorySourceLevel() 126 { 127 return localRepositorySourceLevel; 128 } 129 130 } 131 | Popular Tags |