Question

I recently found that some changes that I make in files are not reflected in target war - it happens only when I don't make any changes to java code, so the compilation phase is omitted. Is there a better way to force compilation than meaningless code changes like renaming variables or is there a way to update *.xml content?

EDIT:Here is my pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.example</groupId>
  <artifactId>hiring</artifactId>
  <version>1.0</version>
  <packaging>war</packaging>

  <dependencies>
    <dependency>
      <groupId>org.camunda.bpm</groupId>
      <artifactId>camunda-engine</artifactId>
      <version>7.0.0-Final</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
      <version>3.0.1</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.3</version>
        <configuration>
          <failOnMissingWebXml>false</failOnMissingWebXml>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <repositories>
    <repository>
      <id>camunda-bpm-nexus</id>
      <name>camunda-bpm-nexus</name>
      <url>https://app.camunda.com/nexus/content/groups/public</url>
    </repository>
  </repositories>
</project>

All xml files are at src/main/resources

I'm using Eclipse Keppler Service Release 1 with Maven 3.2.1, Java 1.7.0_17

Était-ce utile?

La solution

  1. Make sure you have m2e/m2e-wtp installed
  2. Make sure Eclipse applies the Maven project nature to the project - Right click project > Configure > Convert to Maven Project.
  3. If you edit a file outside Eclipse, make sure Eclipse knows about the change -- you need to enable native hooks -- Preferences > General > Workspace > Refresh using native hooks or polling. Alternatively, you can select the file and hit F5 (refresh) to make sure Eclipse is aware of the change.
  4. Hit publish if you're using WST/JST (server tools) and deploying to a server via Eclipse.

In my experience if you've done all this, it should publish the changes to your target war as expected. Though, you may need to restart the container if the XML files are used as part of the startup configuration.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top