2013-05-10 65 views
0

我使用的是下面的pom.xml生成我的應用程序類文件沒有在pom.xml中

<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>${project.name}</groupId> 
<artifactId>${project.name}</artifactId> 
<packaging>war</packaging> 
<version>1.0-SNAPSHOT</version> 
<name>Service_Request</name> 

<repositories> 
    <repository> 
     <id>prime-repo</id> 
     <name>Prime Repo</name> 
     <url>http://repository.primefaces.org</url> 
    </repository> 
</repositories> 

<dependencies> 

    <!-- PrimeFaces --> 
    <dependency> 
     <groupId>org.primefaces</groupId> 
     <artifactId>primefaces</artifactId> 
     <version>3.5</version> 
    </dependency> 
    <dependency> 
     <groupId>org.primefaces.extensions</groupId> 
     <artifactId>all-themes</artifactId> 
     <version>1.0.8</version> 
    </dependency> 

    <!-- JSF --> 
    <dependency> 
     <groupId>com.sun.faces</groupId> 
     <artifactId>jsf-api</artifactId> 
     <version>2.1.21</version> 
    </dependency> 
    <dependency> 
     <groupId>com.sun.faces</groupId> 
     <artifactId>jsf-impl</artifactId> 
     <version>2.1.21</version> 
    </dependency> 

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

    <dependency> 
     <groupId>javax.servlet</groupId> 
     <artifactId>servlet-api</artifactId> 
     <version>2.5</version> 
    </dependency> 

    <dependency> 
     <groupId>javax.servlet.jsp</groupId> 
     <artifactId>jsp-api</artifactId> 
     <version>2.1</version> 
    </dependency> 

    <dependency> 
     <groupId>org.glassfish</groupId> 
     <artifactId>javax.faces</artifactId> 
     <version>2.1.21</version> 
    </dependency> 

    <dependency> 
     <groupId>com.sun.jersey</groupId> 
     <artifactId>jersey-client</artifactId> 
     <version>1.16</version> 
    </dependency> 

    <dependency> 
     <groupId>com.sun.jersey</groupId> 
     <artifactId>jersey-core</artifactId> 
     <version>1.16</version> 
    </dependency> 

    <dependency> 
     <groupId>com.oracle</groupId> 
     <artifactId>ojdbc14</artifactId> 
     <version>10.2.0.3.0</version> 
     <type>pom</type> 
    </dependency> 


    <!-- EL --> 
    <dependency> 
     <groupId>org.glassfish.web</groupId> 
     <artifactId>el-impl</artifactId> 
     <version>2.2</version> 
    </dependency> 
    <dependency> 
     <groupId>com.sun.el</groupId> 
     <artifactId>el-ri</artifactId> 
     <version>1.0</version> 
    </dependency> 
</dependencies> 
<build> 
    <finalName>${project.name}</finalName> 
    <resources> 
     <resource> 
      <directory>${project.basedir}/src/main/resources</directory> 
     </resource> 
    </resources> 
    <plugins> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-war-plugin</artifactId> 
      <configuration> 
       <warSourceDirectory>WebContent</warSourceDirectory> 
       <warSourceExcludes>WebContent/WEB-INF/lib/*.jar</warSourceExcludes> 
       <archiveClasses>false</archiveClasses> 
      </configuration> 
     </plugin> 
    </plugins> 
</build> 

但我無法生成目標目錄中的類文件。除了班級文件外,我得到了一切。我的項目結構是Projectname>src>com>...source files。我爲我的其他應用程序遵循相同的結構,我正在獲取該類文件。但不知道我失蹤的地方。即使是兩個pom.xml類似

+0

你並不需要定義的src/main /資源,因爲它是在Maven的公約。 – khmarbaise 2013-05-10 08:13:01

回答

1

Java源文件需要靠行家約定去src/main/java(不src

+0

是的,這對我有用。 – santhosh 2013-05-10 16:50:48