msgbartop
很傻很天真的程序员
msgbarbottom

19 七 11 Missing indirectly referenced artifact com.sun:tools:jar:1.5.0:system

當使用eclipse的maven:出现Missing indirectly referenced artifact com.sun:tools:jar:1.5.0:system 错误,是因为需要jdk的tools。

根本原因是没有指定javaw.exe的的位置,所以在eclipse.ini中用-vm指定javaw的位置就可以了~一定要在 openFile 以下加才行,在別的地方加,都會無效~

-startup
plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar
–launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.2.R36x_v20101222
-product
org.eclipse.epp.package.jee.product
–launcher.defaultAction
openFile
–launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
–launcher.XXMaxPermSize
256m
–launcher.defaultAction
openFile
-vm
C:/java/jdk1.6.0_21/bin/javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m

12 七 10 maven创建web项目,并用jetty调试

1、mvn archetype:create -DgroupId=org.david.app -DartifactId=mywebapp -DarchetypeArtifactId=maven-archetype-webapp 
2、cd mywebapp 
     mvn eclipse:eclipse 
     导入eclipse工程 
     (或者直接从eclipse中导入maven工程) 
3、添加servlet依赖 
        <dependency> 
      <groupId>javax.servlet</groupId> 
      <artifactId>servlet-api</artifactId> 
      <version>2.5</version> 
    </dependency> 
4、添加源代码目录src/main/java 
     将源代码放在该目录下。 
5、添加jetty插件 
<build> 
   <finalName>mywebapp</finalName> 
   <plugins> 
        <plugin> 
          <groupId>org.apache.maven.plugins</groupId> 
          <artifactId>maven-compiler-plugin</artifactId> 
          <configuration> 
            <source>1.5</source> 
            <target>1.5</target> 
          </configuration> 
        </plugin> 
        <plugin> 
          <groupId>org.mortbay.jetty</groupId> 
          <artifactId>maven-jetty-plugin</artifactId> 
        </plugin>       
   </plugins> 
</build> 
6、用jetty调试
命令行:mvn jetty:run

Analytics Plugin created by Web Hosting

普人特福的博客cnzz&51la for wordpress,cnzz for wordpress,51la for wordpress