m2eclipse - eclipse m2e default plugins settings -


env:

eclipse (mars) jdk 8  wildfly 8.2.0 final 

issue: everytime create maven project

  • it uses jdk 5 (war , jar)
  • complains web.xml missing (in case of war).

so, everytime have

  1. open pom.xml , include plugin configuration in pom.xml

  <build>      <pluginmanagement>        <plugins>          <plugin>            <groupid>org.apache.maven.plugins</groupid>            <artifactid>maven-war-plugin</artifactid>            <version>2.6</version>            <configuration>              <failonmissingwebxml>false</failonmissingwebxml>            </configuration>          </plugin>          <plugin>            <groupid>org.apache.maven.plugins</groupid>            <artifactid>maven-compiler-plugin</artifactid>            <version>3.3</version>            <configuration>              <source>1.8</source>              <target>1.8</target>            </configuration>          </plugin>        </plugins>      </pluginmanagement>    </build>

  1. change eclipse project compiler settings use 1.8
  2. change jre use 1.8
  3. manually update maven project settings

this real frustrating thing do. tried

  • find solution in stackoverflow , google. closer solution here. works not enough me.
  • find settings in eclipse no avail
  • find xml file settings in eclipse m2e plugins got nowhere

would greatful if

  • point me if missing settings
  • can offer solution pestering issue.

please note able resolve issues (eclipse errors , m2e errors) looking smarter solution avoid menial work every time!

thanks in advance, rakesh

the default settings see come default maven plugin settings.

  • the maven-compiler-plugin targets java 1.5
  • the maven-war-plugin has failonmissingwarxml=true default

the goal m2e stay close actual maven cli build produce. if want project build in command line or ci server, need have these maven plugin settings.

in workflow, don't need steps #2 , #3. executing maven > update project configuration (or ctr+alt+f5), take care of that. can enable automatic project configuration update in preferences > maven (since m2e 1.6), have do pom changes , save file.

if want have more control on these maven settings during project creation however, have 2 options:

  • make new maven project inherit parent pom, has maven-compiler-plugin , maven-war-plugin settings want
  • instead of creating new maven project, create new dynamic web project first. can change default java , web facets in eclipse wizard change default src folder src/main/java, , change default webcontent folder src/main/webapp. once project created, can convert maven project (right-click on project, configure > convert maven...). give appropriate project coordinate, , when hit finish, generated maven pom.xml maven plugin settings mapped original eclipse settings.

a third solution create project existing maven archetype. can try wildfly-javaee7-webapp-blank-archetype, maven central catalog, create javaee 7 web project instance ( (http://search.maven.org/#artifactdetails%7corg.wildfly.archetype%7cwildfly-javaee7-webapp-blank-archetype%7c8.2.0.final%7cmaven-archetype). using jbds or jboss tools maven integration (http://tools.jboss.org) you'll have access maven central archetype catalog default. else, can add in preferences > maven > archetypes > add remote catalog... use http://repo1.maven.org/maven2/ catalog file, , whatever description like.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -