1

重複の可能性:
maven: (-source 5 以上を使用して、静的インポート宣言を有効にします)

Maven でこのエラーを回避するにはどうすればよいですか (他にもあります。上部をコピーしただけです)。

重要なメッセージは次のようです。

エラー メッセージを解析できませんでした: (注釈を有効にするには -source 5 以上を使用してください)

コマンドに追加しようとし-source 5ましたが、認識されませんでした。使用するJavaバージョンまたはそれらの行に沿って何かを記述するために、どこかで構成ファイルを編集する必要がありますか?

エラーは次のとおりです。

[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure

C:\SVN-atx-Ingestion\branches\atx-ingestion\src\main\java\com\somecompany\eikon\atx\ingestion\database\atxAtomickosXaDataSource.java:[115,4] error: annotations are not supported in -source 1.3

could not parse error message:   (use -source 5 or higher to enable annotations)
C:\SVN-atx-Ingestion\branches\atx-ingestion\src\main\java\com\somecompany\eikon\atx\ingestion\database\atxAtomickosNonXaDataSource.java:47: error: annotations are not supported in -source 1.3
        @Override
         ^

could not parse error message:   (use -source 5 or higher to enable annotations)
C:\SVN-atx-Ingestion\branches\atx-ingestion\src\main\java\com\somecompany\eikon\atx\ingestion\database\XaDatabase.java:29: error: generics are not supported in -source 1.3
        private final Map<String,atxAtomickosXaDataSource> map =
4

2 に答える 2

4

あなたは私が思うこのようなことをする必要があります:

  <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>
    </plugins>
  </build>
于 2012-10-09T21:07:02.940 に答える
1

pom の構成としてフラグを追加する必要があります。

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <source>1.5</source>
                <target>1.5</target>
            </configuration>
         </plugin>

参考サイト

于 2012-10-09T21:07:37.153 に答える