0
votes

I convert my project in maven. after i getting error in tag. i mention in below where i got error. i'm using java 1.8, Spring4 and Hibernate5 how to configure this 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>Spring_Hibernate_MVC</groupId>
  <artifactId>Spring_Hibernate_MVC</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>war</packaging>
  <build>
    <sourceDirectory>src</sourceDirectory>
    <plugins>
      <plugin>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.6</version>
        <configuration>
          <warSourceDirectory>WebContent</warSourceDirectory>
          <failOnMissingWebXml>false</failOnMissingWebXml>
        </configuration>
      </plugin>
      <plugin>----/Here i'm getting error
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.5.1</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
    </plugins>
  </build>      
  <dependencies>
  </dependencies>
</project>

erroe detail is

Errors occurred during the build. Errors running builder 'Maven Project Builder' on project 'Spring_Hibernate_MVC'. Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6 Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6 Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6 Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6

3
i found another error. No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? i saw in Window > Preferences > Java > Installed JREs > jdk is not there...what i should do.? how to download there.Karmesh Madhavi
On Eclipse, go to Windows -> Preferences -> Double Click on Java -> Double Click Installed JRE's -> Add -> Standard VM. For the JRE Home browse to the location where your Java JDK is present (usually it will be C:\Program Files\Java\jdk1.7.0_45). Then select finish. This will get the java compiler added.RITZ XAVI

3 Answers

1
votes

if you are using eclipse, then you need to update maven in your project

Right-click on your project(s) --> Maven --> Update Project.

it may help you

1
votes

You forgot the groupId, which is essential when defining plugins and dependencies in Maven.

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.5.1</version>
    <configuration>
        <source>1.8</source>
        <target>1.8</target>
        <showDeprecation>true</showDeprecation>
        <showWarnings>true</showWarnings>
    </configuration>
</plugin>
0
votes

You will have to add the JDK as a runtime instead of JRE. On Eclipse, go to Windows -> Preferences -> Double Click on Java -> Double Click Installed JRE's -> Add -> Standard VM. For the JRE Home browse to the location where your Java JDK is present (usually it will be C:\Program Files\Java\jdk1.7.0_45). Then select finish. This will get the java compiler added