簡體   English   中英

將內容更改為 Maven 依賴項

[英]Change a content a maven dependencies

我目前正在更改 docker 映像。 docker 鏡像創建了一個允許運行一些實驗的服務器。 為了根據我的目的調整其功能,我必須更改包含在依賴項 jar 文件中的類。 在 pom.xml 文件中,此類 jar 依賴項與其依賴項一起從 nexus 存儲庫下載。 我認為可能的解決方案是在 nexus 存儲庫 (localhost) 中創建一個存儲庫,然后上傳 jar 文件及其依賴項,對嗎? 無論如何,我不知道我該怎么做。 下面是有關它的代碼。
有人可以幫我嗎?

<repositories>
    <repository>
        <id>ossrh</id>
        <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
        <releases>
            <enabled>false</enabled>
        </releases>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>org.liveontologies</groupId>
        <artifactId>pinpointing-experiments</artifactId>
        <version>${project.version}</version>       
        </dependency>
</dependencies>

<distributionManagement>
    <snapshotRepository>
        <id>ossrh</id>
        <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
</distributionManagement>

是的,你在正確的軌道上。 您要問的是Maven中的“部署”。 因此,通常要部署您的 jar,您需要:

  1. 創建您的聯系實例
  2. 將您的新存儲庫添加到您的 pom 文件中
  3. maven-deploy-plugin添加到你的 pom
  4. 更改代碼
  5. 使用mvn deploy命令部署你的 jar

兩個很好的資源,提供有關步驟的大量詳細信息以及要添加到 pom.xml 的確切內容。

https://www.baeldung.com/maven-deploy-nexus

https://maven.apache.org/guides/mini/guide-3rd-party-jars-remote.html

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM