I am writing a small task in buildSrc that will apply to Java project as well as to webapp projects. If the project is a webapp project, it should do the same things as for Java, plus a few things more. I want to keep it dumb and simple for now, there will be pretty much no configuration available; nonetheless, I would like to be able to discover automatically if a projects is a webapp project. How can this be achieved? I could for example check if the project has a task of type war or similar, but it is a kind of a hack. Is there a canonical way?