I need to get all the MavenModuleSet objects in Jenkins and my code is:
List<MavenModuleSet> list = Jenkins.getInstance().getAllItems(MavenModuleSet.class);
When I run it (in a Jenkins plugin) on my local machine the list contains all the items, on the server the list is empty.
Any idea why?
after a few tests I can confirm the problem was related to the permissions for the user “anonymous”.
The plugin is ran by the anonymous user and I modified the Jenkins “Matrix-based security” to give the user CRUD authorization for Jobs.