In the context of "year long / all year long" it would be an adverb. Ex. I worked on the project all year long. (It modifies the verb.) The context you wish to use it in is "yearlong / year-long," which is an adjective. Ex. My senior thesis was an intensive, year-long project. (Here, it modifies the noun -project.) More @Wikipedia
Hover over any link to get a description of the article. Please note that search keywords are sometimes hidden within the full article and don't appear in the description or title.