terraform-provider-nexus icon indicating copy to clipboard operation
terraform-provider-nexus copied to clipboard

Not possible to set maven configuration on a nexus_repository_maven_group

Open thcuvelier opened this issue 1 year ago • 5 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Community Note

  • Please vote on this issue by adding a :thumbsup: reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Inpossible to setup on the maven group level the maven block maven { version_policy = "MIXED" layout_policy = "STRICT" content_disposition = "INLINE" }

where in nexus administration console it's possible.

image

Terraform Version

1.5.7

Nexus Provider Version

1.22.0

Nexus Version

3.49.0

Affected Resource(s)/Data Source(s)

nexus_repository_maven_group

Terraform Configuration Files

resource "nexus_repository_maven_group" "maven-public" {
  name   = "maven-public"
  online = true

  group {
    member_names     = [,nexus_repository_maven_hosted.maven-snapshots.name,nexus_repository_maven_proxy.maven-releases.name]
  }

  maven {
    version_policy   = "MIXED"
    layout_policy    = "STRICT"
    content_disposition = "INLINE"
  }

  storage {
    blob_store_name                = "default"
    strict_content_type_validation = true
  }

}

resource "nexus_repository_maven_hosted" "maven-releases" {
  name   = "maven-releases"
  online = true

  component {
    proprietary_components = false
  }

  storage {
    blob_store_name                = "default"
    strict_content_type_validation = true
    write_policy = "ALLOW_ONCE"
  }

  maven {
    version_policy   = "RELEASE"
    layout_policy    = "STRICT"
    content_disposition = "INLINE"
  }

}

resource "nexus_repository_maven_hosted" "maven-snapshots" {
  name   = "maven-snapshots"
  online = true

  component {
    proprietary_components = false
  }

  storage {
    blob_store_name                = "default"
    strict_content_type_validation = true
    write_policy = "ALLOW"
  }

  maven {
    version_policy   = "SNAPSHOT"
    layout_policy    = "STRICT"
    content_disposition = "INLINE"
  }

}

Debug Output/Panic Output

terraform apply
╷
│ Error: Unsupported block type
│
│   on __nexus-repos.tf line 38, in resource "nexus_repository_maven_group" "maven-public":
│   38:   maven {
│
│ Blocks of type "maven" are not expected here.

Expected Behaviour

Possibility to configure the maven block on the group level

Actual Behaviour

Not possible to configure the maven block on the group level

Steps to Reproduce

No response

References

No response

thcuvelier avatar Oct 09 '23 11:10 thcuvelier

hi @thcuvelier,

it looks like it will be the same problem as issue #148. Can you confirm that?

kind regards André

anmoel avatar Oct 10 '23 15:10 anmoel

it's looks like we can now set the configuration but cannot read the maven block from the nexus api

anmoel avatar Oct 10 '23 16:10 anmoel

I confirm that this is the same problem as issue #148.

thcuvelier avatar Oct 11 '23 05:10 thcuvelier

Hi @thcuvelier, we will implement the maven block into the resource nexus_repository_maven_group. But there are some problems. the Nexus API don't return the values for the maven block in a GET call. so we only can change the maven configuration at creation or update of the resource. the resource can not detect changes in the group repository.

After implementing, we will open a new issue for that and will inform the developer of sonatype.

anmoel avatar Oct 11 '23 10:10 anmoel

Thx waiting the new release

thcuvelier avatar Oct 11 '23 12:10 thcuvelier