If you're using ant to build, take a look at files in the root of your plugins-sdk. You can override the settings in build.properties
(don't change that file) in one of build.${username}.properties
or build.${hostname}.properties
Determine what user hudson runs as and configure the file appropriately. Or just use the hostname and configure that one. Also, if you ever ran the build as a different user, make sure that hudson has write access to the files/directories that potentially are owned by another user