2016-07-21 11 views
0

Mavenを使用してアプリケーションを実行しようとすると、以下のエラーが発生します。プロジェクトMoveOrder上で実行する(デフォルト-CLI) :桟橋-mavenの-プラグイン::8.1.4.v20120524Mavenがintellijでcom.oracle:ojdbc6:jar:11.1.0を見つけられません

ゴール org.mortbay.jettyの実行に失敗しました目標 org.mortbayの実行デフォルト-CLIを.jetty:jetty-maven-plugin:8.1.4.v20120524:実行に失敗しました: プラグインorg.mortbay.jetty:jetty-maven-plugin:8.1.4.v20120524または のいずれかの依存関係を解決できませんでした。 com.oracle:ojdbc6:jar:11.1.0 in http://repo.maven.apache.org/maven2 がローカルリポジトリにキャッシュされていた場合、centralの更新間隔が経過するか更新が強制されるまで、 の解決は再試行されません。

私はまた、最終的な</plugin>タグの前に下の方に

<dependencies> 
         <dependency> 
          <groupId>com.oracle</groupId> 
          <artifactId>ojdbc6</artifactId> 
          <version>11.1.0</version> 
         </dependency> 
        </dependencies> 

を追加しました。また、私のwebapp/WEB-INFフォルダの下にlibフォルダを作成し、そこにojdbc6-11.1.0.jarファイルを貼り付けて問題を解決することを期待しましたが、そうではありません。

ここに私の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> 
    <groupId>com.wwt.moveorder</groupId> 
    <artifactId>MoveOrder</artifactId> 
    <name>MoveOrderUI</name> 
    <packaging>war</packaging> 
    <version>1.1</version> 
    <properties> 
     <java-version>1.6</java-version> 
     <org.springframework-version>3.1.0.RELEASE</org.springframework-version> 
     <org.aspectj-version>1.6.9</org.aspectj-version> 
     <org.slf4j-version>1.5.10</org.slf4j-version> 
    </properties> 
    <repositories> 
     <repository> 
      <id>webbuild</id> 
      <name>Local Nexus</name> 
      <url>http://prodcit01.wwt.com:8081/nexus/content/repositories/public</url> 
     </repository> 
    </repositories> 

    <dependencies> 
     <dependency> 
      <groupId>com.wwt</groupId> 
      <artifactId>security</artifactId> 
      <version>1.1.8.4</version> 
     </dependency> 
     <!--Spring--> 
     <dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>spring-context</artifactId> 
      <version>${org.springframework-version}</version> 
      <exclusions> 
       <!-- Exclude Commons Logging in favor of SLF4j --> 
       <exclusion> 
        <groupId>commons-logging</groupId> 
        <artifactId>commons-logging</artifactId> 
       </exclusion> 
      </exclusions> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>spring-webmvc</artifactId> 
      <version>${org.springframework-version}</version> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>org.springframework.transaction</artifactId> 
      <version>${org.springframework-version}</version> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>org.springframework.core</artifactId> 
      <version>${org.springframework-version}</version> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>org.springframework.jdbc</artifactId> 
      <version>${org.springframework-version}</version> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>org.springframework.orm</artifactId> 
      <version>${org.springframework-version}</version> 
      <scope>test</scope> 
     </dependency> 

     <!-- Apache POI --> 
     <dependency> 
      <groupId>org.apache.poi</groupId> 
      <artifactId>poi</artifactId> 
      <version>3.8</version> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.poi</groupId> 
      <artifactId>poi-ooxml</artifactId> 
      <version>3.8</version> 
      <exclusions> 
       <exclusion> 
        <artifactId>xml-apis</artifactId> 
        <groupId>xml-apis</groupId> 
       </exclusion> 
      </exclusions> 
     </dependency> 
     <dependency> 
      <groupId>nu.xom</groupId> 
      <artifactId>xom</artifactId> 
      <version>1.2.7</version> 
      <scope>provided</scope> 
     </dependency> 

     <!-- Apache Commons Upload --> 
     <dependency> 
      <groupId>commons-fileupload</groupId> 
      <artifactId>commons-fileupload</artifactId> 
      <version>1.2.2</version> 
     </dependency> 
     <dependency> 
      <groupId>commons-io</groupId> 
      <artifactId>commons-io</artifactId> 
      <version>1.3.2</version> 
     </dependency> 


     <!-- AspectJ --> 
     <dependency> 
      <groupId>org.aspectj</groupId> 
      <artifactId>aspectjrt</artifactId> 
      <version>${org.aspectj-version}</version> 
     </dependency> 

     <!-- Logging --> 
     <dependency> 
      <groupId>org.slf4j</groupId> 
      <artifactId>slf4j-api</artifactId> 
      <version>${org.slf4j-version}</version> 
     </dependency> 
     <dependency> 
      <groupId>org.slf4j</groupId> 
      <artifactId>jcl-over-slf4j</artifactId> 
      <version>${org.slf4j-version}</version> 
      <scope>compile</scope> 
     </dependency> 
     <dependency> 
      <groupId>org.slf4j</groupId> 
      <artifactId>slf4j-log4j12</artifactId> 
      <version>${org.slf4j-version}</version> 
      <scope>compile</scope> 
     </dependency> 
     <dependency> 
      <groupId>log4j</groupId> 
      <artifactId>log4j</artifactId> 
      <version>1.2.15</version> 
      <exclusions> 
       <exclusion> 
        <groupId>javax.mail</groupId> 
        <artifactId>mail</artifactId> 
       </exclusion> 
       <exclusion> 
        <groupId>javax.jms</groupId> 
        <artifactId>jms</artifactId> 
       </exclusion> 
       <exclusion> 
        <groupId>com.sun.jdmk</groupId> 
        <artifactId>jmxtools</artifactId> 
       </exclusion> 
       <exclusion> 
        <groupId>com.sun.jmx</groupId> 
        <artifactId>jmxri</artifactId> 
       </exclusion> 
      </exclusions> 
      <scope>compile</scope> 
     </dependency> 

     <!-- @Inject --> 
     <dependency> 
      <groupId>javax.inject</groupId> 
      <artifactId>javax.inject</artifactId> 
      <version>1</version> 
     </dependency> 

     <!-- Servlet --> 
     <dependency> 
      <groupId>javax.servlet</groupId> 
      <artifactId>servlet-api</artifactId> 
      <version>2.5</version> 
      <scope>provided</scope> 
     </dependency> 
     <dependency> 
      <groupId>javax.servlet.jsp</groupId> 
      <artifactId>jsp-api</artifactId> 
      <version>2.1</version> 
      <scope>provided</scope> 
     </dependency> 
     <dependency> 
      <groupId>javax.servlet</groupId> 
      <artifactId>jstl</artifactId> 
      <version>1.2</version> 
     </dependency> 

     <!-- Test --> 
     <dependency> 
      <groupId>junit</groupId> 
      <artifactId>junit</artifactId> 
      <version>4.7</version> 
      <scope>test</scope> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>org.springframework.test</artifactId> 
      <version>${org.springframework-version}</version> 
      <scope>test</scope> 
     </dependency> 

     <!-- Jackson JSON Mapper --> 
     <dependency> 
      <groupId>org.codehaus.jackson</groupId> 
      <artifactId>jackson-mapper-asl</artifactId> 
      <version>1.5.3</version> 
     </dependency> 
     <dependency> 
      <groupId>org.codehaus.jackson</groupId> 
      <artifactId>jackson-core-asl</artifactId> 
      <version>1.6.4</version> 
     </dependency> 

     <!-- Oracle driver --> 
     <dependency> 
      <groupId>com.oracle</groupId> 
      <artifactId>ojdbc6</artifactId> 
      <version>11.1.0</version> 
      <scope>provided</scope> 
     </dependency> 
    </dependencies> 
    <build> 
     <pluginManagement> 
      <plugins> 
       <plugin> 
        <groupId>org.eclipse.m2e</groupId> 
        <artifactId>lifecycle-mapping</artifactId> 
        <version>1.0.0</version> 
        <configuration> 
         <lifecycleMappingMetadata> 
          <pluginExecutions> 
           <pluginExecution> 
            <pluginExecutionFilter> 
             <groupId> 
              net.alchim31.maven 
             </groupId> 
             <artifactId> 
              yuicompressor-maven-plugin 
             </artifactId> 
             <versionRange> 
              [1.3.0,) 
             </versionRange> 
             <goals> 
              <goal>compress</goal> 
             </goals> 
            </pluginExecutionFilter> 
            <action> 
             <execute></execute> 
            </action> 
           </pluginExecution> 
          </pluginExecutions> 
         </lifecycleMappingMetadata> 
        </configuration> 
       </plugin> 
      </plugins> 
     </pluginManagement> 
     <plugins> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-compiler-plugin</artifactId> 
       <configuration> 
        <source>${java-version}</source> 
        <target>${java-version}</target> 
       </configuration> 
      </plugin> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-war-plugin</artifactId> 
       <configuration> 
        <warName>MoveOrderUI</warName> 
       </configuration> 
      </plugin> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-dependency-plugin</artifactId> 
       <executions> 
        <execution> 
         <id>install</id> 
         <phase>install</phase> 
         <goals> 
          <goal>sources</goal> 
         </goals> 
        </execution> 
       </executions> 
      </plugin> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-resources-plugin</artifactId> 
       <version>2.5</version> 
       <configuration> 
        <encoding>UTF-8</encoding> 
       </configuration> 
      </plugin> 
      <plugin> 
       <groupId>org.codehaus.mojo</groupId> 
       <artifactId>weblogic-maven-plugin</artifactId> 
       <version>2.9.1</version> 
       <executions> 
        <execution> 
         <phase>deploy</phase> 
         <goals> 
          <goal>deploy</goal> 
          <goal>start</goal> 
         </goals> 
        </execution> 
       </executions> 
       <configuration> 
        <name>${project.name}</name> 
        <adminServerHostName>devjas1.wwt.com</adminServerHostName> 
        <adminServerPort>7001</adminServerPort> 
        <adminServerProtocol>t3</adminServerProtocol> 
        <userId>shenoys</userId> 
        <password>pass123</password> 
        <upload>false</upload> 
        <remote>true</remote> 
        <verbose>false</verbose> 
        <debug>false</debug> 
        <targetNames>WWTServer1</targetNames> 
        <noExit>true</noExit> 
        <artifactPath>${project.build.directory}/${project.name}.war</artifactPath> 
        <noExit>true</noExit> 
       </configuration> 
       <dependencies> 
        <dependency> 
         <groupId>weblogic</groupId> 
         <artifactId>wlfullclient</artifactId> 
         <version>10.3.0</version> 
        </dependency> 
        <dependency> 
         <groupId>weblogic</groupId> 
         <artifactId>webservices</artifactId> 
         <version>10.3.0</version> 
        </dependency> 
        <dependency> 
         <groupId>weblogic</groupId> 
         <artifactId>com.bea.core.descriptor.wl</artifactId> 
         <version>1.1.0.0</version> 
        </dependency> 
       </dependencies> 
      </plugin> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-war-plugin</artifactId> 
       <version>2.2</version> 
       <configuration> 
        <warName>${project.name}</warName> 
        <webappDirectory>${project.build.directory}/${project.name}</webappDirectory> 
       </configuration> 
      </plugin> 
      <plugin> 
       <groupId>net.alchim31.maven</groupId> 
       <artifactId>yuicompressor-maven-plugin</artifactId> 
       <version>1.3.0</version> 
       <executions> 
        <execution> 
         <phase>process-resources</phase> 
         <goals> 
          <goal>compress</goal> 
         </goals> 
        </execution> 
       </executions> 
       <configuration> 
        <webappDirectory>${project.build.directory}/${project.name}</webappDirectory> 
        <aggregations> 
         <aggregation> 
          <removeIncluded>true</removeIncluded> 
          <output>${project.build.directory}/${project.name}/resources/js/app.js</output> 
          <includes> 
           <include>**/*-min.js</include> 
          </includes> 
         </aggregation> 
         <aggregation> 
          <removeIncluded>true</removeIncluded> 
          <output>${project.build.directory}/${project.name}/resources/css/app.css</output> 
          <includes> 
           <include>**/*-min.css</include> 
          </includes> 
         </aggregation> 
        </aggregations> 
       </configuration> 
      </plugin> 
      <plugin> 
       <groupId>org.mortbay.jetty</groupId> 
       <artifactId>jetty-maven-plugin</artifactId> 
       <version>8.1.4.v20120524</version> 
       <configuration> 
        <scanIntervalSeconds>1</scanIntervalSeconds> 
        <stopKey>STOP</stopKey> 
        <stopPort>8089</stopPort> 
        <webApp> 
         <contextPath>/MoveOrderUI</contextPath> 
        </webApp> 
        <systemProperties> 
         <systemProperty> 
          <name>jetty.port</name> 
          <value>9900</value> 
         </systemProperty> 
         <systemProperty> 
          <name>userName</name> 
          <value>hummela</value> 
         </systemProperty> 
        </systemProperties> 
       </configuration> 
       <dependencies> 
        <dependency> 
         <groupId>com.oracle</groupId> 
         <artifactId>ojdbc6</artifactId> 
         <version>11.1.0</version> 
        </dependency> 
       </dependencies> 
      </plugin> 
     </plugins> 
    </build> 
</project> 

答えて

0

問題は、jdbcドライバがprovidedという依存関係としてマークされていることです。 <scope>provided</scope>を削除し、あなたが言及した他のすべてのハッキングを元に戻すと、うまくいくはずです。

提供された依存関係は、クラスパスで明示的に言及されるのではなく、コンテナによって利用可能にされるべきです。この場合、コンテナに関連するライブラリがないと推測しています。したがって、スコープを削除すると、他のすべてのように依存関係を管理できるはずです。

通常、使用する範囲はtestです。 Providedは、特に陰気であり、避けるべきです。 compileの範囲行も削除できます。サーブレットの依存関係は提供されたままにしておきたいかもしれませんが、そうではありません。

関連する問題