2013-10-31 30 views
0

我有一個與maven的網絡應用程序。這個應用程序使用一個jar文件來具有.class(這是其他應用程序,但這個jar文件不是maven應用程序,它是用ant完成的,它只有.class,...)。 在我的web應用程序我使用類有在這個jar文件,但是當我使用Maven部署安裝,我的下一個錯誤:我有我的jar在maven應用程序的錯誤

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.4:compile (default-compile) on project Web_provision: Compilation failure: Compilation failure: 
    [ERROR] ...\controller\common\InitialController.java:[5,59] error: package name.package... does not exist 
    [ERROR]...\controller\common\InitialController.java:[20,11] error: cannot find symbol 
    [ERROR] symbol: class IWebProvisionCorporativeFacade 
... 

的jar文件到WEB-INF/lib目錄中。但是當我做Maven安裝時,我不會拿它。不過在編譯的時候我不有一個錯誤,因爲Web應用程序看到這個罐子

這是我的pom.xml

.... 
    <dependencies> 

      <!-- Spring --> 

      <dependency> 
       <groupId>org.springframework</groupId> 
       <artifactId>spring-web</artifactId> 
       <version>${spring.version}</version> 
      </dependency> 

      <dependency> 
       <groupId>org.springframework</groupId> 
       <artifactId>spring-webmvc</artifactId> 
       <version>${spring.version}</version> 
      </dependency> 

      <dependency> 
       <groupId>org.springframework</groupId> 
       <artifactId>spring-expression</artifactId> 
       <version>${spring.version}</version> 
      </dependency> 

      <!-- Tiles --> 

      <dependency> 
       <groupId>log4j</groupId> 
       <artifactId>log4j</artifactId> 
       <version>1.2.15</version> 
       <exclusions> 
        <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> 
      </dependency> 

      <dependency> 
       <groupId>org.slf4j</groupId> 
       <artifactId>slf4j-log4j12</artifactId> 
       <version>1.5.6</version> 
      </dependency> 

      <dependency> 
       <groupId>javax.servlet</groupId> 
       <artifactId>jstl</artifactId> 
       <version>1.2</version> 
      </dependency> 

      <dependency> 
       <groupId>org.apache.tiles</groupId> 
       <artifactId>tiles-servlet</artifactId> 
       <version>3.0.0</version> 
      </dependency> 

      <dependency> 
       <groupId>org.apache.tiles</groupId> 
       <artifactId>tiles-jsp</artifactId> 
       <version>3.0.0</version> 
      </dependency> 

      <!-- Test --> 
      <dependency> 
       <groupId>junit</groupId> 
       <artifactId>junit</artifactId> 
       <version>3.8.1</version> 
       <scope>test</scope> 
      </dependency> 

     </dependencies> 

     <build> 
      <pluginManagement> 
       <plugins> 
        <plugin> 
         <groupId>org.apache.maven.plugins</groupId> 
         <artifactId>maven-compiler-plugin</artifactId> 
         <version>2.4</version> 
         <configuration> 
          <source>${compiler.version}</source> 
          <target>${compiler.version}</target> 
         </configuration> 
        </plugin> 
        <plugin> 
         <groupId>org.apache.maven.plugins</groupId> 
         <artifactId>maven-surefire-plugin</artifactId> 
         <configuration> 
          <argLine>-XX:-UseSplitVerifier</argLine> 
         </configuration> 
        </plugin> 
       </plugins> 
      </pluginManagement> 
      <finalName>Web_provision</finalName> 
     </build> 
... 
+0

請發佈您的pom.xml。 – Kalher

+0

您可以顯示整個'pom.xml'文件,並指出哪個依賴包含'secosol.alartec.core.facades.webProvision'界面? –

+0

這個接口下面的jar文件不是一個maven文件,因此我不能做這個參考。 我可以從maven文件中引用jar文件嗎? – Ltcs

回答

0

要引用包含secosol.alartec.core.facades.webProvision的JAR文件,請使用mvn install:install-file目標。它會將工件安裝在本地存儲庫中,並將其提供給Maven。

然後,您可以將其添加到dependencies部分中的pom.xml(提供groupdId,artifactId和版本)。您可以通過致電mvn dependency:tree來驗證它是否已添加到項目的相關性中。

+0

我的項目,我已經使用了下: \t 的groupId \t 的artifactId \t 1.0 \t 系統 \t $ {} project.basedir/where's .jar文件/ fileName.jar \t Ltcs

相關問題