Skip to content

Add 'Automatic-Module-Name' property to aws-lambda-java-core MANIFEST.MF #142

New issue

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

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

Already on GitHub? # to your account

Open
jhg023 opened this issue Jun 6, 2020 · 10 comments · May be fixed by #510
Open

Add 'Automatic-Module-Name' property to aws-lambda-java-core MANIFEST.MF #142

jhg023 opened this issue Jun 6, 2020 · 10 comments · May be fixed by #510

Comments

@jhg023
Copy link

jhg023 commented Jun 6, 2020

aws-lambda-java-core's lack of an Automatic-Module-Name property in its META-INF/MANIFEST.MF is preventing me from modularizing my Java project.

Attempting to require the automatic module in my module-info.java with
requires aws.lambda.java.core; results in the following Gradle error:

> Task :*******:compileJava FAILED
C:\Users\Jacob\IdeaProjects\***-******-*********\*******\src\main\java\module-info.java:4: error: module not found: aws.lambda.java.core
    requires aws.lambda.java.core;

Environment:

C:\Users\Jacob\IdeaProjects\***-******-*********>gradlew -v

------------------------------------------------------------
Gradle 6.5
------------------------------------------------------------

Build time:   2020-06-02 20:46:21 UTC
Revision:     a27f41e4ae5e8a41ab9b19f8dd6d86d7b384dad4

Kotlin:       1.3.72
Groovy:       2.5.11
Ant:          Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM:          14.0.1 (Oracle Corporation 14.0.1+7)
OS:           Windows 10 10.0 amd64
@msailes
Copy link
Collaborator

msailes commented Jun 8, 2020

Hi Jacob,

Thanks for raising this issue.

I think named will be important here, I'll throw out these ideas. A combination of the groupId and the key parts of the artifactId.

com.amazonaws.lambda.core
com.amazonaws.lambda.events
com.amazonaws.lambda.eventstransformer
com.amazonaws.lambda.log4j
com.amazonaws.lambda.log4j2

Thoughts?

@jhg023
Copy link
Author

jhg023 commented Jun 8, 2020

Mark,

Thanks for the quick response.

I agree with the names you've suggested. However, I'm not sure if it's recommended to suffix a module name with a digit (com.amazonaws.lambda.log4j2), but I'm not able to suggest anything better.

@SingingBush
Copy link

I've done as PR using the following naming convention for module names:

aws.lambda.core
aws.lambda.events
aws.lambda.events.sdk.transformer
aws.lambda.log4j2
aws.lambda.runtime.interface.client
aws.lambda.serialization

I'm happy to rename them to com.amazonaws.lambda.* instead of aws.lambda.* if required.

@SentryMan
Copy link

I'm building a modular library that uses aws lambda core, it would be great if we could get this moving so that I don't constantly get these compiler warnings
image

@smirnoal
Copy link
Contributor

smirnoal commented Sep 3, 2024

all libraries in this repository compiled with java8

module-info.java is supported since java9. Is there a way to have the required entry in META-INF/MANIFEST.MF to enable modularisation, and at the same time keep java8 compiler?

@SentryMan
Copy link

You can have automatic modules with java 8. module-info.java is the only thing java 9+ exclusive

@SingingBush
Copy link

note that aws.lambda.runtime.interface.client isn't a valid module name as it contains a keyword. I've changed the PR to simply use aws.lambda.runtime.client

@SentryMan SentryMan linked a pull request Sep 3, 2024 that will close this issue
@SentryMan
Copy link

SentryMan commented Sep 3, 2024

module-info.java is the only thing java 9+ exclusive

I said that, but there is a way to add a module-info.class to a java 8 jar without breaking compatibility. I have created a PR for the core module.

@SingingBush
Copy link

I'm in favour of using the moditect plugin over simply defining an automatic module name. Having a module-info is the better option.

@SentryMan
Copy link

So how are we feeling? Do we plan to merge that PR?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants