6

I am new to maven, I have created a maven project in Eclipse on Wildfly server. Its deploying fine and working fine but I have a compilation issue in work space as like below.

cannot change version of project facet ear to 1.3

No issue is there when i specify project facet EAR as 7.0 but in problems it is showing as in the images.

enter image description here

enter image description here

How can I fix this issue?

pinkpanther
  • 4,770
  • 2
  • 38
  • 62
Jhansi Gupta
  • 61
  • 1
  • 1
  • 4
  • Is your application.xml file generated by maven or have you provided a hand crafted version? – Steve C Oct 05 '15 at 12:35
  • Thats not generated by maven. – Jhansi Gupta Oct 05 '15 at 13:12
  • 2
    I think this question is different from the linked question that is answered. i think it is because of wrong version of ear plugin. it should be like that: maven-ear-plugin2.97... Actually after version 1.4 of java the ear versions should be written like 5,6,7,8 and so on. – Ali Abazari Jul 02 '17 at 16:27
  • I agree with @AliReza19330! – ℛɑƒæĿᴿᴹᴿ Jan 03 '18 at 18:55
  • This was solved for me by an answer to a different, but similar question: [Cannot change version of project facet Dynamic Web Module to 3.0?](https://stackoverflow.com/a/18632054/41861) – Adrian Pronk May 12 '16 at 22:31

1 Answers1

3

I hope your using Wildfly server 8 or 9, try using version (jee version) to avoid this compile error

<build>
<plugins>
  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-ear-plugin</artifactId>
    <version>2.10.1</version>
    <configuration>
       <version>7</version>
    </configuration>
  </plugin>
</plugins>
</build>