aws-samples / aws-codeguru-profiler-demo-application

Example application demonstrating the features of Amazon CodeGuru Profiler
MIT No Attribution
24 stars 73 forks source link

codeguru-profiler-java-agent no module name, etc. #12

Open brcolow opened 4 years ago

brcolow commented 4 years ago

The following dependency:

            <groupId>com.amazonaws</groupId>
            <artifactId>codeguru-profiler-java-agent</artifactId>
            <version>1.0.1</version>

Does not seem to provide a JPMS module name. Even if it is not a full-fledged module, it should provide a fallback module name. By the way, is the codeguru-profiler-java-agent open source? I can't seem to find it.

It's also somewhat strange that it is not on Maven Central (need to use a somewhat obscure looking cloudfront repository).

Sorry if this is the wrong place for such an issue.

mirelap-amazon commented 4 years ago

Currently we don't provide a JPMS module name. Also, the codeguru-profiler-java-agent is not open source and not yet released on Maven Central.

We will follow up in the team about the encountered issues to assess them.

Is any of this issues blocking you to use our java agent?

ivoanjo commented 4 years ago

Thanks @brcolow for the report!

Sorry if this is the wrong place for such an issue.

We usually would recommend the AWS forums although the team does monitor the repositories as well, so don't worry.

Do let us know if our current setup is causing issues, we definitely want to know about that.

brcolow commented 4 years ago

The blocking issue is that the project does not provide an Automatic-Module-Name in the manifest so it can be used with JPMS projects.

brcolow commented 4 years ago

Would it be possible to make the HTTPS https://d1osg35nybn3tt.cloudfront.net/com/amazonaws/codeguru-profiler-java-agent-standalone directory readable so that one can easily browse for the latest version?

ivoanjo commented 4 years ago

There's actually a way of getting a list of all the versions, including the latest ones -- by reading the maven metadata files:

Would this help for your use-case?

We know the current setup is somewhat awkward, and we're considering improvements around how we deliver the agent, but we don't have anything to announce yet.

brcolow commented 4 years ago

Yes, that works fine :).

ivoanjo commented 4 years ago

Awesome. Let's leave this ticket open until we're able to look into the JPMS issue, so we can report back :)

brcolow commented 4 years ago

Okay. The fix is for a non-modular Java project is to set the Automatic-Module-Name manifest entry for the JAR artifact. This is done differently depending on what build system you all are using internally (Maven, Gradle, etc.). Here's a good article in case you are unfamiliar.

ivoanjo commented 4 years ago

@brcolow:

It's also somewhat strange that it is not on Maven Central (need to use a somewhat obscure looking cloudfront repository).

That one is finally fixed as well: https://search.maven.org/search?q=g:software.amazon.codeguruprofiler :partying_face:

brcolow commented 4 years ago

Awesome!

brcolow commented 4 years ago

Any news on the JPMS Module-Name manifest entry?

brcolow commented 3 years ago

Any update on this issue? Can't use codeguru-profiler on a JPMS module.

ivoanjo commented 3 years ago

I've since left AWS, hopefully someone can chime in on the status for this :)

mirelap-amazon commented 3 years ago

Sorry for this, we don't have yet any updates to share.

olivergillespie commented 3 years ago

Hey @brcolow. I'm looking at adding the Automatic-Module-Name but I do have a concern about the standalone JAR we vend which bundles our dependencies too - I'm not sure of the consequences if I declare a module name there. I can look into whether we should only add it for the normal/thin JAR.

In the meantime, are you unblocked by using the automatically derived module name from the JAR file? In our case, that would be codeguru.profiler.java.agent.

brcolow commented 3 years ago

@olivergillespie Yes - I can do that - but I get a warning when building with Maven and it is not ideal - but it does unblock.

brcolow commented 3 years ago

For reference here is the warning that Maven gives when building without Automatic-Module-Name:

[WARNING] * Required filename-based automodules detected: [codeguru-profiler-java-agent-1.1.2.jar]. Please don't publish this project to a public artifact repository! *

It is the only such one in my project which is why I am being a stickler about it.