user2298828
user2298828

Reputation:

After convert project to Maven, error come in plugin, how to solve it

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

Upvotes: 0

Views: 5451

Answers (3)

RITZ XAVI
RITZ XAVI

Reputation: 3799

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

Upvotes: 0

herrtim
herrtim

Reputation: 2755

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>

Upvotes: 1

Sangram Badi
Sangram Badi

Reputation: 4274

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

Upvotes: 1

Related Questions