2013-07-13 80 views
1

嗨我有一个问题与maven。我想运行我的应用程序,但是当我键入“干净安装码头:运行”我收到此错误:无法解决从工作区项目的依赖关系

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". 
    SLF4J: Defaulting to no-operation (NOP) logger implementation 
    SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. 
    [INFO] Scanning for projects... 
    [INFO]                   
    [INFO] ------------------------------------------------------------------------ 
    [INFO] Building frontend 0.0.1-SNAPSHOT 
    [INFO] ------------------------------------------------------------------------ 
    [WARNING] The POM for laud.b2b:logic:jar:0.0.1-SNAPSHOT is missing, no dependency information available 
    [INFO] ------------------------------------------------------------------------ 
    [INFO] BUILD FAILURE 
    [INFO] ------------------------------------------------------------------------ 
    [INFO] Total time: 1.585s 
    [INFO] Finished at: Sat Jul 13 20:17:27 CEST 2013 
    [INFO] Final Memory: 6M/15M 
    [INFO] ------------------------------------------------------------------------ 
    [ERROR] Failed to execute goal on project Frontend: Could not resolve dependencies for project laud.b2b:Frontend:war:0.0.1-SNAPSHOT: Failure to find laud.b2b:logic:jar:0.0.1-SNAPSHOT in http://maven.vaadin.com/vaadin-addons was cached in the local repository, resolution will not be reattempted until the update interval of vaadin-addons has elapsed or updates are forced -> [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 

“逻辑”是我的工作区中的第二个项目。 我不知道该如何解决这个错误。我搜索整个互联网,我可以做什么吧...

从前端的项目我的pom.xml:

<?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> 
    <parent> 
     <artifactId>laud.b2b-root</artifactId> 
     <groupId>laud.b2b</groupId> 
     <version>0.0.1-SNAPSHOT</version> 
    </parent> 
    <groupId>laud.b2b</groupId> 
    <artifactId>Frontend</artifactId> 
    <packaging>war</packaging> 
    <version>0.0.1-SNAPSHOT</version> 
    <name>frontend</name> 

    <properties> 
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
     <vaadin.version>7.1.0</vaadin.version> 
     <vaadin.plugin.version>${vaadin.version}</vaadin.plugin.version> 
     <org.springframework.version>3.0.5.RELEASE</org.springframework.version> 
    </properties> 
    <repositories> 
     <repository> 
      <id>vaadin-addons</id> 
      <url>http://maven.vaadin.com/vaadin-addons</url> 
     </repository> 
     <repository> 
      <id>vaadin-snapshots</id> 
      <url>http://oss.sonatype.org/content/repositories/vaadin-snapshots/</url> 
      <releases> 
       <enabled>false</enabled> 
      </releases> 
      <snapshots> 
      </snapshots> 
     </repository> 
    </repositories> 
    <pluginRepositories> 
     <pluginRepository> 
      <id>vaadin-snapshots</id> 
      <url>http://oss.sonatype.org/content/repositories/vaadin-snapshots/</url> 
      <releases> 
       <enabled>false</enabled> 
      </releases> 
      <snapshots> 
      </snapshots> 
     </pluginRepository> 
    </pluginRepositories> 
    <dependencies> 
     <dependency> 
      <groupId>com.vaadin</groupId> 
      <artifactId>vaadin-server</artifactId> 
      <version>${vaadin.version}</version> 
     </dependency> 
     <dependency> 
      <groupId>com.vaadin</groupId> 
      <artifactId>vaadin-client-compiled</artifactId> 
      <version>${vaadin.version}</version> 
     </dependency> 
     <!-- Needed when using the widgetset optimizer (custom ConnectorBundleLoaderFactory). 
      For widgetset compilation, vaadin-client-compiler is automatically added 
      on the compilation classpath by vaadin-maven-plugin so normally there is 
      no need for an explicit dependency. --> 
     <dependency> 
      <groupId>com.vaadin</groupId> 
      <artifactId>vaadin-client-compiler</artifactId> 
      <version>${vaadin.version}</version> 
      <scope>provided</scope> 
     </dependency> 

     <dependency> 
      <groupId>com.vaadin</groupId> 
      <artifactId>vaadin-client</artifactId> 
      <version>${vaadin.version}</version> 
      <scope>provided</scope> 
     </dependency> 
     <dependency> 
      <groupId>com.vaadin</groupId> 
      <artifactId>vaadin-push</artifactId> 
      <version>${vaadin.version}</version> 
     </dependency> 
     <dependency> 
      <groupId>laud.b2b</groupId> 
      <artifactId>logic</artifactId> 
      <version>0.0.1-SNAPSHOT</version> 
     </dependency> 
     <dependency> 
      <groupId>com.vaadin</groupId> 
      <artifactId>vaadin-themes</artifactId> 
      <version>${vaadin.version}</version> 
     </dependency> 
     <dependency> 
      <groupId>ru.xpoft.vaadin</groupId> 
      <artifactId>spring-vaadin-integration</artifactId> 
      <version>2.0.1</version> 
     </dependency> 
     <dependency> 
      <groupId>javax.servlet</groupId> 
      <artifactId>javax.servlet-api</artifactId> 
      <version>3.0.1</version> 
      <scope>provided</scope> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>spring-beans</artifactId> 
      <version>${org.springframework.version}</version> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>spring-web</artifactId> 
      <version>${org.springframework.version}</version> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework.security</groupId> 
      <artifactId>spring-security-core</artifactId> 
      <version>${org.springframework.version}</version> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework.security</groupId> 
      <artifactId>spring-security-config</artifactId> 
      <version>${org.springframework.version}</version> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework.security</groupId> 
      <artifactId>spring-security-web</artifactId> 
      <version>${org.springframework.version}</version> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>spring-context</artifactId> 
      <version>${org.springframework.version}</version> 
     </dependency> 

     <dependency> 
      <groupId>org.slf4j</groupId> 
      <artifactId>slf4j-log4j12</artifactId> 
      <version>1.6.6</version> 
     </dependency> 
     <dependency> 
      <groupId>org.slf4j</groupId> 
      <artifactId>slf4j-api</artifactId> 
      <version>1.6.6</version> 
     </dependency> 
     <dependency> 
      <groupId>log4j</groupId> 
      <artifactId>log4j</artifactId> 
      <version>1.2.16</version> 
     </dependency> 

    </dependencies> 


    <profiles> 
     <profile> 
      <id>compile-widgetset</id> 
      <build> 
       <plugins> 
        <plugin> 
         <groupId>org.apache.maven.plugins</groupId> 
         <artifactId>maven-compiler-plugin</artifactId> 
         <configuration> 
          <source>1.6</source> 
          <target>1.6</target> 
         </configuration> 
        </plugin> 
        <!-- As we are doing "inplace" GWT compilation, ensure the widgetset --> 
        <!-- directory is cleaned properly --> 
        <plugin> 
         <artifactId>maven-clean-plugin</artifactId> 
         <version>2.4.1</version> 
         <configuration> 
          <filesets> 
           <fileset> 
            <directory>src/main/webapp/VAADIN/widgetsets</directory> 
           </fileset> 
          </filesets> 
         </configuration> 
        </plugin> 
        <plugin> 
         <groupId>org.apache.maven.plugins</groupId> 
         <artifactId>maven-war-plugin</artifactId> 
         <version>2.2</version> 
         <configuration> 
          <failOnMissingWebXml>false</failOnMissingWebXml> 
         </configuration> 
        </plugin> 
        <plugin> 
         <groupId>com.vaadin</groupId> 
         <artifactId>vaadin-maven-plugin</artifactId> 
         <version>${vaadin.plugin.version}</version> 
         <configuration> 
          <extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs> 
          <!-- <runTarget>mobilemail</runTarget> --> 
          <!-- We are doing "inplace" but into subdir VAADIN/widgetsets. This 
           way compatible with Vaadin eclipse plugin. --> 
          <webappDirectory>${basedir}/src/main/webapp/VAADIN/widgetsets</webappDirectory> 
          <hostedWebapp>${basedir}/src/main/webapp/VAADIN/widgetsets</hostedWebapp> 
          <noServer>true</noServer> 
          <!-- Remove draftCompile when project is ready --> 
          <draftCompile>false</draftCompile> 
          <compileReport>true</compileReport> 
          <style>OBF</style> 
          <strict>true</strict> 
          <runTarget>http://localhost:8080/</runTarget> 
         </configuration> 
         <executions> 
          <execution> 
           <configuration></configuration> 
           <goals> 
            <goal>clean</goal> 
            <goal>resources</goal> 
            <goal>update-theme</goal> 
            <goal>update-widgetset</goal> 
            <goal>compile-theme</goal> 
            <goal>compile</goal> 
           </goals> 
          </execution> 
         </executions> 
        </plugin> 
       </plugins> 
      </build> 
     </profile> 
    </profiles> 

    <build> 
     <plugins> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-compiler-plugin</artifactId> 
       <version>2.3.2</version> 
       <configuration> 
        <source>1.6</source> 
        <target>1.6</target> 
       </configuration> 
      </plugin> 
     </plugins> 
     <pluginManagement> 
      <plugins> 
       <plugin> 
        <groupId>org.mortbay.jetty</groupId> 
        <artifactId>jetty-maven-plugin</artifactId> 
        <configuration> 
         <scanIntervalSeconds>3</scanIntervalSeconds> 
        </configuration> 
       </plugin> 
       <!--This plugin's configuration is used to store Eclipse m2e settings 
        only. It has no influence on the Maven build itself. --> 
       <plugin> 
        <groupId>org.eclipse.m2e</groupId> 
        <artifactId>lifecycle-mapping</artifactId> 
        <version>1.0.0</version> 
        <configuration> 
         <lifecycleMappingMetadata> 
          <pluginExecutions> 
           <pluginExecution> 
            <pluginExecutionFilter> 
             <groupId>com.vaadin</groupId> 
             <artifactId>vaadin-maven-plugin</artifactId> 
             <versionRange>[7.1.0,)</versionRange> 
             <goals> 
              <goal>resources</goal> 
              <goal>update-widgetset</goal> 
              <goal>compile</goal> 
             </goals> 
            </pluginExecutionFilter> 
            <action> 
             <ignore></ignore> 
            </action> 
           </pluginExecution> 
          </pluginExecutions> 
         </lifecycleMappingMetadata> 
        </configuration> 
       </plugin> 
      </plugins> 
     </pluginManagement> 
    </build> 
</project> 

(AD2)

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". 
SLF4J: Defaulting to no-operation (NOP) logger implementation 
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. 
[INFO] Scanning for projects... 
[INFO]                   
[INFO] ------------------------------------------------------------------------ 
[INFO] Building frontend 0.0.1-SNAPSHOT 
[INFO] ------------------------------------------------------------------------ 
[INFO] 
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ Frontend --- 
[INFO] Deleting C:\Users\mateu\git\LPMavenProblem\laud\laud.b2b-root\Frontend\target 
[INFO] 
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ Frontend --- 
[debug] execute contextualize 
[INFO] Using 'UTF-8' encoding to copy filtered resources. 
[INFO] skip non existing resourceDirectory C:\Users\mateu\git\LPMavenProblem\laud\laud.b2b-root\Frontend\src\main\resources 
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ Frontend --- 
[INFO] Compiling 2 source files to C:\Users\mateu\git\LPMavenProblem\laud\laud.b2b-root\Frontend\target\classes 
[INFO] ------------------------------------------------------------- 
[ERROR] COMPILATION ERROR : 
[INFO] ------------------------------------------------------------- 
[ERROR] Unable to locate the Javac Compiler in: 
    C:\Program Files (x86)\Java\jre7\..\lib\tools.jar 
Please ensure you are using JDK 1.4 or above and 
not a JRE (the com.sun.tools.javac.Main class is required). 
In most cases you can change the location of your Java 
installation by setting the JAVA_HOME environment variable. 
[INFO] 1 error 
[INFO] ------------------------------------------------------------- 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 1.744s 
[INFO] Finished at: Sat Jul 13 21:13:52 CEST 2013 
[INFO] Final Memory: 8M/19M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project Frontend: Compilation failure 
[ERROR] Unable to locate the Javac Compiler in: 
[ERROR] C:\Program Files (x86)\Java\jre7\..\lib\tools.jar 
[ERROR] Please ensure you are using JDK 1.4 or above and 
[ERROR] not a JRE (the com.sun.tools.javac.Main class is required). 
[ERROR] In most cases you can change the location of your Java 
[ERROR] installation by setting the JAVA_HOME environment variable. 
[ERROR] -> [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/MojoFailureException 
+0

粘贴在你'pom.xml'。 –

+0

@ Grzegorz-现在我的pom文件存在问题 –

+0

您是否为逻辑项目完成了“mvn clean install”?它不会在您当地的回购中找到该罐子。 –

回答

4

最大的可能是你的避风港” t安装了构建frontend工件所需的所有依赖关系。如果frontend取决于laud.b2b.logic,你必须首先这神器安装到你的本地库,然后才能建立依赖于它的器物,即:

  1. 转到logic源树和执行mvn install
  2. 然后去frontend并尝试构建过程再次

也许这是建立根pom.xml对所有分项目,并指定它们作为模块,然后在新的根项目启动构建过程是一个好主意。 Maven会按照正确的顺序编译和安装它们。

参考文献:

+0

现在我的错误显示在我的问题(AD2) –

+0

您安装了** JDK ** 7吗?看起来你的系统上只有一个JRE。 – nif

+0

我已经安装了JRE 1.7和JRE 1.7 –

相关问题