Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add Premain-Class attribute to JAR manifest? #3133

Closed
amordahl opened this issue Apr 28, 2024 · 1 comment
Closed

How to add Premain-Class attribute to JAR manifest? #3133

amordahl opened this issue Apr 28, 2024 · 1 comment

Comments

@amordahl
Copy link

I am new to using Mill, and I am trying to build an instrumentation agent, but I can't figure out how to generate a manifest file that includes a Premain-Class attribute. I noticed issue 624 said that "You can overwrite the def manifest: T[JarManifest] target and append any manifest entry you want" but I'm not really sure how to achieve this. Thanks!

@lefou
Copy link
Member

lefou commented Apr 29, 2024

You can add a Premain-Class entry to the manifest by overriding the manifest target of your JavaModule or ScalaModule:

def manifest = T {
  super.manifest().add("Premain-Class" -> "org.example.PremainAgent")
}

@com-lihaoyi com-lihaoyi locked and limited conversation to collaborators Apr 29, 2024
@lefou lefou converted this issue into discussion #3134 Apr 29, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants