maven运用,在eclipse中将maven本地仓库加入,创建maven项目


1、在eclipse中:

选择Windows->Preferences

第一步:点开Maven->选择Installations->add->选择maven所在的根目录-

第二步:选择UserSetting->Browse...->选择maven目录下的conf/setting.xml->Apply->ok

2、完成后,创建maven项目,基本上就可以了

3、设置javaSE:

为了减少每次都要选择javase,我们直接在maven的setting.xml里面添加:

【在profile标签的地方】

    <profile>
      <id>jdk-1.8id>

      <activation>
        <activeByDefault>trueactiveByDefault>
        <jdk>1.7jdk>
      activation>

      <properties>
            <maven.compiler.source>1.7maven.compiler.source>
            <maven.compiler.target>1.7>maven.compiler.target>
            <maven.compiler.compilerVersion>1.7maven.compiler.compilerVersion>
      properties>
    profile>