<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=NL link="#0563C1" vlink="#954F72" style='word-wrap:break-word'><div class=WordSection1><p class=MsoNormal>Consider the following code:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p style='mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:0cm;margin-left:35.4pt;background:white'><b><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:#7F0055'>import</span></b><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:black'> org.slf4j.Logger;<o:p></o:p></span></p><p style='mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:0cm;margin-left:35.4pt;background:white'><b><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:#7F0055'>import</span></b><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:black'> org.slf4j.LoggerFactory;<o:p></o:p></span></p><p style='mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:0cm;margin-left:35.4pt;background:white'><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:black'><o:p> </o:p></span></p><p style='mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:0cm;margin-left:35.4pt;background:white'><b><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:#7F0055'>public</span></b><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:black'> </span><b><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:#7F0055'>class</span></b><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:black'> Application {<o:p></o:p></span></p><p style='mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:0cm;margin-left:35.4pt;background:white'><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:black'><o:p> </o:p></span></p><p style='mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:0cm;margin-left:35.4pt;background:white'><b><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:#7F0055'>    private</span></b><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:black'> </span><b><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:#7F0055'>static</span></b><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:black'> </span><b><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:#7F0055'>final</span></b><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:black'> Logger </span><b><i><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:#0000C0'>logger</span></i></b><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:black'> = LoggerFactory.<i>getLogger</i>(Application.</span><b><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:#7F0055'>class</span></b><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:black'>);<o:p></o:p></span></p><p style='mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:0cm;margin-left:35.4pt;background:white'><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:black'>       <o:p></o:p></span></p><p style='mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:0cm;margin-left:35.4pt;background:white'><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:black'>    </span><b><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:#7F0055'>public</span></b><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:black'> </span><b><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:#7F0055'>static</span></b><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:black'> </span><b><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:#7F0055'>void</span></b><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:black'> main(String[] </span><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:#6A3E3E'>args</span><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:black'>) </span><b><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:#7F0055'>throws</span></b><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:black'> Exception {<o:p></o:p></span></p><p style='mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:0cm;margin-left:35.4pt;background:white'><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:black'>       </span><b><i><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:#0000C0'>logger</span></i></b><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:black'>.info(</span><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:#2A00FF'>"{}"</span><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:black'>, Application.</span><b><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:#7F0055'>class</span></b><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:black'>.getClassLoader().getResource(</span><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:#2A00FF'>"META-INF/micronaut/io.micronaut.inject.BeanDefinitionReference"</span><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:black'>) != </span><b><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:#7F0055'>null</span></b><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:black'> ); // directory<o:p></o:p></span></p><p style='mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:0cm;margin-left:35.4pt;background:white'><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:black'>       </span><b><i><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:#0000C0'>logger</span></i></b><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:black'>.info(</span><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:#2A00FF'>"{}"</span><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:black'>, Application.</span><b><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:#7F0055'>class</span></b><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:black'>.getClassLoader().getResource(</span><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:#2A00FF'>"META-INF/micronaut/io.micronaut.inject.BeanDefinitionReference/io.micronaut.context.event.ApplicationEventPublisherFactory"</span><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:black'>) != </span><b><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:#7F0055'>null</span></b><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:black'> );  // empty file<o:p></o:p></span></p><p style='mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:0cm;margin-left:35.4pt;background:white'><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:black'>       </span><b><i><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:#0000C0'>logger</span></i></b><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:black'>.info(</span><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:#2A00FF'>"{}"</span><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:black'>, ClassLoader.<i>getSystemResource</i>(</span><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:#2A00FF'>"META-INF/micronaut/io.micronaut.inject.BeanDefinitionReference"</span><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:black'>) != </span><b><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:#7F0055'>null</span></b><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:black'> ); // directory<o:p></o:p></span></p><p style='mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:0cm;margin-left:35.4pt;background:white'><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:black'>       </span><b><i><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:#0000C0'>logger</span></i></b><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:black'>.info(</span><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:#2A00FF'>"{}"</span><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:black'>, ClassLoader.<i>getSystemResource</i>(</span><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:#2A00FF'>"META-INF/micronaut/io.micronaut.inject.BeanDefinitionReference/io.micronaut.context.event.ApplicationEventPublisherFactory"</span><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:black'>) != </span><b><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:#7F0055'>null</span></b><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:black'> ); // empty file<o:p></o:p></span></p><p style='mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:0cm;margin-left:35.4pt;background:white'><span lang=EN-US style='font-size:8.0pt;font-family:"Courier New";color:black'>    </span><span style='font-size:8.0pt;font-family:"Courier New";color:black'>}<o:p></o:p></span></p><p style='mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:0cm;margin-left:35.4pt;background:white'><span style='font-size:8.0pt;font-family:"Courier New";color:black'>}<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span lang=EN-US>When running this using the classpath or modulepath I’ll get true for every line.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>However, when creating the application with jlink, only regular resources return true(i.e. the second and fourth log statement), the “directories” return false.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Is this difference intended behavior?<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Regards,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Robert<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p></div></body></html>