[jira] [Created] (SUREFIRE-2200) JEP 443: Illegal field name "" in class

2023-10-09 Thread Sebastian Stenzel (Jira)
Sebastian Stenzel created SUREFIRE-2200:
---

 Summary: JEP 443: Illegal field name "" in class
 Key: SUREFIRE-2200
 URL: https://issues.apache.org/jira/browse/SUREFIRE-2200
 Project: Maven Surefire
  Issue Type: Bug
  Components: Maven Surefire Plugin
Affects Versions: 3.1.2
 Environment: JDK 21 GA
Maven 3.9.4
junit-jupiter 5.10.0
maven-surefire-plugin 3.1.2
maven-compiler-plugin 3.11.0
Reporter: Sebastian Stenzel


When running a test class that makes use of JEP 443, surefire reports an Error, 
despite being run with {{{}--enable-preview{}}}.
{quote}[ERROR] Illegal field name "" in class com.example.Demo
{quote}
*Example:*
{code:java}
class Demo {
@Test
public void test() {
        Function foo = _ -> 1;
        // ...
}
}{code}
It is worth noting, that {{compiler:3.11.0:testCompile}} completes just fine.

The {{maven-compiler-plugin}} requires 
{{--enable-preview}} and {{maven-surefire-plugin}} 
require {{{}-enable-preview{}}}.

 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MSHADE-265) correct merging of module-info in shades

2022-12-16 Thread Sebastian Stenzel (Jira)


[ 
https://issues.apache.org/jira/browse/MSHADE-265?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17648685#comment-17648685
 ] 

Sebastian Stenzel commented on MSHADE-265:
--

Not sure if this is even on the roadmap, but for the record, I want to add 
something that needs to be taken care of by when applying package relocations:

The jar tool adds the optional {{ModulePackages}} attribute to the 
{{{}module-info.class{}}}. If it is present, it is required to contain an 
exhaustive list of the jar's packages, because the class loader uses this as 
the single source of truth and ignores any unlisted packages.

I.e. when relocating packages, this attribute needs to be updated _or_ deleted 
(so the class loader falls back to scanning the whole jar). Otherwise a shaded 
jar will cause {{NoClassDefFoundErrors}} at runtime.

See Alan Bateman's comment on [this StackOverflow 
post|https://stackoverflow.com/q/51532510/4014509]:
{quote}Tools or plugins doing this must update the value of the ModulePackages 
attribute.
{quote}

> correct merging of module-info in shades
> 
>
> Key: MSHADE-265
> URL: https://issues.apache.org/jira/browse/MSHADE-265
> Project: Maven Shade Plugin
>  Issue Type: Improvement
>Reporter: Romain Manni-Bucau
>Priority: Trivial
>
> Should work by merging of the encountered module info jut also automatic 
> module name in manifest. The hard part being removing the not needed entries 
> which are sometimes not simply the ones of the included classes - SPI need it 
> still



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (MJLINK-64) Add-options double quoting

2022-10-21 Thread Sebastian Stenzel (Jira)


[ 
https://issues.apache.org/jira/browse/MJLINK-64?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17622320#comment-17622320
 ] 

Sebastian Stenzel commented on MJLINK-64:
-

Not sure if this is related, but the very example that is given for in the docs 
does not work:
 
{code:xml}

-Xmx256m
--enable-preview
-Dvar=value

{code}

results in:


{noformat}
bin/java -version
Invalid maximum heap size: -Xmx256m --enable-preview -Dvar=value
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
{noformat}


> Add-options double quoting
> --
>
> Key: MJLINK-64
> URL: https://issues.apache.org/jira/browse/MJLINK-64
> Project: Maven JLink Plugin
>  Issue Type: Bug
>Affects Versions: 3.1.0
>Reporter: Tigran Sargsyan
>Priority: Major
>
> In case of add multiple options via **, they are combined to one 
> in runtime. For example :
>  
> {code:java}
> 
>     -Darg1=value1
>     -Darg2=value2
>  
> {code}
>  
>  
> In runtime for the following code:
>  
> {code:java}
> System.out.println(System.getProperty("arg1"));
>  System.out.println(System.getProperty("arg2"));
>  
> {code}
> Output is:
>  
> {code:java}
> value1 -Darg2=value2
> null
> {code}
>  
>  
> After I examined the source code, I noticed that in fact, in the final 
> command, it turns out something like '*"-Darg1 = value1 -Darg2 = value2"'* 
> instead of *"-Darg1 = value1 -Darg2 = value2"*.
> I.e +double quoting.+
> _*My seggesion:*_
> Remove reduntant quoting in file *JlinkMojo(line:657).*
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)