Avoiding deprecated calls to Run.getEnvironment(); need to pass in a TaskListener.