Skip to content

Fixes #16 by adding ModiTect to generate a full Java module descriptor #36

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

Merged
merged 1 commit into from
Apr 27, 2023

Conversation

aalmiray
Copy link
Contributor

Resolved Java module looks like this:

$ jarviz module descriptor --file target/cdevents-sdk-java-v0.1.0-draft6.jar 
subject: cdevents-sdk-java-v0.1.0-draft6.jar
name: dev.cdevents
open: false
automatic: false
exports:
  dev.cdevents
  dev.cdevents.constants
  dev.cdevents.models
requires:
  com.fasterxml.jackson.core
  com.fasterxml.jackson.databind
  io.cloudevents.api
  io.cloudevents.core
  java.base mandated
  org.slf4j

Bytecode remains Java 8 compatible

$ jarviz bytecode show --file target/cdevents-sdk-java-v0.1.0-draft6.jar --details
subject: cdevents-sdk-java-v0.1.0-draft6.jar
Unversioned classes. Bytecode version: 52 (Java 8) total: 7
dev.cdevents.CDEventTypes
dev.cdevents.constants.CDEventConstants.Outcome
dev.cdevents.constants.CDEventConstants
dev.cdevents.constants.CDEventConstants.CDEventTypes
dev.cdevents.models.Environment
dev.cdevents.models.Repository
dev.cdevents.models.PipelineRun
Versioned classes 9. Bytecode version: 53 (Java 9) total: 1
module-info

JAR file is correctly identified as multi-release

$ jarviz manifest show --file target/cdevents-sdk-java-v0.1.0-draft6.jar
subject: cdevents-sdk-java-v0.1.0-draft6.jar
Manifest-Version: 1.0
Created-By: Maven Jar Plugin 3.2.0
Build-Jdk-Spec: 11
Implementation-Title: cdevents-sdk-java
Implementation-Version: v0.1.0-draft6
Implementation-Vendor: Continuous Delivery Foundation
Build-Jdk: 11.0.17 (Azul Systems, Inc. 11.0.17+8-LTS)
Build-OS: Mac OS X x86_64 11.6.5
Multi-Release: true

module-info.class is placed in versioned space

$ unzip -l target/cdevents-sdk-java-v0.1.0-draft6.jar 
Archive:  target/cdevents-sdk-java-v0.1.0-draft6.jar
  Length      Date    Time    Name
---------  ---------- -----   ----
      326  04-27-2023 10:20   META-INF/MANIFEST.MF
        0  04-27-2023 10:20   META-INF/
        0  04-27-2023 10:20   dev/
        0  04-27-2023 10:20   dev/cdevents/
        0  04-27-2023 10:20   dev/cdevents/constants/
        0  04-27-2023 10:20   dev/cdevents/models/
        0  04-27-2023 10:20   META-INF/maven/
        0  04-27-2023 10:20   META-INF/maven/dev.cdevents.sdk-java/
        0  04-27-2023 10:20   META-INF/maven/dev.cdevents.sdk-java/cdevents-sdk-java/
    14814  04-27-2023 10:20   dev/cdevents/CDEventTypes.class
     1621  04-27-2023 10:20   dev/cdevents/constants/CDEventConstants$Outcome.class
      568  04-27-2023 10:20   dev/cdevents/constants/CDEventConstants.class
     5370  04-27-2023 10:20   dev/cdevents/constants/CDEventConstants$CDEventTypes.class
     1302  04-27-2023 10:20   dev/cdevents/models/Environment.class
     1524  04-27-2023 10:20   dev/cdevents/models/Repository.class
     1854  04-27-2023 10:20   dev/cdevents/models/PipelineRun.class
    10829  04-27-2023 10:20   META-INF/maven/dev.cdevents.sdk-java/cdevents-sdk-java/pom.xml
       81  04-27-2023 10:20   META-INF/maven/dev.cdevents.sdk-java/cdevents-sdk-java/pom.properties
        0  04-27-2023 10:20   META-INF/versions/
        0  04-27-2023 10:20   META-INF/versions/9/
      378  04-27-2023 10:20   META-INF/versions/9/module-info.class
---------                     -------
    38667                     21 files

…escriptor

Signed-off-by: Andres Almiray <aalmiray@gmail.com>
Copy link
Contributor

@afrittoli afrittoli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thank you!

@rjalander rjalander merged commit 096635c into cdevents:main Apr 27, 2023
@aalmiray aalmiray deleted the java-modules branch April 27, 2023 09:14
@cdevents-bot cdevents-bot added the released Issue has been released label Jul 24, 2023
@cdevents-bot
Copy link
Collaborator

🎉 This issue has been resolved in v0.1.2 (Release Notes)

@cdevents-bot cdevents-bot added this to the v0.1.2 milestone Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Issue has been released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants