skybird commented on Bug JENKINS-14248

I tried your code, the result is a list of

  • all freestyle project names
  • all modules + submodules from the maven2/3 projects (all which you could see at /job/myjobname/modules), but it shows the name from the "<name>" tag from the pom.xml

I also tried:

 
import hudson.plugins.disk_usage.*;
List<AbstractProject> projectList = DiskUsagePlugin.addAllProjects(Hudson.getInstance(), new ArrayList<AbstractProject>());
projectList.each{ if(it instanceof AbstractProject) println it.displayName}
return

which delivers a list of all freestyle and maven job names (without maven submodules, and the job names itself, not the names from the pom.xml).

I also tried (the old code from 1.16)

 
        List items = Hudson.getInstance().getItems();

        //Include nested projects as well
        //TODO fix MatrixProject and use getAllJobs()
        for (TopLevelItem item : Hudson.getInstance().getItems()) {
            if(item instanceof ItemGroup) {
                items.addAll(((ItemGroup)item).getItems());
            }
        }

items.each{ if(it instanceof AbstractProject) println it.displayName}
return

which delivers both: all freestyle job names, all maven2/3 job names and all main+submodule "<name>"-pom.xml names

Enviroment: Jenkins 1.471, Windows.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to