title: maven-compiler-plugin error: Error post-processing workitem annotations: Attempt to reopen a file for path
body: <p>I have a JBPM project with a maven build that has been building for months. I added a few files and a few dependencies (notated with &lt;! -- added --&gt; below) today and started getting the error:</p>
  <pre><code>[ERROR] Error post-processing workitem annotations: Attempt to reopen a file for path C:\Users\me\git\my-workitemhandlers\target\generated-sources\annotations\MyQuery.wid.
  </code></pre>
  <p>Earlier today I added &lt; scope&gt;provided&lt;/ scope&gt; to several dependencies and the error went away but it is now back. It is not feasible to change my version of Java above 1.8 so I downgraded the Hibernate dependency (as shown) and still get the error.</p>
  <p>How might I solve this issue?  Building without making the .wid file would be better than not being able to build (so that is an option).  Below is my pom.xml.</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot;?&gt;
  &lt;project xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd&quot; xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;groupId&gt;com.mycompany&lt;/groupId&gt;
    &lt;artifactId&gt;my-workitemhandlers&lt;/artifactId&gt;
    &lt;version&gt;2.0.6&lt;/version&gt;
    &lt;name&gt;my-workitemhandlers&lt;/name&gt;
    &lt;properties&gt;
      &lt;version.org.kie&gt;7.48.0.Final-redhat-00004&lt;/version.org.kie&gt;
      &lt;version.org.powermock&gt;1.7.4&lt;/version.org.powermock&gt;
      &lt;version.junit&gt;4.12&lt;/version.junit&gt;
      &lt;version.org.slf4j&gt;1.7.26&lt;/version.org.slf4j&gt;
      &lt;java.module.name&gt;${project.name}&lt;/java.module.name&gt;
    &lt;/properties&gt;
  &lt;dependencyManagement&gt;
      &lt;dependencies&gt;    
        &lt;dependency&gt;
          &lt;groupId&gt;junit&lt;/groupId&gt;
          &lt;artifactId&gt;junit&lt;/artifactId&gt;
          &lt;scope&gt;test&lt;/scope&gt;
          &lt;version&gt;${version.junit}&lt;/version&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
          &lt;groupId&gt;org.powermock&lt;/groupId&gt;
          &lt;artifactId&gt;powermock-api-mockito&lt;/artifactId&gt;
          &lt;scope&gt;test&lt;/scope&gt;
          &lt;version&gt;${version.org.powermock}&lt;/version&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
          &lt;groupId&gt;org.powermock&lt;/groupId&gt;
          &lt;artifactId&gt;powermock-module-junit4&lt;/artifactId&gt;
          &lt;scope&gt;test&lt;/scope&gt;
          &lt;version&gt;${version.org.powermock}&lt;/version&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
          &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
          &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
          &lt;version&gt;${version.org.slf4j}&lt;/version&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
          &lt;groupId&gt;org.kie&lt;/groupId&gt;
          &lt;artifactId&gt;kie-user-bom-parent&lt;/artifactId&gt;
          &lt;version&gt;${version.org.kie}&lt;/version&gt;
          &lt;type&gt;pom&lt;/type&gt;
          &lt;scope&gt;import&lt;/scope&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
          &lt;groupId&gt;org.jbpm&lt;/groupId&gt;
          &lt;artifactId&gt;jbpm-bom&lt;/artifactId&gt;
          &lt;version&gt;${version.org.kie}&lt;/version&gt;
          &lt;type&gt;pom&lt;/type&gt;
          &lt;scope&gt;import&lt;/scope&gt;
        &lt;/dependency&gt;
      &lt;/dependencies&gt;
    &lt;/dependencyManagement&gt;
  
    &lt;dependencies&gt;
      &lt;!--dependency&gt;
        &lt;groupId&gt;org.kie.server&lt;/groupId&gt;
        &lt;artifactId&gt;kie-server-client&lt;/artifactId&gt;
         &lt;exclusions&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;org-kie&lt;/groupId&gt;
                  &lt;artifactId&gt;kie-dmn-api&lt;/artifactId&gt;
              &lt;/exclusion&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;org-optaplanner&lt;/groupId&gt;
                  &lt;artifactId&gt;optaplanner-core&lt;/artifactId&gt;
              &lt;/exclusion&gt;       
              &lt;exclusion&gt;
                  &lt;groupId&gt;org-optaplanner&lt;/groupId&gt;
                  &lt;artifactId&gt;optaplanner-core&lt;/artifactId&gt;
              &lt;/exclusion&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;org-drools&lt;/groupId&gt;
                  &lt;artifactId&gt;drools-core&lt;/artifactId&gt;
              &lt;/exclusion&gt;
         &lt;/exclusions&gt;
      &lt;/dependency--&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.kie&lt;/groupId&gt;
        &lt;artifactId&gt;kie-api&lt;/artifactId&gt;
        &lt;scope&gt;provided&lt;/scope&gt; 
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.jbpm&lt;/groupId&gt;
        &lt;artifactId&gt;jbpm-workitems-core&lt;/artifactId&gt;
        &lt;scope&gt;provided&lt;/scope&gt; 
      &lt;/dependency&gt;
       &lt;dependency&gt;
        &lt;groupId&gt;org.kie&lt;/groupId&gt;
        &lt;artifactId&gt;kie-internal&lt;/artifactId&gt;
        &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;    &lt;!-- added --&gt;
          &lt;groupId&gt;org.jbpm&lt;/groupId&gt;
          &lt;artifactId&gt;jbpm-services-api&lt;/artifactId&gt;
        &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.jbpm&lt;/groupId&gt;
        &lt;artifactId&gt;jbpm-workitems-core&lt;/artifactId&gt;
        &lt;type&gt;test-jar&lt;/type&gt;
        &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;junit&lt;/groupId&gt;
        &lt;artifactId&gt;junit&lt;/artifactId&gt;
        &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.powermock&lt;/groupId&gt;
        &lt;artifactId&gt;powermock-api-mockito&lt;/artifactId&gt;
        &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.powermock&lt;/groupId&gt;
        &lt;artifactId&gt;powermock-module-junit4&lt;/artifactId&gt;
        &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.jbpm&lt;/groupId&gt;
        &lt;artifactId&gt;jbpm-test&lt;/artifactId&gt;
        &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.jbpm&lt;/groupId&gt;
        &lt;artifactId&gt;jbpm-test-util&lt;/artifactId&gt;
        &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
        &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
        &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.jbpm.contrib&lt;/groupId&gt;
        &lt;artifactId&gt;template-resources&lt;/artifactId&gt;
        &lt;scope&gt;provided&lt;/scope&gt;
        &lt;version&gt;${version.org.kie}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;com.fasterxml.jackson.datatype&lt;/groupId&gt;
        &lt;artifactId&gt;jackson-datatype-jsr310&lt;/artifactId&gt;
        &lt;version&gt;2.12.3&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;   &lt;!--  added  --&gt;
          &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
          &lt;artifactId&gt;hibernate-envers&lt;/artifactId&gt;
          &lt;version&gt;5.1.0.Final&lt;/version&gt;      
          &lt;!--version&gt;5.3.20.SP2-redhat-00001&lt;/version--&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;    
    &lt;/dependencies&gt;
    &lt;build&gt;
      &lt;sourceDirectory&gt;${project.build.directory}/generated-sources/java&lt;/sourceDirectory&gt;
      &lt;resources&gt;
        &lt;resource&gt;
          &lt;directory&gt;src/main/resources&lt;/directory&gt;
          &lt;filtering&gt;false&lt;/filtering&gt;
          &lt;includes&gt;
            &lt;include&gt;*.*&lt;/include&gt;
          &lt;/includes&gt;
        &lt;/resource&gt;
        &lt;resource&gt;
          &lt;directory&gt;${project.build.directory}/maven-shared-archive-resources&lt;/directory&gt;
          &lt;filtering&gt;true&lt;/filtering&gt;
          &lt;includes&gt;
            &lt;include&gt;*.part&lt;/include&gt;
          &lt;/includes&gt;
        &lt;/resource&gt;
      &lt;/resources&gt;
      &lt;plugins&gt;
        &lt;plugin&gt;
          &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
          &lt;artifactId&gt;templating-maven-plugin&lt;/artifactId&gt;
          &lt;version&gt;1.0.0&lt;/version&gt;
          &lt;executions&gt;
            &lt;execution&gt;
              &lt;id&gt;filter-src&lt;/id&gt;
              &lt;goals&gt;
                &lt;goal&gt;filter-sources&lt;/goal&gt;
              &lt;/goals&gt;
              &lt;configuration&gt;
                &lt;sourceDirectory&gt;${basedir}/src/main/java&lt;/sourceDirectory&gt;
                &lt;outputDirectory&gt;${project.build.directory}/generated-sources/java&lt;/outputDirectory&gt;
              &lt;/configuration&gt;
            &lt;/execution&gt;
          &lt;/executions&gt;
        &lt;/plugin&gt;
        &lt;plugin&gt;
          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
          &lt;artifactId&gt;maven-resources-plugin&lt;/artifactId&gt;
          &lt;version&gt;3.1.0&lt;/version&gt;
          &lt;executions&gt;
            &lt;execution&gt;
              &lt;id&gt;copy-repository-resources&lt;/id&gt;
              &lt;phase&gt;compile&lt;/phase&gt;
              &lt;goals&gt;
                &lt;goal&gt;copy-resources&lt;/goal&gt;
              &lt;/goals&gt;
              &lt;configuration&gt;
                &lt;encoding&gt;UTF-8&lt;/encoding&gt;
                &lt;resources&gt;
                  &lt;resource&gt;
                    &lt;directory&gt;target/generated-sources/annotations&lt;/directory&gt;
                    &lt;includes&gt;
                      &lt;include&gt;repoindex.html&lt;/include&gt;
                      &lt;include&gt;*.wid&lt;/include&gt;
                    &lt;/includes&gt;
                    &lt;filtering&gt;true&lt;/filtering&gt;
                  &lt;/resource&gt;
                &lt;/resources&gt;
                &lt;outputDirectory&gt;target/classes&lt;/outputDirectory&gt;
              &lt;/configuration&gt;
            &lt;/execution&gt;
          &lt;/executions&gt;
        &lt;/plugin&gt;
        &lt;plugin&gt;
          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
          &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
          &lt;version&gt;3.8.1&lt;/version&gt;
          &lt;configuration&gt;
            &lt;source&gt;1.8&lt;/source&gt;
            &lt;target&gt;1.8&lt;/target&gt;
            &lt;annotationProcessors&gt;
              &lt;annotationProcessor&gt;org.jbpm.process.workitem.core.util.WidProcessor&lt;/annotationProcessor&gt;
            &lt;/annotationProcessors&gt;
            &lt;compilerArgs&gt;
              &lt;arg&gt;-AwidName=${project.artifactId}&lt;/arg&gt;
              &lt;arg&gt;-AgenerateTemplates=true&lt;/arg&gt;
              &lt;arg&gt;-AgenerateWids=true&lt;/arg&gt;
              &lt;arg&gt;-AwidsResources=${project.artifactId}.wid:widtemplate.st&lt;/arg&gt;
              &lt;arg&gt;-AtemplateResources=kie-deployment-descriptor.xml:kie-ddtemplate.st,serviceinfo.json:serviceinfo.st,repoindex.html:repoindex.part,index.html:indextemplate.st,${project.artifactId}.bpmn2:defaultprocess.st&lt;/arg&gt;
            &lt;/compilerArgs&gt;
          &lt;/configuration&gt;
        &lt;/plugin&gt;
        &lt;plugin&gt;
          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
          &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;
          &lt;version&gt;3.3.0&lt;/version&gt;
          &lt;configuration&gt;
            &lt;!-- root module has no assembly so ignore it --&gt;
            &lt;ignoreMissingDescriptor&gt;true&lt;/ignoreMissingDescriptor&gt;
            &lt;descriptors&gt;
              &lt;descriptor&gt;${project.basedir}/assembly/assembly.xml&lt;/descriptor&gt;
            &lt;/descriptors&gt;
            &lt;archive&gt;
              &lt;addMavenDescriptor&gt;false&lt;/addMavenDescriptor&gt;
            &lt;/archive&gt;
          &lt;/configuration&gt;
          &lt;executions&gt;
            &lt;execution&gt;
              &lt;phase&gt;package&lt;/phase&gt;
              &lt;goals&gt;
                &lt;goal&gt;single&lt;/goal&gt;
              &lt;/goals&gt;
              &lt;configuration&gt;
                &lt;appendAssemblyId&gt;false&lt;/appendAssemblyId&gt;
              &lt;/configuration&gt;
            &lt;/execution&gt;
          &lt;/executions&gt;
        &lt;/plugin&gt;
        &lt;plugin&gt;
          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
          &lt;artifactId&gt;maven-failsafe-plugin&lt;/artifactId&gt;
          &lt;version&gt;2.22.2&lt;/version&gt;
          &lt;executions&gt;
            &lt;execution&gt;
              &lt;id&gt;integration-test-execution&lt;/id&gt;
              &lt;phase&gt;verify&lt;/phase&gt;
              &lt;goals&gt;
                &lt;goal&gt;integration-test&lt;/goal&gt;
                &lt;goal&gt;verify&lt;/goal&gt;
              &lt;/goals&gt;
            &lt;/execution&gt;
          &lt;/executions&gt;
          &lt;configuration&gt;
            &lt;systemPropertyVariables&gt;
              &lt;groupId&gt;${project.groupId}&lt;/groupId&gt;
              &lt;artifactId&gt;${project.artifactId}&lt;/artifactId&gt;
              &lt;version&gt;${project.version}&lt;/version&gt;
              &lt;builddir&gt;${project.build.directory}&lt;/builddir&gt;
            &lt;/systemPropertyVariables&gt;
            &lt;failIfNoTests&gt;false&lt;/failIfNoTests&gt;
            &lt;test&gt;${it.test}&lt;/test&gt;
            &lt;includes&gt;
              &lt;include&gt;**/*IntegrationTest.java&lt;/include&gt;
            &lt;/includes&gt;
            &lt;argLine&gt;${failsafe.arg.line}&lt;/argLine&gt;
          &lt;/configuration&gt;
        &lt;/plugin&gt;
        &lt;plugin&gt;
          &lt;groupId&gt;org.commonjava.maven.plugins&lt;/groupId&gt;
          &lt;artifactId&gt;project-sources-maven-plugin&lt;/artifactId&gt;
          &lt;version&gt;1.1&lt;/version&gt;
          &lt;executions&gt;
            &lt;execution&gt;
              &lt;id&gt;project-sources&lt;/id&gt;
              &lt;goals&gt;
                &lt;goal&gt;archive&lt;/goal&gt;
              &lt;/goals&gt;
            &lt;/execution&gt;
          &lt;/executions&gt;
        &lt;/plugin&gt;
        &lt;plugin&gt;
          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
          &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
          &lt;version&gt;2.22.2&lt;/version&gt;
          &lt;configuration&gt;
            &lt;includes&gt;
              &lt;include&gt;**/*Test.java&lt;/include&gt;
            &lt;/includes&gt;
            &lt;excludes&gt;
              &lt;exclude&gt;**/*IntegrationTest.java&lt;/exclude&gt;
            &lt;/excludes&gt;
            &lt;argLine&gt;-Xmx1024m -Dfile.encoding=UTF-8&lt;/argLine&gt;
            &lt;systemPropertyVariables&gt;
              &lt;apple.awt.UIElement&gt;true&lt;/apple.awt.UIElement&gt;
              &lt;org.uberfire.nio.git.daemon.enabled&gt;false&lt;/org.uberfire.nio.git.daemon.enabled&gt;
              &lt;org.uberfire.nio.git.ssh.enabled&gt;false&lt;/org.uberfire.nio.git.ssh.enabled&gt;
              &lt;org.uberfire.sys.repo.monitor.disabled&gt;true&lt;/org.uberfire.sys.repo.monitor.disabled&gt;
            &lt;/systemPropertyVariables&gt;
          &lt;/configuration&gt;
        &lt;/plugin&gt;
        &lt;plugin&gt;
          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
          &lt;artifactId&gt;maven-jar-plugin&lt;/artifactId&gt;
          &lt;version&gt;3.2.0&lt;/version&gt;
          &lt;executions&gt;
            &lt;execution&gt;
              &lt;id&gt;default-jar&lt;/id&gt;
            &lt;/execution&gt;
            &lt;!-- No OSGi manifestEntries for &lt;goal&gt;jar&lt;/goal&gt;: if it supported, then felix has already added them --&gt;
            &lt;execution&gt;
              &lt;id&gt;test-jar&lt;/id&gt;
              &lt;goals&gt;
                &lt;goal&gt;test-jar&lt;/goal&gt;
              &lt;/goals&gt;
              &lt;configuration&gt;
                &lt;skipIfEmpty&gt;true&lt;/skipIfEmpty&gt;
                &lt;excludes&gt;
                  &lt;exclude&gt;**/logback-test.xml&lt;/exclude&gt;
                  &lt;exclude&gt;**/jndi.properties&lt;/exclude&gt;
                &lt;/excludes&gt;
                &lt;archive&gt;
                  &lt;manifestEntries&gt;
                    &lt;Bundle-SymbolicName&gt;${java.module.name}.tests&lt;/Bundle-SymbolicName&gt;
                    &lt;Bundle-Version&gt;
                      ${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}.${osgi.snapshot.qualifier}
                    &lt;/Bundle-Version&gt;
                    &lt;Bundle-Name&gt;${project.name}&lt;/Bundle-Name&gt;
                    &lt;Bundle-Vendor&gt;${project.organization.name}&lt;/Bundle-Vendor&gt;
                  &lt;/manifestEntries&gt;
                &lt;/archive&gt;
              &lt;/configuration&gt;
            &lt;/execution&gt;
          &lt;/executions&gt;
          &lt;configuration&gt;
            &lt;archive&gt;
              &lt;manifest&gt;
                &lt;addDefaultSpecificationEntries&gt;true&lt;/addDefaultSpecificationEntries&gt;
                &lt;addDefaultImplementationEntries&gt;true&lt;/addDefaultImplementationEntries&gt;
              &lt;/manifest&gt;
            &lt;/archive&gt;
          &lt;/configuration&gt;
        &lt;/plugin&gt;
        &lt;plugin&gt;
          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
          &lt;artifactId&gt;maven-remote-resources-plugin&lt;/artifactId&gt;
          &lt;version&gt;1.5&lt;/version&gt;
          &lt;configuration&gt;
            &lt;resourceBundles&gt;
              &lt;resourceBundle&gt;org.jbpm.contrib:template-resources:${version.org.kie}&lt;/resourceBundle&gt;
            &lt;/resourceBundles&gt;
          &lt;/configuration&gt;
          &lt;executions&gt;
            &lt;execution&gt;
              &lt;goals&gt;
                &lt;goal&gt;process&lt;/goal&gt;
              &lt;/goals&gt;
            &lt;/execution&gt;
          &lt;/executions&gt;
        &lt;/plugin&gt;
      &lt;/plugins&gt;
    &lt;/build&gt;
  &lt;/project&gt;
  
  </code></pre>