2017-08-18 2 views
0

IntelliJのは、私のpom.xmlprovidedとしてマークされている私のプロジェクトで依存関係を解決することができません「提供」されているMavenの依存関係を認識しません。 JARはすべてダウンロードされており、.m2/repositoryディレクトリにあります。IntelliJのは

これを修正するにはどうすればよいですか?私はIntelliJ IDEA 2017.2.2のコミュニティ版172.3757.52をビルドしています。

http://maven.apache.org/xsd/maven-4.0.0.xsd "> 4.0.0 私-Solrの 私-Solrの 0.0:

以下はpom.xmlファイルです。 ?> OPE - Goはファイルする:1-SNAPSHOT

<properties> 
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> 
    <java.version>1.8</java.version> 
    <okhttp.version>3.6.0</okhttp.version> 
    <guava.version>19.0</guava.version> 
    <commons-lang.version>3.6</commons-lang.version> 
    <commons-collections.version>4.1</commons-collections.version> 
    <commons-io.version>2.5</commons-io.version> 
    <jackson-csv.version>2.7.0</jackson-csv.version> 
    <solr.version>6.6.0</solr.version> 
    <lombok.version>1.16.16</lombok.version> 
    <log4j.version>1.2.17</log4j.version> 
    <slf4j.version>1.7.1</slf4j.version> 
    <joda.time.version>2.8.1</joda.time.version> 
    <commons.logging.version>1.1.1</commons.logging.version> 
</properties> 
<dependencies> 
    <dependency> 
     <groupId>javax.json</groupId> 
     <artifactId>javax.json-api</artifactId> 
     <version>1.1</version> 
    </dependency> 
    <dependency> 
     <groupId>org.projectlombok</groupId> 
     <artifactId>lombok</artifactId> 
     <version>${lombok.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>com.squareup.okhttp3</groupId> 
     <artifactId>okhttp</artifactId> 
     <version>${okhttp.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>com.google.guava</groupId> 
     <artifactId>guava</artifactId> 
     <version>${guava.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.apache.commons</groupId> 
     <artifactId>commons-lang3</artifactId> 
     <version>${commons-lang.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.apache.commons</groupId> 
     <artifactId>commons-collections4</artifactId> 
     <version>${commons-collections.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>commons-io</groupId> 
     <artifactId>commons-io</artifactId> 
     <version>${commons-io.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.apache.solr</groupId> 
     <artifactId>solr-solrj</artifactId> 
     <version>${solr.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.apache.solr</groupId> 
     <artifactId>solr-test-framework</artifactId> 
     <version>${solr.version}</version> 
     <scope>test</scope> 
     <exclusions> 
      <exclusion> 
       <groupId>com.fasterxml.jackson.core</groupId> 
       <artifactId>jackson-core</artifactId> 
      </exclusion> 
     </exclusions> 
    </dependency> 
    <dependency> 
     <groupId>org.apache.solr</groupId> 
     <artifactId>solr-core</artifactId> 
     <version>${solr.version}</version> 
     <scope>provided</scope> 
    </dependency> 
    <dependency> 
     <groupId>log4j</groupId> 
     <artifactId>log4j</artifactId> 
     <version>${log4j.version}</version> 
     <scope>provided</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.slf4j</groupId> 
     <artifactId>slf4j-simple</artifactId> 
     <version>${slf4j.version}</version> 
     <scope>provided</scope> 
    </dependency> 
    <dependency> 
     <groupId>commons-logging</groupId> 
     <artifactId>commons-logging</artifactId> 
     <version>${commons.logging.version}</version> 
     <scope>test</scope> 
    </dependency> 
    <dependency> 
     <groupId>joda-time</groupId> 
     <artifactId>joda-time</artifactId> 
     <version>${joda.time.version}</version> 
    </dependency> 
</dependencies> 
    <build> 
    <resources> 
     <resource> 
      <directory>${project.basedir}/src/main/java</directory> 
      <includes> 
       <include>**/*.properties</include> 
       <include>**/*.vm</include> 
       <include>**/*.xml</include> 
       <include>**/*.xsd</include> 
      </includes> 
     </resource> 
     <resource> 
      <directory>${project.basedir}/src/main/resources</directory> 
      <excludes> 
       <exclude>log4j.xml</exclude> 
      </excludes> 
     </resource> 
    </resources> 
    <testResources> 
     <testResource> 
      <directory>${project.basedir}/src/test/java</directory> 
      <includes> 
       <include>**/*.properties</include> 
       <include>**/*.vm</include> 
       <include>**/*.xml</include> 
       <include>**/*.xsd</include> 
      </includes> 
     </testResource> 
     <testResource> 
      <directory>${project.basedir}/src/test/resources</directory> 
     </testResource> 
    </testResources> 
    <plugins> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-surefire-plugin</artifactId> 
      <version>2.16</version> 
      <dependencies> 
       <dependency> 
        <groupId>org.apache.maven.surefire</groupId> 
        <artifactId>surefire-junit47</artifactId> 
        <version>2.16</version> 
       </dependency> 
      </dependencies> 
     </plugin> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-jar-plugin</artifactId> 
      <executions> 
       <execution> 
        <goals> 
         <goal>test-jar</goal> 
        </goals> 
       </execution> 
      </executions> 
     </plugin> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-compiler-plugin</artifactId> 
      <version>3.3</version> 
      <configuration> 
       <source>${java.version}</source> 
       <target>${java.version}</target> 
       <encoding>UTF-8</encoding> 
      </configuration> 
     </plugin> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-shade-plugin</artifactId> 
      <version>2.4.1</version> 
      <executions> 
       <execution> 
        <phase>package</phase> 
        <goals> 
         <goal>shade</goal> 
        </goals> 
        <configuration> 
         <!-- <minimizeJar>true</minimizeJar> --> 
        </configuration> 
       </execution> 
      </executions> 
     </plugin> 
    </plugins> 
    <pluginManagement> 
     <plugins> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-jar-plugin</artifactId> 
       <version>2.4</version> 
       <configuration> 
        <finalName>${project.name}-${project.version}</finalName> 
       </configuration> 
      </plugin> 
     </plugins> 
    </pluginManagement> 
</build> 
<profiles> 
    <profile> 
     <id>dist</id> 
     <build> 
      <plugins> 
       <!-- mvn package -P dist --> 
       <plugin> 
        <groupId>org.apache.maven.plugins</groupId> 
        <artifactId>maven-resources-plugin</artifactId> 
        <version>2.6</version> 
        <inherited>false</inherited> 
        <executions> 
         <execution> 
          <id>copy-resources</id> 
          <phase>package</phase> 
          <goals> 
           <goal>copy-resources</goal> 
          </goals> 
          <configuration> 
           <outputDirectory>${project.build.directory}/lib</outputDirectory> 
           <resources> 
            <resource> 
             <directory>${project.basedir}/target/</directory> 
             <includes> 
              <include>${project.name}-${project.version}.jar</include> 
             </includes> 
            </resource> 
           </resources> 
          </configuration> 
         </execution> 
        </executions> 
       </plugin> 
       <plugin> 
        <groupId>org.apache.maven.plugins</groupId> 
        <artifactId>maven-dependency-plugin</artifactId> 
        <version>2.9</version> 
        <executions> 
         <execution> 
          <id>copy-dependencies</id> 
          <phase>package</phase> 
          <goals> 
           <goal>copy-dependencies</goal> 
          </goals> 
          <configuration> 
           <outputDirectory>${project.build.directory}/dependencies</outputDirectory> 
           <overWriteReleases>false</overWriteReleases> 
           <overWriteSnapshots>false</overWriteSnapshots> 
           <overWriteIfNewer>true</overWriteIfNewer> 
          </configuration> 
         </execution> 
        </executions> 
       </plugin> 
      </plugins> 
     </build> 
    </profile> 
</profiles> 

+0

ここにpomファイルを追加してください。 – Wayne

+0

をクリーンにして再度コンパイルしてください。 –

答えて

0

はどのようにあなたのプロジェクトをインポートしなかったMySolr何いつも私からの作品は以下のとおりです。 n次に、pom.xmlファイルを選択し、新しいプロジェクトとしてインポートします。あなたが前のものを上書きすることを確かめてください

0

私はこの奇妙な振る舞いを時折見てきました。プロジェクトからすべてのアイデアベースのファイルを削除してから、プロジェクトを閉じて再オープンし、すべての依存関係を再インポートしてください。この問題が発生したときはいつも助かります。