zoukankan      html  css  js  c++  java
  • Eclipse下.project和.classpath作用(转)

    1. classpath作用

      定义项目的结构,如src、output、con、lib等。 

      源文件的具体位置(kind="src")

      运行的系统环境(kind="con")

      工程的library的具体位置信息(kind="lib")

      在每个lib的xml子节点中,有关于它的其它配置信息(例如我配置的那个"javadoc_location")

      项目的输出目录(kind="output")

      样本:

      <?xml version="1.0" encoding="UTF-8"?>
      <classpath>
       <classpathentry kind="src" output="target/classes" path="src/main/java">
        <attributes>
         <attribute name="optional" value="true"/>
         <attribute name="maven.pomderived" value="true"/>
        </attributes>
       </classpathentry>
       <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
        <attributes>
         <attribute name="maven.pomderived" value="true"/>
        </attributes>
       </classpathentry>
       <classpathentry kind="src" output="target/test-classes" path="src/test/java">
        <attributes>
         <attribute name="optional" value="true"/>
         <attribute name="maven.pomderived" value="true"/>
        </attributes>
       </classpathentry>
       <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
        <attributes>
         <attribute name="maven.pomderived" value="true"/>
        </attributes>
       </classpathentry>
       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
        <attributes>
         <attribute name="maven.pomderived" value="true"/>
        </attributes>
       </classpathentry>
       <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
        <attributes>
         <attribute name="maven.pomderived" value="true"/>
        </attributes>
       </classpathentry>
       <classpathentry kind="output" path="target/classes"/>
      </classpath>
       

    2. .project作

      工程名<name></name>

      工程注释描述<comment></comment>

      运行时需要的额外Eclipse插件<natures></natures>,及其具体加载方式信息<buildSpec></buildSpec>

      如果你在开发过程中向工程里面加入了很多额外的插件,则必然会导致你的Eclipse启动速度变慢。在这种情况下,你可以到这个文件里面去掉一些插件,不过这样一来你在开启那些关联文件的时候会加载那些插件

             样本:

    <?xml version="1.0" encoding="UTF-8"?>
    <projectDescription>
     <name>log4j-jmx-gui</name>
     <comment></comment>
     <projects>
     </projects>
     <buildSpec>

    <buildCommand>
       <name>org.eclipse.jdt.core.javabuilder</name>
       <arguments>
       </arguments>
      </buildCommand>

      <buildCommand>
       <name>org.eclipse.m2e.core.maven2Builder</name>
       <arguments>
       </arguments>
      </buildCommand>
     </buildSpec>
     <natures>
      <nature>org.eclipse.m2e.core.maven2Nature</nature>
      <nature>org.eclipse.jdt.core.javanature</nature>
     </natures>
    </projectDescription>

  • 相关阅读:
    如何成为伟大的程序员
    程序员如何增加收入
    一个阿里巴巴码农的六年回眸
    效仿盖茨:PPstream创始人的心路历程
    程序员的工作环境与效率
    软件级负载均衡器(LVS/HAProxy/Nginx)的特点简介和对比
    技术人员创业后就不再适合继续编码了
    互联网行业持续交付的经验
    11 款用于优化、分析源代码的Java工具
    常用 Java 静态代码分析工具的分析与比较
  • 原文地址:https://www.cnblogs.com/cero/p/4996900.html
Copyright © 2011-2022 走看看