public Workspace getWorkspace(MavenSession session) throws MojoFailureException {
File executionRoot = new File(session.getExecutionRootDirectory());
Workspace workspace = workspaces.get(session);
if (workspace != null)
return workspace;
try {
File currentFolder = new File("cnf").getCanonicalFile();
if (currentFolder.exists() && currentFolder.isDirectory())
workspace = new Workspace(currentFolder.getParentFile());
else {
File sessionRoot = new File(executionRoot, "/cnf").getCanonicalFile();
if (sessionRoot.exists() && sessionRoot.isDirectory())
workspace = new Workspace(sessionRoot.getParentFile());
else {
File upFolder = new File("../cnf").getCanonicalFile();
if (upFolder.exists() && upFolder.isDirectory())
workspace = new Workspace(upFolder.getParentFile());
}
}
} catch (IOException e) {
throw new MojoFailureException("Failed to access workspace folder", e);
} catch (Exception e) {