title: Maven eclipselink metamodel doesn't generated after clean
body: <p>My project is configured to use Eclipselink, build tool is Maven. I need to use JPA2 metamodel   inside my code, so my <code>pom.xml</code> contains related configuration:</p>
  
  <pre><code>        &lt;plugin&gt;
              &lt;groupId&gt;org.bsc.maven&lt;/groupId&gt;
              &lt;artifactId&gt;maven-processor-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.0.4&lt;/version&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;id&gt;process&lt;/id&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;process&lt;/goal&gt;
                      &lt;/goals&gt;
                      &lt;phase&gt;generate-sources&lt;/phase&gt;
                      &lt;configuration&gt;
                          &lt;outputDirectory&gt;${project.build.directory}/generated-sources/metamodel&lt;/outputDirectory&gt;
                          &lt;compilerArguments&gt;
                              -Aeclipselink.persistencexml=${project.basedir}/src/main/resources/META-INF/business/user/persistence.xml
                          &lt;/compilerArguments&gt;
                          &lt;processors&gt;
                              &lt;processor&gt;org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor
                              &lt;/processor&gt;
                          &lt;/processors&gt;
                      &lt;/configuration&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
  </code></pre>
  
  <p>When I try to execute <code>mvn clean compile</code>, I have errors during build:</p>
  
  <pre><code>[INFO] --- maven-processor-plugin:2.0.4:process (process) @ fsdp-user-service-datalayer ---
  [INFO] Source directory: &lt;path&gt;\UserService\DataLayer\target\generated-sources\metamodel added
  [INFO] Adding compiler arg: -Aeclipselink.persistencexml=&lt;path&gt;\UserService\DataLayer/src/main/resources/META-INF/business/user/persistence.xml
  [INFO] javac option: -cp
  [INFO] javac option: &lt;jars list&gt;
  [INFO] javac option: -proc:only
  [INFO] javac option: -Aeclipselink.persistencexml=&lt;path&gt;\UserService\DataLayer/src/main/resources/META-INF/business/user/persistence.xml
  [INFO] javac option: -processor
  [INFO] javac option: org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor
  [INFO] javac option: -d
  [INFO] javac option: &lt;path&gt;\UserService\DataLayer\target\classes
  [INFO] javac option: -s
  [INFO] javac option: &lt;path&gt;\UserService\DataLayer\target\generated-sources\metamodel
  [INFO] diagnostic &lt;path&gt;\UserService\DataLayer\src\main\java\user\dao\impl\UserDAOImpl.java:11: cannot find symbol
  symbol  : class UserEntity_
  location: package user.entity
  [INFO] diagnostic Note: Creating static metadata factory ...
  [INFO] diagnostic Note: Found Option : eclipselink.persistencexml, with value: &lt;path&gt;\UserService\DataLayer/src/main/resources/META-INF/business/user/persistence.xml
  [INFO] diagnostic Note: Optional file was not found: META-INF/orm.xml continuing with generation.
  [INFO] diagnostic Note: Optional file was not found: META-INF/eclipselink-orm.xml continuing with generation.
  [INFO] diagnostic Note: Optional file was not found: META-INF/business/user/orm.xml continuing with generation.
  [INFO] diagnostic warning: The following options were not recognized by any processor: '[eclipselink.persistencexml]'
  [INFO] 
  [INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ fsdp-user-service-datalayer ---
  [debug] execute contextualize
  [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
  [INFO] Copying 3 resources
  [INFO] 
  [INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ fsdp-user-service-datalayer ---
  [WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
  [INFO] Compiling 11 source files to &lt;path&gt;\UserService\DataLayer\target\classes
  [INFO] -------------------------------------------------------------
  [ERROR] COMPILATION ERROR : 
  [INFO] -------------------------------------------------------------
  [ERROR] &lt;path&gt;\UserService\DataLayer\src\main\java\user\dao\impl\UserDAOImpl.java:[11,57] cannot find symbol
  symbol  : class UserEntity_
  location: package user.entity
  [ERROR] &lt;path&gt;\UserService\DataLayer\src\main\java\user\dao\impl\UserDAOImpl.java:[99,22] cannot find symbol
  symbol  : variable UserEntity_
  location: class user.dao.impl.UserDAOImpl
  [INFO] 2 errors 
  [INFO] -------------------------------------------------------------
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 4.112s
  </code></pre>
  
  <p>Only after execution of <code>mvn compile</code> again I have successfull compilation.</p>
  
  <pre><code>[INFO] --- maven-processor-plugin:2.0.4:process (process) @ fsdp-user-service-datalayer ---
  [INFO] Source directory: &lt;path&gt;\UserService\DataLayer\target\generated-sources\metamodel added
  [INFO] Adding compiler arg: -Aeclipselink.persistencexml=&lt;path&gt;\UserService\DataLayer/src/main/resources/META-INF/business/user/persistence.xml
  [INFO] javac option: -cp
  [INFO] javac option: &lt;jars&gt;
  [INFO] javac option: -proc:only
  [INFO] javac option: -Aeclipselink.persistencexml=&lt;path&gt;\UserService\DataLayer/src/main/resources/META-INF/business/user/persistence.xml
  [INFO] javac option: -processor
  [INFO] javac option: org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor
  [INFO] javac option: -d
  [INFO] javac option: &lt;path&gt;\UserService\DataLayer\target\classes
  [INFO] javac option: -s
  [INFO] javac option: &lt;path&gt;\UserService\DataLayer\target\generated-sources\metamodel
  [INFO] diagnostic &lt;path&gt;\UserService\DataLayer\src\main\java\user\dao\impl\UserDAOImpl.java:11: cannot find symbol
  symbol  : class UserEntity_
  location: package user.entity
  [INFO] diagnostic Note: Creating static metadata factory ...
  [INFO] diagnostic Note: Found Option : eclipselink.persistencexml, with value: &lt;path&gt;\UserService\DataLayer/src/main/resources/META-INF/business/user/persistence.xml
  [INFO] diagnostic Note: Optional file was not found: META-INF/orm.xml continuing with generation.
  [INFO] diagnostic Note: Optional file was not found: META-INF/eclipselink-orm.xml continuing with generation.
  [INFO] diagnostic Note: File loaded : META-INF/business/user/orm.xml, is eclipselink-orm file: false
  [INFO] diagnostic Note: Found Option : eclipselink.persistencexml, with value: &lt;path&gt;\UserService\DataLayer/src/main/resources/META-INF/business/user/persistence.xml
  [INFO] diagnostic Note: Optional file was not found: META-INF/orm.xml continuing with generation.
  [INFO] diagnostic Note: Optional file was not found: META-INF/eclipselink-orm.xml continuing with generation.
  [INFO] diagnostic Note: File loaded : META-INF/business/user/orm.xml, is eclipselink-orm file: false
  [INFO] diagnostic warning: The following options were not recognized by any processor: '[eclipselink.persistencexml]'
  [INFO] 
  [INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ fsdp-user-service-datalayer ---
  [debug] execute contextualize
  [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
  [INFO] Copying 3 resources
  [INFO] 
  [INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ fsdp-user-service-datalayer ---
  [WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
  [INFO] Compiling 12 source files to &lt;path&gt;\UserService\DataLayer\target\classes
  [INFO] 
  [INFO] --- aspectj-maven-plugin:1.4:compile (compile) @ fsdp-user-service-datalayer ---
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD SUCCESS
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 4.720s
  [INFO] Finished at: Thu Aug 02 17:45:18 MSK 2012
  [INFO] Final Memory: 26M/62M
  [INFO] ------------------------------------------------------------------------
  </code></pre>
  
  <p>Main difference between two logs is what "unsucess clean compile" log have these lines:</p>
  
  <pre><code>[INFO] diagnostic Note: File loaded : META-INF/business/user/orm.xml, is eclipselink-orm file: false
  [INFO] diagnostic Note: Found Option : eclipselink.persistencexml, with value: &lt;path&gt;\UserService\DataLayer/src/main/resources/META-INF/business/user/persistence.xml
  [INFO] diagnostic Note: Optional file was not found: META-INF/orm.xml continuing with generation.
  [INFO] diagnostic Note: Optional file was not found: META-INF/eclipselink-orm.xml continuing with generation.
  [INFO] diagnostic Note: File loaded : META-INF/business/user/orm.xml, is eclipselink-orm file: false
  </code></pre>
  
  <p>but "success compile" log doesn't.</p>
  
  <p>So question is: why I have so strange behavior?</p>