Documentation ¶
Index ¶
- func DownloadAndCopySettingsFiles(globalSettingsFile string, projectSettingsFile string, fileUtils FileUtils, ...) error
- func DownloadAndGetMavenParameters(globalSettingsFile string, projectSettingsFile string, fileUtils FileUtils, ...) ([]string, error)
- func Evaluate(options *EvaluateOptions, expression string, command mavenExecRunner) (string, error)
- func Execute(options *ExecuteOptions, command mavenExecRunner) (string, error)
- func GetTestModulesExcludes() []string
- func InstallFile(file, pomFile string, options *EvaluateOptions, command mavenExecRunner) error
- func InstallMavenArtifacts(command mavenExecRunner, options *EvaluateOptions) error
- func VisitAllMavenModules(path string, utils visitUtils, excludes []string, ...) error
- type Dependency
- type EvaluateOptions
- type Exclusion
- type ExecuteOptions
- type FileUtils
- type ModuleInfo
- type Parent
- type Project
- type SettingsDownloadUtils
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DownloadAndCopySettingsFiles ¶ added in v1.62.0
func DownloadAndCopySettingsFiles(globalSettingsFile string, projectSettingsFile string, fileUtils FileUtils, httpClient SettingsDownloadUtils) error
DownloadAndCopySettingsFiles downloads the global or project settings file if the strings contain URLs. It copies the given files to either the locations specified in the environment variables M2_HOME and HOME or the default locations where maven expects them.
func DownloadAndGetMavenParameters ¶ added in v1.62.0
func DownloadAndGetMavenParameters(globalSettingsFile string, projectSettingsFile string, fileUtils FileUtils, httpClient SettingsDownloadUtils) ([]string, error)
DownloadAndGetMavenParameters downloads the global or project settings file if the strings contain URLs. It then constructs the arguments that need to be passed to maven in order to point to use these settings files.
func Evaluate ¶ added in v1.17.0
func Evaluate(options *EvaluateOptions, expression string, command mavenExecRunner) (string, error)
Evaluate constructs ExecuteOptions for using the maven-help-plugin's 'evaluate' goal to evaluate a given expression from a pom file. This allows to retrieve the value of - for example - 'project.version' from a pom file exactly as Maven itself evaluates it.
func Execute ¶
func Execute(options *ExecuteOptions, command mavenExecRunner) (string, error)
Execute constructs a mvn command line from the given options, and uses the provided mavenExecRunner to execute it.
func GetTestModulesExcludes ¶ added in v1.16.0
func GetTestModulesExcludes() []string
func InstallFile ¶ added in v1.44.0
func InstallFile(file, pomFile string, options *EvaluateOptions, command mavenExecRunner) error
InstallFile installs a maven artifact and its pom into the local maven repository. If "file" is empty, only the pom is installed. "pomFile" must not be empty.
func InstallMavenArtifacts ¶ added in v1.44.0
func InstallMavenArtifacts(command mavenExecRunner, options *EvaluateOptions) error
InstallMavenArtifacts finds maven modules (identified by pom.xml files) and installs the artifacts into the local maven repository.
func VisitAllMavenModules ¶ added in v1.87.0
func VisitAllMavenModules(path string, utils visitUtils, excludes []string, callback func(info ModuleInfo) error) error
VisitAllMavenModules ...
Types ¶
type Dependency ¶ added in v1.87.0
type Dependency struct { XMLName xml.Name `xml:"dependency"` GroupID string `xml:"groupId"` ArtifactID string `xml:"artifactId"` Version string `xml:"version"` Classifier string `xml:"classifier"` Type string `xml:"type"` Scope string `xml:"scope"` Exclusions []Exclusion `xml:"exclusions>exclusion"` }
Dependency describes a dependency of the module.
type EvaluateOptions ¶ added in v1.43.0
type EvaluateOptions struct { PomPath string `json:"pomPath,omitempty"` ProjectSettingsFile string `json:"projectSettingsFile,omitempty"` GlobalSettingsFile string `json:"globalSettingsFile,omitempty"` M2Path string `json:"m2Path,omitempty"` Defines []string `json:"defines,omitempty"` }
EvaluateOptions are used by Evaluate() to construct the Maven command line. In contrast to ExecuteOptions, fewer settings are required for Evaluate and thus a separate type is needed.
type Exclusion ¶ added in v1.87.0
type Exclusion struct { XMLName xml.Name `xml:"exclusion"` GroupID string `xml:"groupId"` ArtifactID string `xml:"artifactId"` }
Exclusion describes an exclusion within a dependency.
type ExecuteOptions ¶
type ExecuteOptions struct { PomPath string `json:"pomPath,omitempty"` ProjectSettingsFile string `json:"projectSettingsFile,omitempty"` GlobalSettingsFile string `json:"globalSettingsFile,omitempty"` M2Path string `json:"m2Path,omitempty"` Goals []string `json:"goals,omitempty"` Defines []string `json:"defines,omitempty"` Flags []string `json:"flags,omitempty"` LogSuccessfulMavenTransfers bool `json:"logSuccessfulMavenTransfers,omitempty"` ReturnStdout bool `json:"returnStdout,omitempty"` }
ExecuteOptions are used by Execute() to construct the Maven command line.
type FileUtils ¶ added in v1.98.0
type FileUtils interface { FileExists(filename string) (bool, error) Copy(src, dest string) (int64, error) MkdirAll(path string, perm os.FileMode) error Glob(pattern string) (matches []string, err error) }
FileUtils defines the external file-related functionality needed by this package.
type ModuleInfo ¶ added in v1.87.0
ModuleInfo describes a location and Project of a maven module.
type Parent ¶ added in v1.87.0
type Parent struct { XMLName xml.Name `xml:"parent"` GroupID string `xml:"groupId"` ArtifactID string `xml:"artifactId"` Version string `xml:"version"` }
Parent describes the coordinates a module's parent POM.
type Project ¶ added in v1.87.0
type Project struct { XMLName xml.Name `xml:"project"` Parent Parent `xml:"parent"` GroupID string `xml:"groupId"` ArtifactID string `xml:"artifactId"` Version string `xml:"version"` Packaging string `xml:"packaging"` Name string `xml:"name"` Dependencies []Dependency `xml:"dependencies>dependency"` Modules []string `xml:"modules>module"` }
Project describes the Maven object model.