构建失败:无法在项目WebdevApp上执行目标

时间:2017-04-20 04:22:57

标签: java eclipse maven

我在Eclipse Neon中进行maven构建时遇到构建失败。我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>edu.xyz.abcd</groupId>
  <artifactId>WebdevAPP</artifactId>
  <version>0.0.60</version>  
  <packaging>war</packaging>

  <properties>
      <java.version>1.8</java.version>
      <spring.orm.version>4.2.5.RELEASE</spring.orm.version>
      <hibernate.version>4.3.5.Final</hibernate.version>
      <oracle.jdbc.version>12.1.0.1</oracle.jdbc.version>
      <apache.commons.version>2.1.1</apache.commons.version>
      <junit.version>4.12</junit.version>
      <LocalORM.version>0.0.23</LocalORM.version>
      <maven.tomcat.server>mytomcat</maven.tomcat.server>
      <maven.tomcat.url>http://localhost:8080/WebdevAPP</maven.tomcat.url>
  </properties>

  <parent>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-parent</artifactId>
      <version>1.3.3.RELEASE</version>
  </parent>

  <dependencies>
      <!-- Spring Boot Starter dependencies below -->
      <dependency>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-starter-web</artifactId>
      </dependency>
      <dependency>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-starter-tomcat</artifactId>
          <scope>provided</scope>         
      </dependency>
      <!--  Spring Boot Health -->
      <dependency>
          <groupId>org.springframework.boot</groupId>   
          <artifactId>spring-boot-starter-actuator</artifactId>
      </dependency>            

      <!-- Spring ORM/Oracle/JDBC dependencies below -->
      <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-jdbc</artifactId>
      </dependency>
      <dependency>
          <groupId>com.h2database</groupId>
          <artifactId>h2</artifactId>
      </dependency>             
      <dependency>
          <groupId>org.apache.commons</groupId>
          <artifactId>commons-dbcp2</artifactId>
          <version>${apache.commons.version}</version>
      </dependency>   
      <dependency>
          <groupId>com.oracle</groupId>
          <artifactId>ojdbc7</artifactId>
          <version>${oracle.jdbc.version}</version>       
      </dependency>     
      <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-orm</artifactId>
          <version>${spring.orm.version}</version>
      </dependency>

       <dependency>
    <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-core</artifactId>
            <version>4.2.1.RELEASE</version>
            </dependency>



      <!-- Hibernate dependencies -->
      <dependency>
          <groupId>org.hibernate</groupId>
          <artifactId>hibernate-entitymanager</artifactId>
          <version>${hibernate.version}</version>
      </dependency>
      <dependency>
          <groupId>org.hibernate</groupId>
          <artifactId>hibernate-core</artifactId>
          <version>${hibernate.version}</version>
      </dependency>   

      <!-- JUNIT testing dependencies below -->
      <dependency>
          <groupId>junit</groupId>
          <artifactId>junit</artifactId>
          <version>${junit.version}</version>
      </dependency>   

      <!-- LocalORM Library -->     
      <dependency>
          <groupId>edu.xyz.abcd</groupId>
          <artifactId>LocalORM</artifactId>
          <version>${LocalORM.version}</version>
          <type>jar</type>        
      </dependency>

  </dependencies>

  <build>
        <finalName>${project.artifactId}</finalName>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <mainClass>edu.xyz.registry.WebdevAPPApp</mainClass>                    
                </configuration>
            </plugin> 
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>tomcat-maven-plugin</artifactId>
                <configuration>
                    <url>${maven.tomcat.url}</url>
                    <server>${maven.tomcat.server}</server>
                    <path>/${project.artifactId}</path>
                    <update>true</update>                   
                </configuration>
            </plugin>                               
        </plugins>
  </build>

  <repositories>
      <repository>
          <id>spring-releases</id>
          <url>https://repo.spring.io/libs-release</url>
      </repository>
  </repositories>

  <pluginRepositories>
      <pluginRepository>
          <id>spring-releases</id>
          <url>https://repo.spring.io/libs-release</url>
      </pluginRepository>
  </pluginRepositories>  

</project>

以下是我的Eclipse的控制台相关内容。

[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for edu.xyz.abcd:WebdevAPP:war:0.0.60
[WARNING] 'build.plugins.plugin.version' for org.codehaus.mojo:tomcat-maven-plugin is missing. @ line 125, column 21
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building WebdevAPP 0.0.60
[INFO] ------------------------------------------------------------------------
[INFO] Downloading: https://repo.spring.io/libs-release/com/oracle/ojdbc7/12.1.0.1/ojdbc7-12.1.0.1.pom
[INFO] Downloading: https://repo.maven.apache.org/maven2/com/oracle/ojdbc7/12.1.0.1/ojdbc7-12.1.0.1.pom
[WARNING] The POM for com.oracle:ojdbc7:jar:12.1.0.1 is missing, no dependency information available
[INFO] Downloading: https://repo.spring.io/libs-release/edu/xyz/abcd/LocalORM/0.0.23/LocalORM-0.0.23.pom
[INFO] Downloading: https://repo.maven.apache.org/maven2/edu/xyz/abcd/LocalORM/0.0.23/LocalORM-0.0.23.pom
[WARNING] The POM for edu.xyz.abcd:LocalORM:jar:0.0.23 is missing, no dependency information available
[INFO] Downloading: https://repo.spring.io/libs-release/com/oracle/ojdbc7/12.1.0.1/ojdbc7-12.1.0.1.jar
[INFO] Downloading: https://repo.maven.apache.org/maven2/com/oracle/ojdbc7/12.1.0.1/ojdbc7-12.1.0.1.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.903 s
[INFO] Finished at: 2017-04-19T21:58:42-05:00
[INFO] Final Memory: 17M/114M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project WebdevAPP: Could not resolve dependencies for project edu.xyz.abcd:WebdevAPP:war:0.0.60: Could not find artifact com.oracle:ojdbc7:jar:12.1.0.1 in spring-releases (https://repo.spring.io/libs-release) -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

我在以下位置有ojdbc7 jar文件,如下面的屏幕截图所示:

D:\Users\myusername\.m2\repository\com\oracle\ojdbc7\12.1.0.1

enter image description here

同样,我的LocalORM相关文件位于以下目录中,不确定为什么警告显示在上面:

D:\Users\myusername\.m2\repository\edu\xyz\abcd\LocalORM\0.0.23

LocalORM-0.0.23.jar
LocalORM-0.0.23.pom.lastUpdated

0 个答案:

没有答案