Package org.apache.maven.model.building
Class DefaultModelBuildingRequest
java.lang.Object
org.apache.maven.model.building.DefaultModelBuildingRequest
- All Implemented Interfaces:
- ModelBuildingRequest
Collects settings that control building of effective models.
- Author:
- Benjamin Bentmann
- 
Field SummaryFields inherited from interface org.apache.maven.model.building.ModelBuildingRequestVALIDATION_LEVEL_MAVEN_2_0, VALIDATION_LEVEL_MAVEN_3_0, VALIDATION_LEVEL_MAVEN_3_1, VALIDATION_LEVEL_MINIMAL, VALIDATION_LEVEL_STRICT
- 
Constructor SummaryConstructorsConstructorDescriptionCreates an empty request.Creates a shallow copy of the specified request.
- 
Method SummaryModifier and TypeMethodDescriptionGets the identifiers of those profiles that should be activated by explicit demand.Gets the start time of the build.Gets the identifiers of those profiles that should be deactivated by explicit demand.Gets the model building listener to notify during the build process.Gets the model cache to use for reuse of previously built models.Gets the model resolver to use for resolution of mixins or parents that are not locally reachable from the project directory.Gets the source of the POM to process.Gets the POM file of the project to build.Gets the external profiles that should be considered for model building.Gets the raw model to build.Gets the system properties to use for interpolation and profile activation.Gets the user properties to use for interpolation and profile activation.intGets the level of validation to perform on processed models.booleanIndicates whether the model should track the line/column number of the model source from which it was parsed.booleanIndicates whether plugin executions and configurations should be processed.booleanIndicates whether the model building should happen in two phases.setActiveProfileIds(List<String> activeProfileIds) Sets the identifiers of those profiles that should be activated by explicit demand.setBuildStartTime(Date buildStartTime) Sets the start time of the build.setInactiveProfileIds(List<String> inactiveProfileIds) Sets the identifiers of those profiles that should be deactivated by explicit demand.setLocationTracking(boolean locationTracking) Enables/disables the tracking of line/column numbers for the model source being parsed.setModelBuildingListener(ModelBuildingListener modelBuildingListener) Sets the model building listener to notify during the build process.setModelCache(ModelCache modelCache) Sets the model cache to use for reuse of previously built models.setModelResolver(ModelResolver modelResolver) Sets the model resolver to use for resolution of mixins or parents that are not locally reachable from the project directory.setModelSource(ModelSource modelSource) Sets the source of the POM to process.setPomFile(File pomFile) Sets the POM file of the project to build.setProcessPlugins(boolean processPlugins) Controls the processing of plugin executions and configurations.setProfiles(List<Profile> profiles) Sets the external profiles that should be considered for model building.setRawModel(Model rawModel) Set raw model.setSystemProperties(Properties systemProperties) Sets the system properties to use for interpolation and profile activation.setTwoPhaseBuilding(boolean twoPhaseBuilding) Enables/disables two-phase building.setUserProperties(Properties userProperties) Sets the user properties to use for interpolation and profile activation.setValidationLevel(int validationLevel) Sets the level of validation to perform on processed models.setWorkspaceModelResolver(WorkspaceModelResolver workspaceResolver) 
- 
Constructor Details- 
DefaultModelBuildingRequestpublic DefaultModelBuildingRequest()Creates an empty request.
- 
DefaultModelBuildingRequestCreates a shallow copy of the specified request.- Parameters:
- request- The request to copy, must not be- null.
 
 
- 
- 
Method Details- 
getPomFileDescription copied from interface:ModelBuildingRequestGets the POM file of the project to build.- Specified by:
- getPomFilein interface- ModelBuildingRequest
- Returns:
- The POM file of the project or nullif not applicable (i.e. when processing a POM from the repository).
 
- 
setPomFileDescription copied from interface:ModelBuildingRequestSets the POM file of the project to build. Note that providing the path to a POM file via this method will make the model builder operate in project mode. This mode is meant for effective models that are employed during the build process of a local project. Hence the effective model will support the notion of a project directory. To build the model for a POM from the repository, useModelBuildingRequest.setModelSource(ModelSource)in combination with aFileModelSourceinstead.- Specified by:
- setPomFilein interface- ModelBuildingRequest
- Parameters:
- pomFile- The POM file of the project to build the effective model for, may be- nullto build the model of some POM from the repository.
- Returns:
- This request, never null.
 
- 
getModelSourceDescription copied from interface:ModelBuildingRequestGets the source of the POM to process.- Specified by:
- getModelSourcein interface- ModelBuildingRequest
- Returns:
- The source of the POM or nullif not set.
 
- 
setModelSourceDescription copied from interface:ModelBuildingRequestSets the source of the POM to process. Eventually, eitherModelBuildingRequest.setModelSource(ModelSource)orModelBuildingRequest.setPomFile(File)must be set.- Specified by:
- setModelSourcein interface- ModelBuildingRequest
- Parameters:
- modelSource- The source of the POM to process, may be- null.
- Returns:
- This request, never null.
 
- 
getValidationLevelpublic int getValidationLevel()Description copied from interface:ModelBuildingRequestGets the level of validation to perform on processed models.- Specified by:
- getValidationLevelin interface- ModelBuildingRequest
- Returns:
- The level of validation to perform on processed models.
 
- 
setValidationLevelDescription copied from interface:ModelBuildingRequestSets the level of validation to perform on processed models. For building of projects,ModelBuildingRequest.VALIDATION_LEVEL_STRICTshould be used to ensure proper building. For the mere retrieval of dependencies during artifact resolution,ModelBuildingRequest.VALIDATION_LEVEL_MINIMALshould be used to account for models of poor quality. By default, models are validated in strict mode.- Specified by:
- setValidationLevelin interface- ModelBuildingRequest
- Parameters:
- validationLevel- The level of validation to perform on processed models.
- Returns:
- This request, never null.
 
- 
isProcessPluginspublic boolean isProcessPlugins()Description copied from interface:ModelBuildingRequestIndicates whether plugin executions and configurations should be processed. If enabled, lifecycle-induced plugin executions will be injected into the model and common plugin configuration will be propagated to individual executions.- Specified by:
- isProcessPluginsin interface- ModelBuildingRequest
- Returns:
- trueif plugins should be processed,- falseotherwise.
 
- 
setProcessPluginsDescription copied from interface:ModelBuildingRequestControls the processing of plugin executions and configurations.- Specified by:
- setProcessPluginsin interface- ModelBuildingRequest
- Parameters:
- processPlugins-- trueto enable plugin processing,- falseotherwise.
- Returns:
- This request, never null.
 
- 
isTwoPhaseBuildingpublic boolean isTwoPhaseBuilding()Description copied from interface:ModelBuildingRequestIndicates whether the model building should happen in two phases. If enabled, the initial invocation of the model builder will only produce an interim result which may be used to analyze inter-model dependencies before the final invocation of the model builder is performed.- Specified by:
- isTwoPhaseBuildingin interface- ModelBuildingRequest
- Returns:
- trueif two-phase building is enabled,- falseif the model should be build in a single step.
 
- 
setTwoPhaseBuildingDescription copied from interface:ModelBuildingRequestEnables/disables two-phase building. If enabled, the initial invocation of the model builder will only produce an interim result which may be used to analyze inter-model dependencies before the final invocation of the model builder is performed.- Specified by:
- setTwoPhaseBuildingin interface- ModelBuildingRequest
- Parameters:
- twoPhaseBuilding-- trueto enable two-phase building,- falseif the model should be build in a single step.
- Returns:
- This request, never null.
 
- 
isLocationTrackingpublic boolean isLocationTracking()Description copied from interface:ModelBuildingRequestIndicates whether the model should track the line/column number of the model source from which it was parsed.- Specified by:
- isLocationTrackingin interface- ModelBuildingRequest
- Returns:
- trueif location tracking is enabled,- falseotherwise.
 
- 
setLocationTrackingDescription copied from interface:ModelBuildingRequestEnables/disables the tracking of line/column numbers for the model source being parsed. By default, input locations are not tracked.- Specified by:
- setLocationTrackingin interface- ModelBuildingRequest
- Parameters:
- locationTracking-- trueto enable location tracking,- falseto disable it.
- Returns:
- This request, never null.
 
- 
getProfilesDescription copied from interface:ModelBuildingRequestGets the external profiles that should be considered for model building.- Specified by:
- getProfilesin interface- ModelBuildingRequest
- Returns:
- The external profiles that should be considered for model building, never null.
 
- 
setProfilesDescription copied from interface:ModelBuildingRequestSets the external profiles that should be considered for model building.- Specified by:
- setProfilesin interface- ModelBuildingRequest
- Parameters:
- profiles- The external profiles that should be considered for model building, may be- null.
- Returns:
- This request, never null.
 
- 
getActiveProfileIdsDescription copied from interface:ModelBuildingRequestGets the identifiers of those profiles that should be activated by explicit demand.- Specified by:
- getActiveProfileIdsin interface- ModelBuildingRequest
- Returns:
- The identifiers of those profiles to activate, never null.
 
- 
setActiveProfileIdsDescription copied from interface:ModelBuildingRequestSets the identifiers of those profiles that should be activated by explicit demand.- Specified by:
- setActiveProfileIdsin interface- ModelBuildingRequest
- Parameters:
- activeProfileIds- The identifiers of those profiles to activate, may be- null.
- Returns:
- This request, never null.
 
- 
getInactiveProfileIdsDescription copied from interface:ModelBuildingRequestGets the identifiers of those profiles that should be deactivated by explicit demand.- Specified by:
- getInactiveProfileIdsin interface- ModelBuildingRequest
- Returns:
- The identifiers of those profiles to deactivate, never null.
 
- 
setInactiveProfileIdsDescription copied from interface:ModelBuildingRequestSets the identifiers of those profiles that should be deactivated by explicit demand.- Specified by:
- setInactiveProfileIdsin interface- ModelBuildingRequest
- Parameters:
- inactiveProfileIds- The identifiers of those profiles to deactivate, may be- null.
- Returns:
- This request, never null.
 
- 
getSystemPropertiesDescription copied from interface:ModelBuildingRequestGets the system properties to use for interpolation and profile activation. The system properties are collected from the runtime environment likeSystem.getProperties()and environment variables.- Specified by:
- getSystemPropertiesin interface- ModelBuildingRequest
- Returns:
- The system properties, never null.
 
- 
setSystemPropertiesDescription copied from interface:ModelBuildingRequestSets the system properties to use for interpolation and profile activation. The system properties are collected from the runtime environment likeSystem.getProperties()and environment variables.- Specified by:
- setSystemPropertiesin interface- ModelBuildingRequest
- Parameters:
- systemProperties- The system properties, may be- null.
- Returns:
- This request, never null.
 
- 
getUserPropertiesDescription copied from interface:ModelBuildingRequestGets the user properties to use for interpolation and profile activation. The user properties have been configured directly by the user on his discretion, e.g. via the-Dkey=valueparameter on the command line.- Specified by:
- getUserPropertiesin interface- ModelBuildingRequest
- Returns:
- The user properties, never null.
 
- 
setUserPropertiesDescription copied from interface:ModelBuildingRequestSets the user properties to use for interpolation and profile activation. The user properties have been configured directly by the user on his discretion, e.g. via the-Dkey=valueparameter on the command line.- Specified by:
- setUserPropertiesin interface- ModelBuildingRequest
- Parameters:
- userProperties- The user properties, may be- null.
- Returns:
- This request, never null.
 
- 
getBuildStartTimeDescription copied from interface:ModelBuildingRequestGets the start time of the build.- Specified by:
- getBuildStartTimein interface- ModelBuildingRequest
- Returns:
- The start time of the build or nullif unknown.
 
- 
setBuildStartTimeDescription copied from interface:ModelBuildingRequestSets the start time of the build.- Specified by:
- setBuildStartTimein interface- ModelBuildingRequest
- Parameters:
- buildStartTime- The start time of the build, may be- null.
- Returns:
- This request, never null.
 
- 
getModelResolverDescription copied from interface:ModelBuildingRequestGets the model resolver to use for resolution of mixins or parents that are not locally reachable from the project directory.- Specified by:
- getModelResolverin interface- ModelBuildingRequest
- Returns:
- The model resolver or nullif not set.
 
- 
setModelResolverDescription copied from interface:ModelBuildingRequestSets the model resolver to use for resolution of mixins or parents that are not locally reachable from the project directory.- Specified by:
- setModelResolverin interface- ModelBuildingRequest
- Parameters:
- modelResolver- The model resolver to use, never- null.
- Returns:
- This request, never null.
 
- 
getModelBuildingListenerDescription copied from interface:ModelBuildingRequestGets the model building listener to notify during the build process.- Specified by:
- getModelBuildingListenerin interface- ModelBuildingRequest
- Returns:
- The model building listener to notify or nullif none.
 
- 
setModelBuildingListenerDescription copied from interface:ModelBuildingRequestSets the model building listener to notify during the build process.- Specified by:
- setModelBuildingListenerin interface- ModelBuildingRequest
- Parameters:
- modelBuildingListener- The model building listener to notify, may be- null.
- Returns:
- This request, never null.
 
- 
getModelCacheDescription copied from interface:ModelBuildingRequestGets the model cache to use for reuse of previously built models.- Specified by:
- getModelCachein interface- ModelBuildingRequest
- Returns:
- The model cache or nullif not set.
 
- 
setModelCacheDescription copied from interface:ModelBuildingRequestSets the model cache to use for reuse of previously built models. This is an optional component that serves performance optimizations.- Specified by:
- setModelCachein interface- ModelBuildingRequest
- Parameters:
- modelCache- The model cache to use, may be- null.
- Returns:
- This request, never null.
 
- 
getRawModelDescription copied from interface:ModelBuildingRequestGets the raw model to build. If not set, model source will be used to load raw model.- Specified by:
- getRawModelin interface- ModelBuildingRequest
- Returns:
- The raw model to build or nullif not set.
 
- 
setRawModelDescription copied from interface:ModelBuildingRequestSet raw model.- Specified by:
- setRawModelin interface- ModelBuildingRequest
 
- 
getWorkspaceModelResolver- Specified by:
- getWorkspaceModelResolverin interface- ModelBuildingRequest
 
- 
setWorkspaceModelResolver- Specified by:
- setWorkspaceModelResolverin interface- ModelBuildingRequest
 
 
-