public File locatePom ( final File folder ) { if ( folder != null && folder . exists ( ) && folder . isDirectory ( ) ) { String moduleVersion = folder . getParentFile ( ) . getName ( ) ; File [ ] list = folder . listFiles ( ) ; File [ ] four = new File [ CeylonUtil . NUM_CEYLON_JAVA_DEP_TYPES ] ; for ( File file : list ) { if ( file . isFile ( ) ) { if ( "module.xml" . equals ( file . getName ( ) ) ) { four [ 0 ] = file ; } else if ( file . getName ( ) . endsWith ( "-" + moduleVersion + ".module" ) ) { four [ 1 ] = file ; } else if ( "module.properties" . equals ( file . getName ( ) ) ) { four [ 2 ] = file ; } else if ( file . getName ( ) . endsWith ( "-" + moduleVersion + ".car" ) ) { four [ 3 ] = file ; } } } for ( File file : four ) { if ( file != null ) { return file ; } } } return new File ( folder , "pom.xml" ) ; }
Implementing Maven API to locate the project model .