Fix NPEs by checking whether JDTModule.artifact is null
Also retrieve the JS artifacts to the repo when JS compilation is on