@@ -784,7 +784,6 @@ def test_multiple_vfs_incompat_libs_error(self):
784784 assert return_code != 0
785785
786786
787-
788787 def test_multiple_namespaced_vfs (self ):
789788 if not util .native_image_all ():
790789 self .skipTest ("native-image tests disabled" )
@@ -843,6 +842,24 @@ def test_multiple_namespaced_vfs(self):
843842 assert return_code == 0 , log
844843
845844
845+ def test_packages_trimming (self ):
846+ with util .TemporaryTestDirectory () as tmpdir :
847+ target_name = "packages_trimming_test"
848+ target_dir = os .path .join (str (tmpdir ), target_name )
849+ self .generate_app (tmpdir , target_dir , target_name )
850+
851+ pom = os .path .join (target_dir , "pom.xml" )
852+ # Add empty and whitespace entries around the valid package
853+ util .replace_in_file (pom , "</packages>" , "<package></package><package> </package></packages>" )
854+
855+ mvnw_cmd = util .get_mvn_wrapper (target_dir , self .env )
856+ out , return_code = util .run_cmd (mvnw_cmd + ["process-resources" ], self .env , cwd = target_dir )
857+ util .check_ouput ("BUILD SUCCESS" , out )
858+ # Sanity: ensure install was attempted from inline packages
859+ util .check_ouput ("pip install" , out )
860+ assert return_code == 0
861+
862+
846863if __name__ == "__main__" :
847864 run_path = os .path .join (os .path .abspath (__file__ ), 'run.py' )
848865 print (f"Run this file using the run.py driver ({ run_path } )" )
0 commit comments