X-Mas Musings #15 – Too Many Paths. One Path Spec?

December is for many people a period of reflection or thought. So I decided to reflect upon last year’s things and thoughts — each day until Christmas. This is day 15.


Within a typical (Java) project there a lots of places where some kind of “path” needs to be specified.


For starters, in any build configuration quite a few paths to directories or files need to be described.

sonarqube {
  properties {
    property 'sonar.sources', 'src'
    property 'sonar.exclusions', '**/*.spec.js'
    property 'sonar.tests', 'src'
    property 'sonar.test.inclusions', '**/*.spec.js'

task test(type: YarnTask, dependsOn: 'yarn') {
  description = 'Run the client tests'

  args = ['run', 'unit']

war {
  dependsOn asciidoctor
  from ("${asciidoctor.outputDir}/html5") {
    into 'static/docs'

UrlMappings Grails

Mappings of urls to the appropriate controller and action on the server-side.

"/"(controller: "dashboard")
"500"(view: "/error")
  controller: "person", 
  action: "details")

Spring Security

Securing urls with permissions.


Vue routing

Mappings of paths. Same project, but for the JavaScript client.

routes: [
  { path: '/', redirect: '/dashboard' },
  { path: '/staff/person/:id?', component: Person },
  { path: '*', redirect: '/notfound' }

Spring REST Docs

Describing the path of JSON fields to generate documentation for API requests and responses.

  .filter(document("user", responseFields(
    fieldWithPath("name").description("The user's name"),
    fieldWithPath("email.primary").description("The primary email address"),
    fieldWithPath("roles[]").description("List of roles"),
    fieldWithPath("subscription[].type.*.name").description("Any subscription type"))))

And more…

That’s just in one project!

I sometimes even forget what the right syntax is 🙂 Some docs clearly state they’re using Ant-style path patterns (**/*.?) or just use a home-grown system ([].*).

I think it’s time for a standardized “Path specification” — where all paths can be described in a uniform way and are treated equally! 🙂

Does your own project contains other surprising, path examples? I’d love to hear about them in the comments section.