title: How to enable static weaving in eclipseLink with remote persistence.xml using Maven?
body: <p>I have a separate jar which contains the persistence.xml. This jar has been added as a dependency in the parent pom of the jar which has the entities. I want to enable static weaving.
  According to <a href="https://wiki.eclipse.org/EclipseLink/UserGuide/JPA/Advanced_JPA_Development/Performance/Weaving/Static_Weaving" rel="nofollow noreferrer">EclipseLink documentation</a>, I can specify the persistenceXMLLocation as a configuration. However, should this location be an absolute file path of my persistence.xml or its path in a repository. Also how can I build my entities jar with weaving enabled? What would be the maven command to execute this plugin?</p>
  
  <p>Following is the error I get when the plugin is executed:</p>
  
  <pre><code>    Failed to execute goal de.empulse.eclipselink:staticweave-maven-plugin:1.0.0:weave (default-cli) on project BRBASE-techl-entities: Execution default-cli of goal de.empulse.eclipselink:staticweave-maven-plugin:1.0.0:weave failed:
  [ERROR] Exception Description: An exception was thrown while trying to load persistence unit at url: file:/D:/BRIDGE/BRIDGE-PARTIAL/BRBASE_Branch_selective_fetch/src/core/techl/entities/target/classes/
  [ERROR] Internal Exception: Exception [EclipseLink-30004] (Eclipse Persistence Services - 2.5.1.v20130824-981335c): org.eclipse.persistence.exceptions.PersistenceUnitLoadingException
  [ERROR] Exception Description: An exception was thrown while processing persistence.xml from URL: file:/D:/BRIDGE/BRIDGE-PARTIAL/BRBASE_Branch_selective_fetch/src/core/techl/entities/target/classes/
  [ERROR] Internal Exception: java.net.MalformedURLException: NullPointerException
  </code></pre>
  
  <p>Here, its looking for the persistence.xml file in the entities project's classpath.</p>
  
  <p>The mvn command I am using is :</p>
  
  <pre><code>de.empulse.eclipselink:staticweave-maven-plugin:weave
  </code></pre>
  
  <p>The plugin is :</p>
  
  <pre><code>&lt;plugin&gt;
                  &lt;groupId&gt;de.empulse.eclipselink&lt;/groupId&gt;
                  &lt;artifactId&gt;staticweave-maven-plugin&lt;/artifactId&gt;
                  &lt;version&gt;1.0.0&lt;/version&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;phase&gt;process-classes&lt;/phase&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;weave&lt;/goal&gt;
                          &lt;/goals&gt;
                          &lt;configuration&gt;
                              &lt;logLevel&gt;FINE&lt;/logLevel&gt;
                              &lt;persistenceXMLLocation&gt;D:\BRIDGE\BRIDGE-PARTIAL\DB\persistence-config\src\main\resources\META-INF\persistence.xml&lt;/persistenceXMLLocation&gt;
                          &lt;/configuration&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
                  &lt;dependencies&gt;
                      &lt;dependency&gt;
                          &lt;groupId&gt;org.eclipse.persistence&lt;/groupId&gt;
                          &lt;artifactId&gt;org.eclipse.persistence.jpa&lt;/artifactId&gt;
                          &lt;version&gt;2.5.1-RC1&lt;/version&gt;
                      &lt;/dependency&gt;
                      &lt;dependency&gt;
                          &lt;groupId&gt;com.mindtree.bridge.platform.db&lt;/groupId&gt;
                          &lt;artifactId&gt;BRDB-persistence-config&lt;/artifactId&gt;
                          &lt;version&gt;${db.version}&lt;/version&gt;
                      &lt;/dependency&gt;
                  &lt;/dependencies&gt;
              &lt;/plugin&gt;
  </code></pre>
  
  <p>EclipseLink version used : 2.5.1-RC1</p>
  
  <p>Is there something I am missing?</p>