File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
boms/test-utils/src/main/java/io/a2a/bom/test Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,21 @@ protected DynamicBomVerifier(Set<String> excludedPaths) {
3535 }
3636
3737 public void verify () throws Exception {
38- Path projectRoot = Paths .get ("" ).toAbsolutePath ().getParent ().getParent ().getParent ().getParent ().getParent ();
38+ Path projectRoot = null ;
39+ Path current = Paths .get ("" ).toAbsolutePath ();
40+ while (current != null ) {
41+ if (Files .isDirectory (current )) {
42+ if (Files .exists (current .resolve ("pom.xml" )) && Files .exists (current .resolve ("boms" ))) {
43+ projectRoot = current ;
44+ break ;
45+ }
46+ }
47+ current = current .getParent ();
48+ }
49+ if (projectRoot == null ) {
50+ throw new IllegalStateException ("Could not find project root directory." );
51+ }
52+ //Path projectRoot = Paths.get("").toAbsolutePath().getParent().getParent().getParent().getParent().getParent();
3953 System .out .println ("Scanning project root: " + projectRoot );
4054
4155 Set <String > requiredClasses = discoverRequiredClasses (projectRoot );
You can’t perform that action at this time.
0 commit comments