Hi all,

today it was brought to my attention again, that people are having a hard time 
working on PLC4X in VSCode.
The main problem is, that in contrast to Maven itself or IntelliJ, VSCode (and 
I think Eclipse) don’t really support picking up of auto-generated directories.
The build-helper-maven-plugin usually helps with this, but you can’t blindly 
add it to every module as it fails, if the directory doesn’t exist.
Instead of manually adding it to every module, that uses code-generation, I 
added a self-activating maven profile.
In general, what is does, is check if there’s a directory 
“target/generated-srouces/plc4x” and only if this exists, will the profile be 
activated and add that directory.

(Please don’t be so smart and replace “target” with 
“${project.build.directory}” profile activation happens in maven before the 
properties are resolved, so you can’t use properties for this)

Even if useful, I consider this approach sort of the black-magic of Maven … not 
100% sure about the side-effects (We are sort of adding the sources twice for 
maven itself and IntelliJ)

So would be cool if you folks could test if this change is causing any trouble 
for you and if it helps solving the VSCode problem.

Chris

Reply via email to