From issues-return-168761-archive-asf-public=cust-asf.ponee.io@maven.apache.org Sat Jun 27 12:48:03 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id D9EA418066D for ; Sat, 27 Jun 2020 14:48:02 +0200 (CEST) Received: (qmail 30384 invoked by uid 500); 27 Jun 2020 12:48:02 -0000 Mailing-List: contact issues-help@maven.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@maven.apache.org Delivered-To: mailing list issues@maven.apache.org Received: (qmail 30176 invoked by uid 99); 27 Jun 2020 12:48:01 -0000 Received: from mailrelay1-us-west.apache.org (HELO mailrelay1-us-west.apache.org) (209.188.14.139) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 27 Jun 2020 12:48:01 +0000 Received: from jira-he-de.apache.org (static.172.67.40.188.clients.your-server.de [188.40.67.172]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id E167D420C3 for ; Sat, 27 Jun 2020 12:48:00 +0000 (UTC) Received: from jira-he-de.apache.org (localhost.localdomain [127.0.0.1]) by jira-he-de.apache.org (ASF Mail Server at jira-he-de.apache.org) with ESMTP id 1BA6A7803DF for ; Sat, 27 Jun 2020 12:48:00 +0000 (UTC) Date: Sat, 27 Jun 2020 12:48:00 +0000 (UTC) From: "Robert Scholte (Jira)" To: issues@maven.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (MCOMPILER-421) multi release jar issue with module-info.java when using provides MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/MCOMPILER-421?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17146942#comment-17146942 ] Robert Scholte commented on MCOMPILER-421: ------------------------------------------ my guess it that {{-cp ./target/classes/}} should be replaced with {{--patch-module =./target/classes}} or something like that. > multi release jar issue with module-info.java when using provides > ----------------------------------------------------------------- > > Key: MCOMPILER-421 > URL: https://issues.apache.org/jira/browse/MCOMPILER-421 > Project: Maven Compiler Plugin > Issue Type: Improvement > Affects Versions: 3.8.1 > Reporter: John Patrick > Priority: Major > > If you have the following structure you have to recompile everything for each version supported. > If you have the following code; > {code} > src/main/java/package/Service.java (1) > src/main/java/package/Example.java (2) > src/main/java/package/Java1dot8.java (3) > src/main/java11/package/Example.java (4) > src/main/java11/package/Java11.java (5) > src/main/java11/module-info.java (6) > src/main/java14/package/Example.java (7) > src/main/java14/package/Java14.java (8) > src/main/java14/module-info.java (9) > {code} > I expect the following jar structure; > {code} > package/Service.class (1) > package/Example.class (2) > package/Java1dot8.class (3) > META-INF/versions/11/package/Example.java (4) > META-INF/versions/11/package/Java11.java (5) > META-INF/versions/11/module-info.java (6) > META-INF/versions/14/package/Example.java (7) > META-INF/versions/14/package/Java14.java (8) > META-INF/versions/14/module-info.java (9) > {code} > Using the following maven configuration; > {code} > > > java11-main > compile > > compile > > > 11 > > 11 > > > ${project.basedir}/src/main/java11 > > true > > > > java14-main > compile > > compile > > > 14 > > 14 > > > ${project.basedir}/src/main/java14 > > true > > > > {code} > But due to needing to use provides and uses in the module-info.java > {code} > module MODULE_A { > exports PACKAGE_A; > uses PACKAGE_B.Service; > provides PACKAGE_B.Service > with PACKAGE_A.ServiceImpl; > } > {code} > I get compile errors with src/main/java11/module-info.java as that class is under src/main/java. So I need to change it to something like this so the compile see classes already compiled that are in target/classes; > {code} > > > java11-main > compile > > compile > > > 11 > > 11 > > > ${project.basedir}/src/main/java > ${project.basedir}/src/main/java11 > > true > > > > java14-main > compile > > compile > > > 14 > > 14 > > > ${project.basedir}/src/main/java > ${project.basedir}/src/main/java11 > ${project.basedir}/src/main/java14 > > true > > > > {code} > Which then produces a jar looking something like this; > {code} > package/Service.class (1) > package/Example.class (2) > package/Java1dot8.class (3) > META-INF/versions/11/package/Java1dot8.class (3) > META-INF/versions/11/package/Example.java (4) > META-INF/versions/11/package/Java11.java (5) > META-INF/versions/11/module-info.java (6) > META-INF/versions/14/package/Java1dot8.class (3) > META-INF/versions/14/package/Java11.java (5) > META-INF/versions/14/package/Example.java (7) > META-INF/versions/14/package/Java14.java (8) > META-INF/versions/14/module-info.java (9) > {code} > One of the projects that needs this is https://github.com/nhojpatrick/nhojpatrick-cucumber/tree/feature/surefire-3.0.0-M5 > The actual module-info.java using provides is https://github.com/nhojpatrick/nhojpatrick-cucumber/blob/feature/surefire-3.0.0-M5/json-transformations/remove/src/main/java11/module-info.java -- This message was sent by Atlassian Jira (v8.3.4#803005)