dotnet:initialize

Full name:

de.eitco.cicd:dotnet-maven-plugin:0.0.6:initialize

Description:

This goal registers nuget source repositories. A special one that helps mimic mavens local repository and additionally all repositories that are configured.

Attributes:

  • Requires a Maven project to be executed.
  • The goal is not marked as thread-safe and thus does not support parallel builds.
  • Binds by default to the lifecycle phase: initialize.

Optional Parameters

Name Type Since Description
<assemblyVersion> String - This parameter specifies the assembly version of this project. Keep in mind that the assembly version needs to consist of up to 4 numeric values separated by '.' e.g.: <major>.<minor>.<patch>.<build>.
<customProperties> Map<String,String> - This parameter specifies custom properties given to dotnet via '-p:'. Keep in mind that the 'Version', 'Company', 'Description', 'RepositoryUrl' and 'AssemblyVersion' properties will be overwritten by their respective parameters, when specified.
<dotnetExecutable> File - This parameter specifies the location of the dotnet executable. If not set dotnet being available by the PATH environment variable is assumed.
<environmentVariables> Map<String,String> - This parameter specifies additional environment variables to be added to the dotnet process.
Note that the DOTNET_CLI_TELEMETRY_OPTOUT will be set to TRUE if not overwritten with this parameter.
<localMavenNugetRepositoryBaseDirectory> String - This parameter specifies the location of the local nuget repository. The local nuget repository is a special file system repository this plugin copies the generated packages in the install phase to. This simulates mavens local repository.
Default: ${settings.localRepository}
<localMavenNugetRepositoryName> String - This parameter specifies the symbolic name of the local nuget repository. The local nuget repository is a special file system repository this plugin copies the generated packages in the install phase to. This simulates mavens local repository.
The location of the local nuget repository can be configured by localMavenNugetRepositoryBaseDirectory.
Default: maven-nuget-local
<nugetSources> Map<String,String> - This parameter specifies nuget sources to be added to the project. These are the locations where nuget will read dependencies from. The value of each entry is the url of the remote repository. The key is a unique name nuget will use to identify the repository by. It can also be used to add credentials to using <server> elements in the settings.xml.

Consider to encrypt passwords in your settings.xml

Note that crendentials added this way will be written to your nuget configuration file. On windows systems the credentials will be encrypted, however on linux systems password encryption is not supported by nuget - so the credentials will be written to the {code nuget} config way unencrypted.

<projectVersion> String - This parameter specifies the version of this project given to dotnet by the -p:Version= command line parameter.
Default: ${project.version}
<snapshotReplacement> String - This parameter specifies the replacement of the suffix '-SNAPSHOT' in version properties
Default: -build.%c
<targetDirectory> File - This parameter specifies the directory where dotnet writes its generated package(s) to.
Default: ${project.build.directory}/dotnet
<vendor> String - This parameter specifies the Company added to the compiles executables or libraries.
Default: ${project.organization.name}
<versionProperties> Map<String,String> - This parameter specifies properties that contain versions. They will be handled differently than normal properties to honour '-SNAPSHOT' dependencies. This happens in two steps per property:
  1. it is checked whether the property value ends with '-SNAPSHOT'
    • if not the value of the property is used
    • if it does end with '-SNAPSHOT' the ending substring '-SNAPSHOT' is replaced with the value of the parameter snapshotReplacement
  2. it is checked if the resulting string contains the string '%c'
    • if not this is the value used
    • if yes, the string will represent a version range: the minimum element is the string with every occurrence of '%c' replaced by '0', the (excluded) upper bound will be the string with every occurrence of '%c' replaced by 'A'

For example this configuration:

<versionProperties>
  <apacheVersion>3.1.4</apacheVersion>
  <someMavenDependencyVersion>1.5.6-dev-version-addendum-SNAPSHOT</someMavenDependencyVersion>
</versionProperties>

would result in two dotnet properties, referable with '$()' so that

$(apacheVersion) = 3.1.4
$(someMavenDependencyVersion) = [1.5.6-dev-version-addendum-build.0,1.5.6-dev-version-addendum-build.A)

<workingDirectory> File - This parameter specifies the directory where to execute dotnet and thus where the project files are located
Default: ${project.basedir}

Parameter Details

<assemblyVersion>

This parameter specifies the assembly version of this project. Keep in mind that the assembly version needs to consist of up to 4 numeric values separated by '.' e.g.: <major>.<minor>.<patch>.<build>.
  • Type: java.lang.String
  • Required: No

<customProperties>

This parameter specifies custom properties given to dotnet via '-p:'. Keep in mind that the 'Version', 'Company', 'Description', 'RepositoryUrl' and 'AssemblyVersion' properties will be overwritten by their respective parameters, when specified.
  • Type: java.util.Map<java.lang.String, java.lang.String>
  • Required: No

<dotnetExecutable>

This parameter specifies the location of the dotnet executable. If not set dotnet being available by the PATH environment variable is assumed.
  • Type: java.io.File
  • Required: No

<environmentVariables>

This parameter specifies additional environment variables to be added to the dotnet process.
Note that the DOTNET_CLI_TELEMETRY_OPTOUT will be set to TRUE if not overwritten with this parameter.
  • Type: java.util.Map<java.lang.String, java.lang.String>
  • Required: No

<localMavenNugetRepositoryBaseDirectory>

This parameter specifies the location of the local nuget repository. The local nuget repository is a special file system repository this plugin copies the generated packages in the install phase to. This simulates mavens local repository.
  • Type: java.lang.String
  • Required: No
  • Default: ${settings.localRepository}

<localMavenNugetRepositoryName>

This parameter specifies the symbolic name of the local nuget repository. The local nuget repository is a special file system repository this plugin copies the generated packages in the install phase to. This simulates mavens local repository.
The location of the local nuget repository can be configured by localMavenNugetRepositoryBaseDirectory.
  • Type: java.lang.String
  • Required: No
  • Default: maven-nuget-local

<nugetSources>

This parameter specifies nuget sources to be added to the project. These are the locations where nuget will read dependencies from. The value of each entry is the url of the remote repository. The key is a unique name nuget will use to identify the repository by. It can also be used to add credentials to using <server> elements in the settings.xml.

Consider to encrypt passwords in your settings.xml

Note that crendentials added this way will be written to your nuget configuration file. On windows systems the credentials will be encrypted, however on linux systems password encryption is not supported by nuget - so the credentials will be written to the {code nuget} config way unencrypted.

  • Type: java.util.Map<java.lang.String, java.lang.String>
  • Required: No

<projectVersion>

This parameter specifies the version of this project given to dotnet by the -p:Version= command line parameter.
  • Type: java.lang.String
  • Required: No
  • Default: ${project.version}

<snapshotReplacement>

This parameter specifies the replacement of the suffix '-SNAPSHOT' in version properties
  • Type: java.lang.String
  • Required: No
  • Default: -build.%c

<targetDirectory>

This parameter specifies the directory where dotnet writes its generated package(s) to.
  • Type: java.io.File
  • Required: No
  • Default: ${project.build.directory}/dotnet

<vendor>

This parameter specifies the Company added to the compiles executables or libraries.
  • Type: java.lang.String
  • Required: No
  • Default: ${project.organization.name}

<versionProperties>

This parameter specifies properties that contain versions. They will be handled differently than normal properties to honour '-SNAPSHOT' dependencies. This happens in two steps per property:
  1. it is checked whether the property value ends with '-SNAPSHOT'
    • if not the value of the property is used
    • if it does end with '-SNAPSHOT' the ending substring '-SNAPSHOT' is replaced with the value of the parameter snapshotReplacement
  2. it is checked if the resulting string contains the string '%c'
    • if not this is the value used
    • if yes, the string will represent a version range: the minimum element is the string with every occurrence of '%c' replaced by '0', the (excluded) upper bound will be the string with every occurrence of '%c' replaced by 'A'

For example this configuration:

<versionProperties>
  <apacheVersion>3.1.4</apacheVersion>
  <someMavenDependencyVersion>1.5.6-dev-version-addendum-SNAPSHOT</someMavenDependencyVersion>
</versionProperties>

would result in two dotnet properties, referable with '$()' so that

$(apacheVersion) = 3.1.4
$(someMavenDependencyVersion) = [1.5.6-dev-version-addendum-build.0,1.5.6-dev-version-addendum-build.A)

  • Type: java.util.Map<java.lang.String, java.lang.String>
  • Required: No

<workingDirectory>

This parameter specifies the directory where to execute dotnet and thus where the project files are located
  • Type: java.io.File
  • Required: No
  • Default: ${project.basedir}