0

コードをsvnにチェックインしたかったのですが、バイナリファイルを保存したくなかったのでTarget、mavenによって自動的に作成されたフォルダーを削除しました。問題は私がそれをして以来、mavenビルドが失敗しています。

これが私が試したすべてです:

  1. mvn clean install
  2. mvn clean compile -DskipTests=true install
  3. すべてのフォルダーを手動で消去し、再度ビルドしました。
  4. Eclipseはそれを構築できます。

Maven Dependencies興味深いことに、他のプロジェクトは正常に動作するため、Eclipse はこのプロジェクトのサブノードを表示しなくなりました。POM ファイルはまったく変更していません。

Pastebin はここでブロックされているため、ビルド出力をここに添付します。

どんな助けでも大歓迎です!

[INFO] 23 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Extractors ........................................ SUCCESS [0.125s]
[INFO] GenericExtractor .................................. FAILURE [0.687s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.968s
[INFO] Finished at: Fri Aug 10 15:36:44 EDT 2012
[INFO] Final Memory: 5M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project GenericExtractor: Compilation failure: Compilation failure:
[ERROR] \ABCInc\DEV\GemFireCode\src\java\Extractors\GenericExtractor\src\main\java\com\ABCInc\ef\extractors\core\DelimitedExtractor.java:[8,23] package org.apache.log4j does not exist
[ERROR] \ABCInc\DEV\GemFireCode\src\java\Extractors\GenericExtractor\src\main\java\com\ABCInc\ef\extractors\core\CoreExtractor.java:[11,23] package org.apache.log4j does not exist
[ERROR] \ABCInc\DEV\GemFireCode\src\java\Extractors\GenericExtractor\src\main\java\com\ABCInc\ef\extractors\core\CoreExtractor.java:[13,37] package com.ABCInc.ef.common.core.caching does not exist
[ERROR] \ABCInc\DEV\GemFireCode\src\java\Extractors\GenericExtractor\src\main\java\com\ABCInc\ef\extractors\core\CoreExtractor.java:[14,37] package com.ABCInc.ef.common.core.caching does not exist
[ERROR] \ABCInc\DEV\GemFireCode\src\java\Extractors\GenericExtractor\src\main\java\com\ABCInc\ef\extractors\core\DelimitedExtractor.java:[17,22] cannot find symbol
[ERROR] symbol  : class Logger
[ERROR] location: class com.ABCInc.ef.extractors.core.DelimitedExtractor<TKey,TValue>
[ERROR] \ABCInc\DEV\GemFireCode\src\java\Extractors\GenericExtractor\src\main\java\com\ABCInc\ef\extractors\core\FieldInfo.java:[5,31] package org.springframework.util does not exist
[ERROR] \ABCInc\DEV\GemFireCode\src\java\Extractors\GenericExtractor\src\main\java\com\ABCInc\ef\extractors\core\CoreExtractor.java:[22,22] cannot find symbol
[ERROR] symbol  : class Logger
[ERROR] location: class com.ABCInc.ef.extractors.core.CoreExtractor<TKey,TValue>
[ERROR] \ABCInc\DEV\GemFireCode\src\java\Extractors\GenericExtractor\src\main\java\com\ABCInc\ef\extractors\application\Launcher.java:[6,23] package org.apache.log4j does not exist
[ERROR] \ABCInc\DEV\GemFireCode\src\java\Extractors\GenericExtractor\src\main\java\com\ABCInc\ef\extractors\application\Launcher.java:[7,34] package org.springframework.context does not exist
[ERROR] \ABCInc\DEV\GemFireCode\src\java\Extractors\GenericExtractor\src\main\java\com\ABCInc\ef\extractors\application\Launcher.java:[8,42] package org.springframework.context.support does not exist
[ERROR] \ABCInc\DEV\GemFireCode\src\java\Extractors\GenericExtractor\src\main\java\com\ABCInc\ef\extractors\application\Launcher.java:[19,22] cannot find symbol
[ERROR] symbol  : class Logger
[ERROR] location: class com.ABCInc.ef.extractors.application.Launcher
[ERROR] \ABCInc\DEV\GemFireCode\src\java\Extractors\GenericExtractor\src\main\java\com\ABCInc\ef\extractors\core\CoreExtractor.java:[22,38] cannot find symbol
[ERROR] symbol  : variable Logger
[ERROR] location: class com.ABCInc.ef.extractors.core.CoreExtractor<TKey,TValue>
[ERROR] \ABCInc\DEV\GemFireCode\src\java\Extractors\GenericExtractor\src\main\java\com\ABCInc\ef\extractors\core\CoreExtractor.java:[148,3] cannot find symbol
[ERROR] symbol  : class ICacheManager
[ERROR] location: class com.ABCInc.ef.extractors.core.CoreExtractor<TKey,TValue>
[ERROR] \ABCInc\DEV\GemFireCode\src\java\Extractors\GenericExtractor\src\main\java\com\ABCInc\ef\extractors\core\CoreExtractor.java:[148,32] cannot find symbol
[ERROR] symbol  : variable CacheManagerFactory
[ERROR] location: class com.ABCInc.ef.extractors.core.CoreExtractor<TKey,TValue>
[ERROR] \ABCInc\DEV\GemFireCode\src\java\Extractors\GenericExtractor\src\main\java\com\ABCInc\ef\extractors\core\DelimitedExtractor.java:[17,38] cannot find symbol
[ERROR] symbol  : variable Logger
[ERROR] location: class com.ABCInc.ef.extractors.core.DelimitedExtractor<TKey,TValue>
[ERROR] \ABCInc\DEV\GemFireCode\src\java\Extractors\GenericExtractor\src\main\java\com\ABCInc\ef\extractors\core\FieldInfo.java:[15,15] cannot find symbol
[ERROR] symbol  : variable ReflectionUtils
[ERROR] location: class com.ABCInc.ef.extractors.core.FieldInfo
[ERROR] \ABCInc\DEV\GemFireCode\src\java\Extractors\GenericExtractor\src\main\java\com\ABCInc\ef\extractors\core\FieldInfo.java:[16,2] cannot find symbol
[ERROR] symbol  : variable ReflectionUtils
[ERROR] location: class com.ABCInc.ef.extractors.core.FieldInfo
[ERROR] \ABCInc\DEV\GemFireCode\src\java\Extractors\GenericExtractor\src\main\java\com\ABCInc\ef\extractors\core\FieldInfo.java:[49,15] cannot find symbol
[ERROR] symbol  : variable ReflectionUtils
[ERROR] location: class com.ABCInc.ef.extractors.core.FieldInfo
[ERROR] \ABCInc\DEV\GemFireCode\src\java\Extractors\GenericExtractor\src\main\java\com\ABCInc\ef\extractors\core\FieldInfo.java:[55,15] cannot find symbol
[ERROR] symbol  : variable ReflectionUtils
[ERROR] location: class com.ABCInc.ef.extractors.core.FieldInfo
[ERROR] \ABCInc\DEV\GemFireCode\src\java\Extractors\GenericExtractor\src\main\java\com\ABCInc\ef\extractors\core\FieldInfo.java:[78,15] cannot find symbol
[ERROR] symbol  : variable ReflectionUtils
[ERROR] location: class com.ABCInc.ef.extractors.core.FieldInfo
[ERROR] \ABCInc\DEV\GemFireCode\src\java\Extractors\GenericExtractor\src\main\java\com\ABCInc\ef\extractors\application\Launcher.java:[19,38] cannot find symbol
[ERROR] symbol  : variable Logger
[ERROR] location: class com.ABCInc.ef.extractors.application.Launcher
[ERROR] \ABCInc\DEV\GemFireCode\src\java\Extractors\GenericExtractor\src\main\java\com\ABCInc\ef\extractors\application\Launcher.java:[28,2] cannot find symbol
[ERROR] symbol  : class ApplicationContext
[ERROR] location: class com.ABCInc.ef.extractors.application.Launcher
[ERROR] \ABCInc\DEV\GemFireCode\src\java\Extractors\GenericExtractor\src\main\java\com\ABCInc\ef\extractors\application\Launcher.java:[28,30] cannot find symbol
[ERROR] symbol  : class ClassPathXmlApplicationContext
[ERROR] location: class com.ABCInc.ef.extractors.application.Launcher
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project GenericExtractor: Compilation failure
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation failure
        at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:656)
        at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:128)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
        ... 19 more
[ERROR]
[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
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :GenericExtractor

POM:

<?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>com.ABCInc.ef.extractors</groupId>
    <artifactId>Extractors</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <packaging>pom</packaging>
    <name>Extractors</name>
    <url>http://maven.apache.org</url>

    <modules>
        <module>GenericExtractor</module>
    </modules>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>2.3.2</version>
                    <configuration>
                        <source>1.6</source>
                        <target>1.6</target>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>appassembler-maven-plugin</artifactId>
                    <version>1.2.2</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
    <dependencyManagement>
        <dependencies>

            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.8.2</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>log4j</groupId>
                <artifactId>log4j</artifactId>
                <version>1.2.14</version>
            </dependency>

            <!-- spring -->
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-core</artifactId>
                <version>3.0.5.RELEASE</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-context</artifactId>
                <version>3.0.5.RELEASE</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-beans</artifactId>
                <version>3.0.5.RELEASE</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

</project>
4

2 に答える 2

2

<dependencyManagement>POM でセクションを宣言しただけのようです。<dependencies>依存関係を実際にコンパイル時のクラスパスに追加するには、POM のルート直下のブロックでも宣言する必要があります。

于 2012-08-13T15:51:53.613 に答える
1

では、次のように、要素内ではなくpom.xml、最上位の要素内で依存関係を指定する必要があります。<dependencies><dependencyManagement>

<project>
    ...
    <url>
    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.8.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.14</version>
        </dependency>
        <!-- spring -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>3.0.5.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>3.0.5.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
            <version>3.0.5.RELEASE</version>
        </dependency>
    </dependencies>
    ...
</project>
于 2012-08-13T15:52:24.250 に答える