Spring3最小依赖(Maven Nexus)

 Spring3已经不是新鲜玩意了,最近才拿来试试,每次构建项目都是件头疼的事情,结合maven nexus本地库相对要方便很多,只是前期工作也不少比如库的下载,上传到nexus。。。等等都是很麻烦的事,搞了我2天,才完成了spring最小依赖的例子,在这里记录下步骤(老了,忘事的很):

 

    工具:eclipse-jee(maven 插件), maven2, nexus.

 

   1.开始创建项目:mvn archetype:generate

默认选项50,1.0,group id: com.allen, arctifactid: testspring(maven2 基础东西,不知道的可以搜索下)

   2. 进入创建好的testspring ,覆盖pom.xml 为如下:

<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">
 <modelVersion>4.0.0</modelVersion>
 <groupId>com.allen</groupId>
 <artifactId>testspring</artifactId>
 <packaging>jar</packaging>
 <version>1.0-SNAPSHOT</version>
 <name>testspring</name>
 <dependencies>
  <dependency>
   <groupId>org.springframework</groupId>
   <artifactId>org.springframework.beans</artifactId>
   <version>3.0.3.RELEASE</version>
  </dependency>
  <dependency>
   <groupId>org.springframework</groupId>
   <artifactId>org.springframework.core</artifactId>
   <version>3.0.3.RELEASE</version>
  </dependency>
  <dependency>
   <groupId>org.springframework</groupId>
   <artifactId>org.springframework.context</artifactId>
   <version>3.0.3.RELEASE</version>
  </dependency>
  <dependency>
   <groupId>org.springframework</groupId>
   <artifactId>org.springframework.context.support</artifactId>
   <version>3.0.3.RELEASE</version>
  </dependency>
  <dependency>
   <groupId>org.springframework</groupId>
   <artifactId>org.springframework.asm</artifactId>
   <version>3.0.3.RELEASE</version>
  </dependency>
  <dependency>
   <groupId>org.springframework</groupId>
   <artifactId>org.springframework.expression</artifactId>
   <version>3.0.3.RELEASE</version>
  </dependency>
  <dependency>
   <groupId>commons-logging</groupId>
   <artifactId>commons-logging</artifactId>
   <version>1.1.1</version>
  </dependency>
 </dependencies>
 <build>
  <sourceDirectory>src/main/java</sourceDirectory>
  <resources>
   <resource>
    <directory>src/main/java</directory>
   </resource>
  </resources>
  <pluginManagement>
   <plugins>
    <!-- Indicate the JDK version and encoding -->
    <plugin>
     <groupId>org.apache.maven.plugins</groupId>
     <artifactId>maven-compiler-plugin</artifactId>
     <configuration>
      <source>1.6</source>
      <target>1.6</target>
      <encoding>utf-8</encoding>
     </configuration>
    </plugin>
   </plugins>
  </pluginManagement>
 </build>
</project>


 OK ,可以从dependency标签中看出spring3的最小依赖了

再运行下mvn eclipse:eclipse

好像不能添加附件,我本地nexus库已经上传了相关的依赖库,thirdparty.zip,解压到你的nexus里面就行了。。。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值