Two years ago, Massachusetts’ New Bedford Marine Commerce Terminal — renovated with more than $100m of public funding so the state could capture offshore wind jobs — looked in serious danger of becoming an expensive white elephant.

Cape Wind’s developer had just cancelled its multi-year lease to use the terminal as a staging ground, having lost its power off-take deals for its pioneering offshore project.