java要多思考下

          成長^_^

             ::  :: 新隨筆 ::  ::  :: 管理 ::
            33 隨筆 :: 0 文章 :: 19 評論 :: 0 Trackbacks
          1、安裝maven插件: http://download.eclipse.org/technology/m2e/releases
          2、使用import-->maven-->existing maven project導(dǎo)入已從svn上checkout下來的maven項目
          3、在本地maven庫安裝目錄中放入setting.xml,示例代碼如下:
           1 <?xml version="1.0" encoding="UTF-8"?>  
           2 <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"  
           3           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
           4           xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">  
           5   
           6   <pluginGroups/>  
           7   <proxies/>  
           8   <servers>
           9    <server>
          10           <id>web-releases</id>
          11           <username>admin</username>
          12           <password>admin123</password>
          13         </server>
          14     <server>
          15           <id>web-snapshots</id>
          16           <username>admin</username>
          17           <password>admin123</password>
          18         </server>
          19   </servers>
          20 
          21   <mirrors>
          22      
          23       <mirror>
          24           <id>mid</id>
          25           <mirrorOf>*</mirrorOf>
          26           <url>http://192.168.16.6:8081/nexus/content/groups/public/</url>
          27     </mirror>
          28   </mirrors>
          29   
          30   <profiles>  
          31     <profile>   
          32       <id>nexus</id>   
          33       <repositories>   
          34         <repository>   
          35             <id>nexus</id>   
          36             <name>local private nexus</name>   
          37             <url>http://192.168.16.6:8081/nexus/content/repositories/releases/</url>   
          38             <releases><enabled>true</enabled></releases>   
          39             <snapshots><enabled>true</enabled></snapshots>   
          40         </repository>   
          41         <repository>   
          42             <id>nexus</id>   
          43             <name>local private nexus</name>   
          44             <url>http://192.168.16.6:8081/nexus/content/repositories/snapshots/</url>   
          45             <releases><enabled>true</enabled></releases>   
          46             <snapshots><enabled>true</enabled></snapshots>   
          47         </repository>   
          48       </repositories>   
          49       <pluginRepositories>   
          50         <pluginRepository>   
          51             <id>nexus</id>   
          52             <name>local private nexus</name>   
          53             <url>http://192.168.16.6:8081/nexus/content/groups/public</url>   
          54             <releases><enabled>true</enabled></releases>   
          55             <snapshots><enabled>false</enabled></snapshots>   
          56         </pluginRepository>   
          57        </pluginRepositories>   
          58     </profile>  
          59   </profiles>  
          60   
          61   <activeProfiles>  
          62     <activeProfile>nexus</activeProfile>   
          63   </activeProfiles>  
          64   
          65 </settings> 
          4、運行maven-->update dependency將依賴插件及Jar包等相關(guān)文件down到本地Maven庫中
          5、新建一個tomcat 6.0  server,在eclipse中生成的servers工程中修改以下配置文件屬性:
          6、在catalina.properties中增加key-value配置,在應(yīng)用項目相關(guān)配置文件中就可直接通過${key}的方式獲取value
          7、修改server.xml,增加如下示例JNDI資源配置(http://tomcat.apache.org/tomcat-6.0-doc/jndi-resources-howto.html):
          1    <Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true" xmlNamespaceAware="false" xmlValidation="false">
          2 <Context path="/internal" docBase="E:/svn_working/cd/internal/trunk/target/apps-internal" debug="0" reloadable="true" crossContext="true" >
          3     <Resource name="jdbc/internalds" auth="Container" type="javax.sql.DataSource"
          4                maxActive="100" maxIdle="30" maxWait="10000"
          5                username="root" password="root" driverClassName="com.mysql.jdbc.Driver"
          6                url="jdbc:mysql://localhost:3306/customer"/>
          7 </Context>
          8、修改web.xml,增加:
          1 <description>MySQL Test App</description>
          2       <resource-ref>
          3           <description>DB Connection</description>
          4           <res-ref-name>jdbc/internalds</res-ref-name>
          5           <res-type>javax.sql.DataSource</res-type>
          6           <res-auth>Container</res-auth>
          7       </resource-ref>
          9、項目run as --> maven clean, run as--> maven build(goals:package, skip test=true)









          posted on 2011-10-25 17:28 java要多思考下 閱讀(1854) 評論(0)  編輯  收藏 所屬分類: 研發(fā)管理
          主站蜘蛛池模板: 田阳县| 定南县| 平潭县| 四平市| 康保县| 广安市| 广东省| 边坝县| 绩溪县| 丹凤县| 赤峰市| 大厂| 瑞昌市| 南郑县| 建瓯市| 咸丰县| 安多县| 德庆县| 剑河县| 南雄市| 渝北区| 舞钢市| 遵义市| 新泰市| 潜山县| 双城市| 九台市| 博乐市| 观塘区| 米易县| 宁安市| 花莲市| 宜章县| 罗源县| 曲靖市| 娄烦县| 泰安市| 潢川县| 云南省| 万山特区| 明星|