??xml version="1.0" encoding="utf-8" standalone="yes"?>国家队第一季免费高清在线观看,欧美高清成人,色天堂在线视频http://www.aygfsteel.com/kongji2008/category/40742.htmlandy.kong的空?/description>zh-cnThu, 08 Apr 2010 15:28:18 GMTThu, 08 Apr 2010 15:28:18 GMT60maven仓库理器Nexushttp://www.aygfsteel.com/kongji2008/archive/2010/04/07/317634.htmlandy.kongandy.kongWed, 07 Apr 2010 05:57:00 GMThttp://www.aygfsteel.com/kongji2008/archive/2010/04/07/317634.htmlhttp://www.aygfsteel.com/kongji2008/comments/317634.htmlhttp://www.aygfsteel.com/kongji2008/archive/2010/04/07/317634.html#Feedback0http://www.aygfsteel.com/kongji2008/comments/commentRss/317634.htmlhttp://www.aygfsteel.com/kongji2008/services/trackbacks/317634.html

讉Khttp://nexus.sonatype.org/downloads/下蝲Nexus?br /> 启动NexusQ就是启动一个web服务器,它的默认地址是localhost:8081。Nexus在一个名为Jetty的servlet容器中运行, 它用一个名为Tanuki Java Service Wrapper的本地服务包裹器启动。这个服务包裹器可以被配|成以Windows服务或Unix守护U程的Ş式运行Nexus。要启动NexusQ你需 要ؓ你的q_扑ֈ合适的启动脚本。要查看可用q_的列表,查看${NEXUS_HOME}/bin/jsw目录的内宏V可执行文g?nexus安装? ?"nexus-webapp-1.0.0"binjsw"windows-x86-32 下:InstallNexus.bat/UninstallNexus.bat是安?卸蝲nexus为windows service。Nexus.bat是直接在命o行中启动NexusQ如果不惛_装Nexus为windows serviceQ可以用q个文g来手工控制Nexus的启动退出?/p>

1.配置nexus
首先dQ默认地址http://localhost:8081/nexus/Q默认用户名密码为admin/admin123.
nexus默认是关闭远E烦引下载功能的。开启的方式Q?
点击Administration菜单下面的RepositoriesQ将q三个仓库Apache SnapshotsQCodehaus SnapshotsQMaven Central?
Download Remote Indexes修改为true。然后在q三个仓库上分别右键Q选择Re-indexQ这样Nexus׃M载远E的索引文g?/p>

2.理仓库
以管理员用户登陆然后点击左边D菜单Administration下面的Repositories。Nexus提供了三U不同的仓库?
(1)代理仓库
一个代理仓库是对远E仓库的一个代理。默认情况下QNexus自带了如下配|的代理仓库Q?
Apache Snapshots
q个仓库包含了来自于Apache软g基金会的快照版本?a >http://people.apache.org/repo/m2-snapshot-repository
Codehaus Snapshots
q个仓库包含了来自于Codehaus的快照版本?http://snapshots.repository.codehaus.org/
Central Maven Repository
q是中央Maven仓库Q发布版本)?http://repo1.maven.org/maven2/
(2)宿主仓库
一个宿M库是由Nexus托管的仓库。Maven自带了如下配|的宿主仓库?
3rd Party
q个宿主仓库应该用来存储在公共Maven仓库中找不到的第三方依赖。这U依赖的样例有:你组l用的Q商业的Q私有的cd如Oracle JDBC驱动?
Releases
q个宿主仓库是你l织公布内部发布版本的地斏V?
Snapshots
q个宿主仓库是你l织发布内部快照版本的地斏V?
(3)虚拟仓库
一个虚拟仓库作为Maven 1的适配器存在。Nexus自带了一个central-m1虚拟仓库

3. 理l?
l是Nexus一个强大的Ҏ,它允怽在一个单独的URL中组合多个仓库。Nexus自带了两个组Qpublic和public-snapshots? publicl中l合了三个宿M库:3rd Party, Releases, 和SnapshotsQ还有中央Maven仓库。而public-snapshotsl中l合了Apache Snapshots和Codehaus Snapshots仓库?/p>

4. 配置maven
要让maven使用Nexus作ؓ仓库Q要修改~/.m2/settings.xml.
Xml代码
<profiles>
   <profile>
     <id>nexus</id>
     <repositories>
       <repository>
           <id>nexus</id>
           <name>local private nexus</name>
           <url>http://localhost:8081/nexus/content/groups/public</url>
       </repository>
     </repositories>
   </profile>
   <profile>
     <id>nexus-snapshots</id>
     <repositories>
       <repository>
           <id>nexus-snapshots</id>
           <name>local private nexus snapshots</name>
           <url>http://localhost:8081/nexus/content/groups/public-snapshots</url>
       </repository>
     </repositories>
   </profile>
</profiles>

<activeProfiles>
    <activeProfile>nexus</activeProfile>
    <activeProfile>nexus-snapshots</activeProfile>
</activeProfiles>

5.部v构g至Nexus
要部|构件至NexusQ在distributionManagement中提供仓库URLQ然后运行mvn deploy。Maven会通过一个简单的HTTP PUT项目POM和构件推入至你的Nexus安装。需要配|你目POM中distributionManagement部分的repository?
Xml代码
<distributionManagement>
<repository>
    <id>releases</id>
    <name>Internal Releases</name>
    <url>http://localhost:8081/nexus/content/repositories/releases</url>
</repository>
<snapshotRepository>
    <id>Snapshots</id>
    <name>Internal Snapshots</name>
    <url>http://localhost:8081/nexus/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>

q样q没完,q时如果部v会报错,q要在~/.m2/settings.xml中添加如下的服务器登录信息:
Xml代码
<servers>
<server>
    <id>releases</id>
    <username>admin</username>
    <password>admin123</password>
</server>
<server>
    <id>Snapshots</id>
    <username>admin</username>
    <password>admin123</password>
</server>
</servers>

部vW三ҎӞ
构g可能是私有数据库的JDBC驱动如OracleQ或者你依赖于另一个JARQ它既不开源也无法免费获得。在q样的情况下Q你需要手动拿来这些构件然后发布到你自q仓库中。Nexus提供宿主?third-party"仓库Q就是ؓ了这个目的?br /> 使用以下命o发布该文件至NexusQ?
Java代码
mvn deploy:deploy-file -DgroupId=com.oracle -DartifactId=ojdbc14 -Dversion=10.2.0.3.0 -Dpackaging=jar -Dfile=ojdbc.jar -Durl=http://localhost:8081/nexus/content/repositories/thirdparty -DrepositoryId=thirdparty

6.Nexus监听端口
默认情况下,Nexus监听端口8081。你可以更改q个端口Q通过更改${NEXUS_HOME}/conf/plexus.properties的|为此Q停止NexusQ更Ҏ件中applicationPort的|然后重启Nexus?br />
7.Maven Profiles
Maven中的profile是一l可选的配置Q可以用来设|或者覆盖配|默认倹{有了profileQ你可以ؓ不同的环境定制构建。profile? 以在pom.xml中配|,q给定一个id。然后你可以在q行Maven的时候用的命o行标记告诉Mavenq行特定profile中的目标。以? pom.xml使用production profile覆盖了默认的Compiler插g讄?
Xml代码
<profiles>
   <profile>
     <id>production</id>
     <build>
       <plugins>
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-compiler-plugin</artifactId>
           <configuration>
             <debug>false</debug>
             <optimize>true</optimize>
           </configuration>
         </plugin>
       </plugins>
     </build>
   </profile>
</profiles>
要用production profile来运行mvn installQ你需要在命o行传?Pproduction参数。要验证production profile覆盖了默认的Compiler插g配置Q可以像q样以开启调试输?-X) 的方式运行Maven?/p>

如果你开始大量用Maven profileQ你会希望将profile从POM中分,使用一个单独的文g如profiles.xml。你可以混合使用定义在pom.xml中和外部 profiles.xml文g中的profile。只需要将profiles元素攑ֈ${basedir}目录下的profiles.xml文g中,然后 照常q行Maven可以。profiles.xml文g的大概内容如下:
Xml代码
<profiles>
    <profile>
      <id>development</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
              <debug>true</debug>
              <optimize>false</optimize>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>production</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
              <debug>false</debug>
              <optimize>true</optimize>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
</profiles>

settings profile可以应用到所有你使用Maven构徏的项目。你可以在两个地方定义settings profileQ定义在~/.m2/settings.xml中的用户特定settings profileQ或者定义在${M2_HOME}/conf/settings.xml中的全局settings profile?/p>

andy.kong 2010-04-07 13:57 发表评论
]]>
maven setting.xmlhttp://www.aygfsteel.com/kongji2008/archive/2009/07/13/286595.htmlandy.kongandy.kongMon, 13 Jul 2009 09:00:00 GMThttp://www.aygfsteel.com/kongji2008/archive/2009/07/13/286595.htmlhttp://www.aygfsteel.com/kongji2008/comments/286595.htmlhttp://www.aygfsteel.com/kongji2008/archive/2009/07/13/286595.html#Feedback0http://www.aygfsteel.com/kongji2008/comments/commentRss/286595.htmlhttp://www.aygfsteel.com/kongji2008/services/trackbacks/286595.html<settings 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/xsd/settings-1.0.0.xsd"
>
  
<localRepository</localRepository>
  
<offline>false</offline>
 
</settings>
localRepository

该DC构建系l本C库的路径?/p>

offline

如果构徏pȝ需要在ȝ模式下运行,则ؓtrueQ默认ؓfalse。当׃|络讄原因或者安全因素,构徏服务器不能连接远E仓库的时候,该配|就十分有用?/p>



andy.kong 2009-07-13 17:00 发表评论
]]>
maven profilehttp://www.aygfsteel.com/kongji2008/archive/2009/07/13/286276.htmlandy.kongandy.kongMon, 13 Jul 2009 05:15:00 GMThttp://www.aygfsteel.com/kongji2008/archive/2009/07/13/286276.htmlhttp://www.aygfsteel.com/kongji2008/comments/286276.htmlhttp://www.aygfsteel.com/kongji2008/archive/2009/07/13/286276.html#Feedback2http://www.aygfsteel.com/kongji2008/comments/commentRss/286276.htmlhttp://www.aygfsteel.com/kongji2008/services/trackbacks/286276.html1、执行:mvn -P[profile_id]
2、激zactivation

<project>
  
  
<profiles>
    
<profile>
      
<id>dev</id>
      
<activation>
        
<activeByDefault>false</activeByDefault>
        
<jdk>1.5</jdk>
        
<os>
          
<name>Windows XP</name>
          
<family>Windows</family>
          
<arch>x86</arch>
          
<version>5.1.2600</version>
        
</os>
        
<property>
          
<name>mavenVersion</name>
          
<value>2.0.5</value>
        
</property>
        
<file>
          
<exists>file2.properties</exists>
          
<missing>file1.properties</missing>
        
</file>
      
</activation>
      
    
</profile>
  
</profiles>
</project>

3.当用属性激zȝ时?br />
<profiles>
        
<profile>
            
<id>test</id>
            
<activation>
                
<property>
                    
<name>test.bingo</name>
                    
<value>kkk</value>
                
</property>
            
</activation>
</profile>
</profiles>

可以在命令行中mvn -Dtest.bingo=kkk或者mvn -Ptestq两U方式激z该profile对pom讄的进行覆盖?br />
4.当用变量替换的时?br />
<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">
    
    
<build>
        
<resources>
            
<resource>
              
<directory>src/main/filter-resources</directory>
              
<filtering>true</filtering>
            
</resource>
        
</resources>

    
</build>
    
<profiles>
        
<profile>
            
<id>test</id>
            
<activation>
                
<property>
                    
<name>test.bingo</name>
                    
<value>kkk</value>
                
</property>
            
</activation>
            
<properties>
                
<env.dir>222</env.dir>
            
</properties>
            
<build>
                        
</profile>
    
</profiles>
</project>

qo指定的目录下文gQ如果该文g中有${env.dir}的变量,׃?22l覆盖掉?

andy.kong 2009-07-13 13:15 发表评论
]]>
覆盖默认的源码和输出目录http://www.aygfsteel.com/kongji2008/archive/2009/07/10/286271.htmlandy.kongandy.kongFri, 10 Jul 2009 07:50:00 GMThttp://www.aygfsteel.com/kongji2008/archive/2009/07/10/286271.htmlhttp://www.aygfsteel.com/kongji2008/comments/286271.htmlhttp://www.aygfsteel.com/kongji2008/archive/2009/07/10/286271.html#Feedback0http://www.aygfsteel.com/kongji2008/comments/commentRss/286271.htmlhttp://www.aygfsteel.com/kongji2008/services/trackbacks/286271.html<build>
<sourceDirectory>
${basedir}/src/main/java
</sourceDirectory>
<outputDirectory>
${basedir}/WebRoot/WEB-INF/classes
</outputDirectory>
</build>
在myeclipse web目中会l常用到

andy.kong 2009-07-10 15:50 发表评论
]]>
maven的超UPOMhttp://www.aygfsteel.com/kongji2008/archive/2009/07/10/286266.htmlandy.kongandy.kongFri, 10 Jul 2009 07:39:00 GMThttp://www.aygfsteel.com/kongji2008/archive/2009/07/10/286266.htmlhttp://www.aygfsteel.com/kongji2008/comments/286266.htmlhttp://www.aygfsteel.com/kongji2008/archive/2009/07/10/286266.html#Feedback0http://www.aygfsteel.com/kongji2008/comments/commentRss/286266.htmlhttp://www.aygfsteel.com/kongji2008/services/trackbacks/286266.html阅读全文

andy.kong 2009-07-10 15:39 发表评论
]]>
վ֩ģ壺 | | Ǹ| | ɽ| | | | | ˮ| | | | | β| ɽ| | | | | | ʯ| | | ɼ| | | ɽ| ³ƶ| | | | | Ӽ| | ۶| | | | ɶ| |