Github user bjhargrave commented on a diff in the pull request:

    https://github.com/apache/incubator-quarks/pull/131#discussion_r66337307
  
    --- Diff: 
console/server/src/main/java/quarks/console/server/ServerUtil.java ---
    @@ -45,31 +53,35 @@ private String getPath() {
          * @return a File object
          */
         private File getTopDirFilePath() {
    +        String topDirProp = System.getProperty("top.dir.file.path");
    +        if (topDirProp != null) {
    +          return new File(topDirProp);
    +        }
             File jarFile = new File(getPath());
             return jarFile.getParentFile().getParentFile().getParentFile();
         }
     
    -    // create new filename filter
    -    FilenameFilter fileNameFilter = new FilenameFilter() {
    -
    -        @Override
    -        public boolean accept(File dir, String name) {
    -            if (name.equals("webapps")) {
    -                return true;
    -            }
    -            else {
    -                return false;
    -            }
    -        }
    -    };
         /**
          * Returns the File object representing the "webapps" directory
          * @return a File object or null if the "webapps" directory is not 
found
          */
         private File getWarFilePath() {
    -        File[] foundFiles = getTopDirFilePath().listFiles(fileNameFilter);
    -        if (foundFiles.length == 1) {
    -            return foundFiles[0];
    +        List<File> foundFiles = new ArrayList<>();
    --- End diff --
    
    It had to change because this code is badly dependent upon the structure of 
the build. It assumed that the jars all sit in target/java... getTopDirFilePath 
assume ../../.. from the jar to find the webapp. Since the gradle build uses 
normal gradle output locations, the webapp folder is elsewhere. 
c52ecf7ca8ec1f31ed99c4e944f02185f56833c4 is the commit to be more flexible in 
locating the webapps folder in the build.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to