I have a webapp project under eclipse by my colleage. So it has WEB-INF/lib directory and dependcy packages are put in by my colleage.
Now I have create a pom file for the project. But import the maven project , I also need to configurate the classpath for it through project -->properties-->Java Build Path-->Libraries --> Add Library --> Web App Libraries-->... Why does it still need the classpath ???How do I fix it ? By the way , we use eclipse-jee version 3.7 SR1 like : <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-eclipse-plugin</artifactId> <version>2.8</version> <configuration> <wtpmanifest>true</wtpmanifest> <wtpapplicationxml>true</wtpapplicationxml> <projectnatures> <projectnature>org.eclipse.jdt.core.javanature</projectnature> <projectnature>org.eclipse.wst.common.modulecore.ModuleCoreNature</projectnature> <projectnature>org.eclipse.jem.workbench.JavaEMFNature</projectnature> <projectnature>org.eclipse.wst.common.project.facet.core.nature</projectnature> </projectnatures> <classpathContainers> <classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER</classpathContainer> <!-- <classpathContainer>org.eclipse.jst.j2ee.internal.web.container/artifact</classpathContainer> --> <classpathContainer>org.eclipse.jst.j2ee.internal.web.container</classpathContainer> <!-- <classpathContainer>org.eclipse.jst.j2ee.internal.module.container</classpathContainer> --> </classpathContainers> </configuration> </plugin> More details in the POM of attachment. Thanks.
<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.kingsoft.tpan</groupId> <artifactId>appsvr</artifactId> <packaging>war</packaging> <version>3.1.${BUILD_NUMBER}-RELEASE</version> <name>appsvr3.1</name> <url>http://maven.apache.org</url> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.8.1</version> <scope>test</scope> </dependency> <!--这里下面的两个dependency, servlet-api与jsp-api所需 --> <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> </dependencies> <build> <finalName>${project.artifactId}-${project.version}</finalName> <plugins> <plugin> <groupId>com.google.code.maven-replacer-plugin</groupId> <artifactId>maven-replacer-plugin</artifactId> <version>1.3.8</version> <executions> <execution> <phase>prepare-package</phase> <goals> <goal>replace</goal> </goals> </execution> </executions> <configuration> <ignoreMissingFile>true</ignoreMissingFile> <file>src/main/resources/build.version</file> <outputFile>target/classes/build.version</outputFile> <regex>false</regex> <replacements> <replacement> <token>$BUILD_NUMBER$</token> <value>${BUILD_NUMBER}</value> </replacement> <replacement> <token>$LABEL$</token> <value>${project.artifactId}-${project.version}</value> </replacement> </replacements> </configuration> </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> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.2</version> <configuration> <compilerArguments> <extdirs>${basedir}/src/main/webapp/WEB-INF/lib</extdirs> </compilerArguments> <source>1.6</source> <target>1.6</target> <encoding>UTF-8</encoding> </configuration> </plugin> <plugin> <artifactId>maven-surefire-plugin</artifactId> <version>2.9</version> <configuration> <argLine>-Xmx256m -XX:PermSize=256m -XX:MaxPermSize=256m</argLine> <skip>false</skip> <includes> <include>**/AppSvrPBApiTest.java</include> <include>**/AppSvrPBApiPartitionTest.java</include> </includes> <disableXmlReport>false</disableXmlReport> <printSummary>true</printSummary> <enableAssertions>false</enableAssertions> <useManifestOnlyJar>false</useManifestOnlyJar> <forkMode>always</forkMode> <additionalClasspathElements> <additionalClasspathElement>${basedir}/src/main/webapp/WEB-INF/lib/apache-mime4j-0.6.jar</additionalClasspathElement> <additionalClasspathElement>${basedir}/src/main/webapp/WEB-INF/lib/commons-io-1.4.jar</additionalClasspathElement> <additionalClasspathElement>${basedir}/src/main/webapp/WEB-INF/lib/httpclient-4.0.jar</additionalClasspathElement> <additionalClasspathElement>${basedir}/src/main/webapp/WEB-INF/lib/httpcore-4.0.1.jar</additionalClasspathElement> <additionalClasspathElement>${basedir}/src/main/webapp/WEB-INF/lib/httpcore-nio-4.0.1.jar</additionalClasspathElement> <additionalClasspathElement>${basedir}/src/main/webapp/WEB-INF/lib/httpmime-4.0.jar</additionalClasspathElement> <additionalClasspathElement>${basedir}/src/main/webapp/WEB-INF/lib/protobuf-java-tools.jar</additionalClasspathElement> <additionalClasspathElement>${basedir}/src/main/webapp/WEB-INF/lib/uuid-3.2.0.jar</additionalClasspathElement> <additionalClasspathElement>${basedir}/src/main/webapp/WEB-INF/lib/spring.jar</additionalClasspathElement> <additionalClasspathElement>${basedir}/src/main/webapp/WEB-INF/lib/commons-codec-1.3.jar</additionalClasspathElement> <additionalClasspathElement>${basedir}/src/main/webapp/WEB-INF/lib/log4j-1.2.16.jar</additionalClasspathElement> <additionalClasspathElement>${basedir}/src/main/webapp/WEB-INF/lib/commons-logging-1.1.1.jar</additionalClasspathElement> </additionalClasspathElements> </configuration> </plugin> <plugin> <artifactId>maven-assembly-plugin</artifactId> <configuration> <finalName>${project.artifactId}-${project.version}-classes</finalName> <!-- not append assembly id in release file name --> <appendAssemblyId>false</appendAssemblyId> <descriptors> <descriptor>src/main/assembly/zip-classes.xml</descriptor> </descriptors> </configuration> <executions> <execution> <id>make-assembly</id> <phase>package</phase> <goals> <goal>single</goal> </goals> </execution> </executions> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>build-helper-maven-plugin</artifactId> <version>1.7</version> <executions> <execution> <id>add-source</id> <phase>generate-sources</phase> <goals> <goal>add-source</goal> </goals> <configuration> <sources> <source>${basedir}/src/protobuf/java</source> </sources> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-eclipse-plugin</artifactId> <version>2.8</version> <configuration> <wtpmanifest>true</wtpmanifest> <wtpapplicationxml>true</wtpapplicationxml> <projectnatures> <projectnature>org.eclipse.jdt.core.javanature</projectnature> <projectnature>org.eclipse.wst.common.modulecore.ModuleCoreNature</projectnature> <projectnature>org.eclipse.jem.workbench.JavaEMFNature</projectnature> <projectnature>org.eclipse.wst.common.project.facet.core.nature</projectnature> </projectnatures> <classpathContainers> <classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER</classpathContainer> <!-- <classpathContainer>org.eclipse.jst.j2ee.internal.web.container/artifact</classpathContainer> --> <classpathContainer>org.eclipse.jst.j2ee.internal.web.container</classpathContainer> <!-- <classpathContainer>org.eclipse.jst.j2ee.internal.module.container</classpathContainer> --> </classpathContainers> </configuration> </plugin> </plugins> </build> </project>
--------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org