Sql Sever 2008 jar Maven pom.xml dependency
2012-12-01 00:22
253 查看
When I add sqlserver04.jar into my maven project, it's a little bit different others. For other jars, I directly add dependency into pom.xml. For sqlserver.jar, the dependency works on others' projects, but not mine. It always give me an error about missing
artifact. Here is my solution:
1) download latest jar
Microsoft download center. I download *.exe file.
2) Run the exe file and unzip it.
3) Open a command prompt and switch into the directory whre the jar file is located
4) Execute the comand
5) When you see Build Success, You can find the jar in your maven repository. Mine is located here:
C:\Users\****\.m2\repository\com\microsoft\sqlserver\sqljdbc4\4.0
6) Now you're ready to add the dependency to pom.xml
artifact. Here is my solution:
1) download latest jar
Microsoft download center. I download *.exe file.
2) Run the exe file and unzip it.
3) Open a command prompt and switch into the directory whre the jar file is located
4) Execute the comand
mvn install:install-file -Dfile=sqljdbc4.jar -Dpackaging=jar -DgroupId=com.microsoft.sqlserver -DartifactId=sqljdbc4 -Dversion=4.0
5) When you see Build Success, You can find the jar in your maven repository. Mine is located here:
C:\Users\****\.m2\repository\com\microsoft\sqlserver\sqljdbc4\4.0
6) Now you're ready to add the dependency to pom.xml
<dependency> <groupId>com.microsoft.sqlserver</groupId> <artifactId>sqljdbc4</artifactId> <version>4.0</version> </dependency>
相关文章推荐
- maven项目找不到pom.xml配置的dependency jar中的类问题解决方法
- 在maven的pom.xml中添加<dependency>直接可以下载jar包吗
- 通过Jar包生成Maven POM.xml的dependency
- 通过Jar包生成Maven POM.xml的dependency
- Maven项目pom.xml中添加依赖,但是jar无法引入项目
- Spring3.x中各个jar包的作用总结 Maven pom.xml
- 常规项目用到的jar包之maven的pom.xml
- Maven pom.xml报错Multiple annotations found at this line: - Missing artifact log4j:log4j:jar:1.2.15:co
- 根据已有项目下lib包里jar文件生成maven的pom.xml 里面所有依赖
- maven之 web项目改造-根据jar包 生成pom.xml
- maven的pom.xml出错 已经下载完了jar包
- Maven pom.xml 报 Missing artifact jdk.tools:jdk.tools:jar:1.7
- Maven的pom.xml中的dependency部分写法
- 【Java】SVN下载maven项目到eclipse之后,项目红叉,pom.xml出现Missing artifact fakepath:dubbo:jar:2.8.5等缺少jar包情况
- maven打一个完整的内容整洁的jar包的pom.xml
- 使用assembly将maven项目pom.xml中的jar包打包
- maven加载本地lib下的jar包(pom.xml)
- maven pom.xml配置本地jar包
- maven项目中自动下载jar包的pom.xml配置
- maven项目中自动下载jar包的pom.xml配置