I am certain that my generated JavaScript/CSS files should not be written to the src directories. Generated content belongs only in the target directory - even if that generated code is included in the distribution artifact (war/jar file).
My confusion was due to two issues.
"mvn spring-boot:run" behaviour
My application builds a war file as I have a current requirement to install it on a remote Tomcat server. The behaviour of "mvn spring-boot:run" is different for jar and war packaging. From what I have read, if you have a war package "mvn spring-boot:run" will attempt to serve web content from the src/main/webapp directory. My generated content does not belong in the src directory - so somehow I need to get it served from the target directory.
Confusion about how Spring Boot serves up static content
I read that Spring Boot automatically serves up content from several classpath locations; /META-INF/resources/,/resources/,/static/,/public/.
Even when I updated my generated JavaScript plugin output path to target a classpath location I initially couldn't locate it.
I ascertained that WebMvcAutoConfiguration contains the code responsible for adding the static content paths and that WebMvcAutoConfiguration is triggered if your configuration extends WebMvcConfigurerAdapter.
However, I've seen comments to suggest that if you use @EnableWebMvc then this effectively disables theses default static content locations (I would value a authoritative reference for this - I found this now see Update below).
I used @EnableWebMvc so to get around this problem I extended WebMvcConfigurerAdapter to explicitly define the static locations to include the classpath folder where I have output my generated content.
I dare say that as I now extend WebMvcConfigurerAdapter that I probably don't need to use @EnableWebMvc anymore but I'm not yet 100% certain about this.
Now I have explicitly configured the generated content to be located (by overriding addResourceHandlers method of WebMvcConfigurerAdapter) I am now able to locate this content when using "mvn spring-boot:run".
Problem solved - if not completely understood!
Update
I found the section of the Spring Boot documentation that relates to why you disable the default static content locations when you use @EnableWebMvc, it says:
The easiest way to take complete control over MVC configuration is to
provide your own @Configuration with the @EnableWebMvc annotation.
This will leave all MVC configuration in your hands.
It is from the section entitled "Switch off the Default MVC configuration".