terraform-provider-nexus
terraform-provider-nexus copied to clipboard
Creating m2 group with `version_policy = "SNAPSHOT"` produces a group repo with version policy as `Release`
Describe the bug
terraform plan
tells me the following as part of the attached TF files run (this is a subset)
# nexus_repository.op2-snapshot-group-m2 will be created
+ resource "nexus_repository" "op2-snapshot-group-m2" {
+ format = "maven2"
+ id = (known after apply)
+ name = "op2-snapshot-group-m2"
+ online = true
+ type = "group"
+ group {
+ member_names = [
+ "op2-release-group-m2",
+ "op2-snapshot-m2",
]
}
+ maven {
+ layout_policy = "STRICT"
+ version_policy = "SNAPSHOT"
}
+ storage {
+ blob_store_name = "op2-snapshot-group-m2"
+ strict_content_type_validation = true
+ write_policy = "ALLOW"
}
}
To Reproduce
- modify obv.tf.zip contents to give the group some actual member repos that exist
- terraform apply
- see that
op2-snapshot-group-m2
is of typeRelease
Expected behavior
op2-snapshot-group-m2
should have version policy of Snapshot
hi @mykelalvis-rialtic,
thanks for your report. Unfortunately the nexus api does not support maven options for creating a maven group.
here is the important excerpt from api version 3.37:
"MavenGroupRepositoryApiRequest": {
"type": "object",
"required": [
"group",
"name",
"online",
"storage"
],
"properties": {
"name": {
"type": "string",
"example": "internal",
"description": "A unique identifier for this repository",
"pattern": "^[a-zA-Z0-9\\-]{1}[a-zA-Z0-9_\\-\\.]*$"
},
"online": {
"type": "boolean",
"example": true,
"description": "Whether this repository accepts incoming requests"
},
"storage": {
"$ref": "#/definitions/StorageAttributes"
},
"group": {
"$ref": "#/definitions/GroupAttributes"
}
}
},
I am sorry that this cannot be seen. We are in the process of splitting up the repository resource so that everything is easier to use. I will open a request at sonatype for the this feature in the api
regards André
Issue at nexus jira is created. here: https://issues.sonatype.org/browse/NEXUS-30501
So...to be clear....the Nexus API forces you to select an option that cannot be changed at a later date. #genius 😄
Also...thanks! I'll try to work that from my end, as well.
And just so everyone understands why, it appears that if I set the version_policy to release, then it only resolves releases. Thus a true snapshot group seems effectively impossible to produce with this provider at the present time.
This issue has been automatically marked as stale
because it has had no activity in the last 90 days. It will be closed in 7 days if no further activity occurs. Leaving a comment starting with /fresh
will mark this issue as not stale.