Summary: Building from the application cloned source tree works fine but the Homebrew temporary location produces an invalid artifact.
Details:
There are some bugfixes I want to make to the Nexus forumla (as well as update it). To that end I am attempting to update the Formula file over here.
However, when I build the actual application the resultant Jar file does not run. It seems to be missing components and the app fails to start with classpath related errors.
Currently it fails due to, for some reason, looking for a file that doesn't matter when I try to cp_r Dir["#{assembly}/*"], libexec. Homebrew does some weird things with source distributions (whether tarball or Git) whereby it copies it to a temp directory file by file. It might be missing something:
/private/tmp/nexus-20250716-23927-9l0qag
Error: An exception occurred within a child process:
Errno::ENOENT: No such file or directory @ rb_sysopen - /opt/homebrew/Cellar/nexus/3.81.0-08/libexec/NOTICE.txt
Warning: Removed Sorbet lines from backtrace!
Rerun with `--verbose` to see the original backtrace
/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.4.4/lib/ruby/3.4.0/fileutils.rb:2281:in 'File#initialize'
/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.4.4/lib/ruby/3.4.0/fileutils.rb:2281:in 'IO.open'
/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.4.4/lib/ruby/3.4.0/fileutils.rb:2281:in 'block in FileUtils::Entry_#copy_file'
/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.4.4/lib/ruby/3.4.0/fileutils.rb:2280:in 'IO.open'
/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.4.4/lib/ruby/3.4.0/fileutils.rb:2280:in 'FileUtils::Entry_#copy_file'
/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.4.4/lib/ruby/3.4.0/fileutils.rb:2245:in 'FileUtils::Entry_#copy'
/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.4.4/lib/ruby/3.4.0/fileutils.rb:1049:in 'block in FileUtils#copy_entry'
/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.4.4/lib/ruby/3.4.0/fileutils.rb:2387:in 'FileUtils::Entry_#wrap_traverse'
/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.4.4/lib/ruby/3.4.0/fileutils.rb:1046:in 'FileUtils#copy_entry'
/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.4.4/lib/ruby/3.4.0/fileutils.rb:991:in 'block in FileUtils#cp_r'
/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.4.4/lib/ruby/3.4.0/fileutils.rb:2471:in 'block in FileUtils#fu_each_src_dest'
/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.4.4/lib/ruby/3.4.0/fileutils.rb:2480:in 'block in FileUtils#fu_each_src_dest0'
/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.4.4/lib/ruby/3.4.0/fileutils.rb:2478:in 'Array#each'
/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.4.4/lib/ruby/3.4.0/fileutils.rb:2478:in 'FileUtils#fu_each_src_dest0'
/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.4.4/lib/ruby/3.4.0/fileutils.rb:2469:in 'FileUtils#fu_each_src_dest'
/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.4.4/lib/ruby/3.4.0/fileutils.rb:990:in 'FileUtils#cp_r'
/opt/homebrew/Library/Taps/homebrew/homebrew-core/Formula/n/nexus.rb:62:in 'Formulary::FormulaNamespace643843eaf4139b585f126b920580793cc8e0fdb2add997e636a5e05b809454e3::Nexus#install'
/opt/homebrew/Library/Homebrew/debrew.rb:11:in 'block in Debrew::Formula#install'
/opt/homebrew/Library/Homebrew/debrew.rb:83:in 'Debrew.debrew'
/opt/homebrew/Library/Homebrew/debrew.rb:11:in 'Debrew::Formula#install'
/opt/homebrew/Library/Homebrew/build.rb:182:in 'block (3 levels) in Build#install'
/opt/homebrew/Library/Homebrew/extend/kernel.rb:565:in 'Kernel#with_env'
/opt/homebrew/Library/Homebrew/build.rb:139:in 'block (2 levels) in Build#install'
/opt/homebrew/Library/Homebrew/formula.rb:1558:in 'block in Formula#brew'
/opt/homebrew/Library/Homebrew/formula.rb:3309:in 'block (2 levels) in Formula#stage'
/opt/homebrew/Library/Homebrew/extend/kernel.rb:565:in 'Kernel#with_env'
/opt/homebrew/Library/Homebrew/formula.rb:3308:in 'block in Formula#stage'
/opt/homebrew/Library/Homebrew/resource.rb:118:in 'block (2 levels) in Resource#unpack'
/opt/homebrew/Library/Homebrew/download_strategy.rb:136:in 'Dir.chdir'
/opt/homebrew/Library/Homebrew/download_strategy.rb:136:in 'AbstractDownloadStrategy#chdir'
/opt/homebrew/Library/Homebrew/download_strategy.rb:122:in 'AbstractDownloadStrategy#stage'
/opt/homebrew/Library/Homebrew/resource.rb:114:in 'block in Resource#unpack'
/opt/homebrew/Library/Homebrew/mktemp.rb:88:in 'block in Mktemp#run'
/opt/homebrew/Library/Homebrew/mktemp.rb:88:in 'Dir.chdir'
/opt/homebrew/Library/Homebrew/mktemp.rb:88:in 'Mktemp#run'
/opt/homebrew/Library/Homebrew/resource.rb:241:in 'Resource#stage_resource'
/opt/homebrew/Library/Homebrew/resource.rb:113:in 'Resource#unpack'
/opt/homebrew/Library/Homebrew/resource.rb:87:in 'Resource#stage'
/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.4.4/lib/ruby/3.4.0/forwardable.rb:240:in 'SoftwareSpec#stage'
/opt/homebrew/Library/Homebrew/formula.rb:3286:in 'Formula#stage'
/opt/homebrew/Library/Homebrew/formula.rb:1551:in 'Formula#brew'
/opt/homebrew/Library/Homebrew/build.rb:133:in 'block in Build#install'
/opt/homebrew/Library/Homebrew/extend/kernel.rb:565:in 'Kernel#with_env'
/opt/homebrew/Library/Homebrew/build.rb:125:in 'Build#install'
/opt/homebrew/Library/Homebrew/build.rb:242:in '<main>'