1

我想在我的 .m2 存储库中替换一个 Jar。我的存储库中有旧版本的 Jar。我想将其更新为较新的。

目前我jtidy-4aug2000r7-dev.jarC:\.m2\repository\jtidy\jtidy\4aug2000r7-dev.

我想将其更新为 jtidy-r938。我的本地文件夹中有这个 jar。

有人可以告诉我该怎么做。

4

6 回答 6

4

Since it's on central, the easiest way is to declare it as a dependency to your project and run mvn dependency:get.

<dependency>
    <groupId>net.sf.jtidy</groupId>
    <artifactId>jtidy</artifactId>
    <version>r938</version>
</dependency>

This will put the r398 version in (another) subdirectory beside the 4aug2000r7-dev version.

To manually install an artifact refer to this answer.

Cheers,

于 2013-01-31T12:26:06.240 回答
2

If you have the updated jar locally, you use the following command

mvn install:install-file  -Dfile=path-to-your-artifact-jar \
                          -DgroupId=your.groupId \
                          -DartifactId=your-artifactId \
                          -Dversion=version \
                          -Dpackaging=jar \
                          -DlocalRepositoryPath=path-to-specific-local-repo

which install your updated jar file locally.

于 2013-01-31T12:27:21.800 回答
1

update your pom.xml

purticularly the one similar to this

<dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>**4.0**</version>
      <type>jar</type>
      <scope>test</scope>
      <optional>true</optional>
    </dependency>

update Version as per your need

于 2013-01-31T12:27:06.637 回答
1

更新 pom.xml 中依赖标记中的版本。它将自动从中央 maven repo 下载新​​版本。

于 2013-01-31T12:50:10.127 回答
0
  • Update your dependancies in the POM file
  • Delete the folder
  • Run a maven command that depends on the Jar and it will automatically fetch it
于 2013-01-31T12:26:21.667 回答
0

Delete it, update the version-number in your pom.xml and update your dependencies. If the version is not available in the maven repository, build your own artifact with the specified version use it for your purpose.

于 2013-01-31T12:26:54.233 回答