jetty - How can I define Plugin Versions correctly in maven pom.xml? -


i struggeling in attempts create web-apps, , due office conventions, using maven/jetty/eclipse setup, while attempting create java web apps.

in command window, trying compile , run, typing mvn jetty:run. results in lot of warnings, before (very likely) related build failure. resolve these errors before moving on, if not reason of build failure.

the warning message seems missing declarations versions of plugins, , attempts search has suggested same. have versions defined. concern of mine errors states warnings ie. come line 13. empty line. worried there might update issues, or duplicated pom.xml-files, on note, compiler react me editing in file know it.

my error message is:

h:\projects\releaseplan>mvn jetty:run [info] scanning projects... [warning] [warning] problems encountered while building effective model releaseplan:releaseplan-model:jar:5 [warning] 'build.plugins.plugin.version' org.apache.maven.plugins:maven-compiler-plugin missing. @ releaseplan:releaseplan:5, h:\projects\releaseplan\pom.xml, line 13, column 15 [warning] 'build.plugins.plugin.version' org.apache.maven.plugins:maven-source-plugin missing. @ releaseplan:releaseplan:5, h:\projects\releaseplan\pom.xml, line 22, column 15 [warning] [warning] problems encountered while building effective model releaseplan:releaseplan-server:war:5 [warning] 'build.plugins.plugin.version' org.apache.maven.plugins:maven-compiler-plugin missing. @ releaseplan:releaseplan:5, h:\projects\releaseplan\pom.xml, line 13, column 15 [warning] 'build.plugins.plugin.version' org.apache.maven.plugins:maven-source-plugin missing. @ releaseplan:releaseplan:5, h:\projects\releaseplan\pom.xml, line 22, column 15 [warning] [warning] problems encountered while building effective model releaseplan:releaseplan:pom:5 [warning] 'build.plugins.plugin.version' org.apache.maven.plugins:maven-compiler-plugin missing. @ line 13, column 15 [warning] 'build.plugins.plugin.version' org.apache.maven.plugins:maven-source-plugin missing. @ line 22, column 15 

and entire pom.xml, in case error somewhere not expect be:

<?xml version="1.0" encoding="utf-8"?> <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/maven-v4_0_0.xsd">  <modelversion>4.0.0</modelversion> <groupid>releaseplan</groupid> <artifactid>releaseplan</artifactid> <version>1</version> <packaging>pom</packaging> <name>releaseplan</name>  <build>      <plugins>          <!--<plugin> <groupid>ro.isdc.wro4j</groupid> <artifactid>wro4j-maven-plugin</artifactid>              <version>${wro4j.version}</version> <executions> <execution> <goals> <goal>jshint</goal>              </goals> </execution> </executions> <configuration> <options>devel,evil,noarg</options>              </configuration> </plugin> -->         <plugin>             <artifactid>maven-compiler-plugin</artifactid>             <version>2.3.2</version>             <configuration>                 <source>1.6</source>                 <target>1.6</target>             </configuration>         </plugin>         <plugin>             <!-- jetty version: 8.x home: eclipse, codehaus java version: 1.6 protocols:                  http/1.1 rfc2616, websocket, spdy servlet version: 3.0 jsp version: 2.1 http://wiki.eclipse.org/jetty -->             <artifactid>jetty-maven-plugin</artifactid>             <version>8.1.13.v20130916</version>             <configuration>                 <webappconfig>                     <contextpath>/</contextpath>                 </webappconfig>                 <scanintervalseconds>1</scanintervalseconds>             </configuration>         </plugin>         <plugin>             <artifactid>maven-antrun-plugin</artifactid>             <executions>                 <execution>                     <phase>initialize</phase>                     <goals>                         <goal>run</goal>                     </goals>                     <configuration>                         <tasks>                             <echo>********************************************</echo>                             <echo>***** project requires maven 3.0+ *****</echo>                             <echo>********************************************</echo>                             <echo>mvn jetty:run - running un-assembled webapp</echo>                             <echo>mvn jetty:run-war - running assembled webapp</echo>                         </tasks>                     </configuration>                 </execution>             </executions>         </plugin>     </plugins> </build> <dependencymanagement>     <dependencies>         <!--  <dependency> <groupid>com.dyuproject.protostuff</groupid> <artifactid>protostuff-core</artifactid>              <version>${protostuff.version}</version> </dependency> <dependency> <groupid>com.dyuproject.protostuff</groupid>              <artifactid>protostuff-json</artifactid> <version>${protostuff.version}</version>              </dependency> -->         <dependency>             <groupid>org.mortbay.jetty</groupid>             <artifactid>servlet-api</artifactid>             <version>${servlet.version}</version>         </dependency>         <dependency>             <groupid>junit</groupid>             <artifactid>junit</artifactid>             <version>${junit.version}</version>         </dependency>         <dependency>             <groupid>org.codehaus.jackson</groupid>             <artifactid>jackson-core-asl</artifactid>             <version>${jackson.version}</version>         </dependency>     </dependencies> </dependencymanagement>  <modules>     <module>model</module>     <module>server</module> </modules>  <properties>     <project.build.sourceencoding>utf-8</project.build.sourceencoding>     <compiler.source>1.5</compiler.source>     <compiler.target>1.5</compiler.target>      <junit.version>4.4</junit.version>     <servlet.version>2.5-20081211</servlet.version>     <jetty.version>6.1.24</jetty.version>     <protobuf.version>2.3.0</protobuf.version>     <jackson.version>1.7.9</jackson.version>     <protostuff.version>1.0.2-snapshot</protostuff.version> </properties>   <repositories>         <repository>             <id>java</id>             <name>java</name>             <url>http://download.java.net/maven/2/</url>         </repository>         <repository>             <id>repo1</id>             <name>repo1</name>             <url>http://repo1.maven.org/maven2</url>         </repository>     </repositories>    <pluginrepositories>     <pluginrepository>       <id>central</id>       <name>maven plugin repository</name>       <url>http://repo1.maven.org/maven2</url>       <layout>default</layout>       <snapshots>         <enabled>false</enabled>       </snapshots>       <releases>         <updatepolicy>never</updatepolicy>       </releases>     </pluginrepository>   </pluginrepositories> </project> 

you use maven 3 need know plugins versions describe here : https://cwiki.apache.org/confluence/display/maven/maven+3.x+compatibility+notes#maven3.xcompatibilitynotes-automaticpluginversionresolution

adding in pluginmanagement section of parent pom.xml plugins versions right way. best way (in enterprise) have enterprise parent pom.xml file used projects.

in fact, add following line in parent pom.xml properties section :

<maven-compiler-plugin.version>3.0</maven-compiler-plugin.version> 

and add following line in parent pom.xml build > pluginmanagement section :

<plugin>     <artifactid>maven-compiler-plugin</artifactid>     <version>${maven-compiler-plugin.version}</version> </plugin> 

hope helps...


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -