Solution 1:

Dictionary.reference.com doesn't list yearslong, but it does list yearlong. I think the more proper spelling would be years-long (and, to be honest, year-long as well).

Solution 2:

After a yearslong consideration, The NYT appears to have changed its mind. From the story on the CIA intelligence agent being found guilty (1/27/2015), the following appears:

Prosecutors prevailed after a yearslong fight in which the reporter, James Risen, refused to identify his sources.