Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

maven版本是如何定义的 #5071

Closed
pengbiaobeyond opened this issue Jan 8, 2024 · 6 comments
Closed

maven版本是如何定义的 #5071

pengbiaobeyond opened this issue Jan 8, 2024 · 6 comments
Labels

Comments

@pengbiaobeyond
Copy link

我发现有些依赖是没有定义版本的,是怎样拉取到固定版本的
image

Copy link

dosubot bot commented Jan 8, 2024

🤖

你好,@pengbiaobeyond!我叫Dosu, 是一款能够帮助你解决问题,回答问题,甚至成为贡献者的机器人。在等待人类维护者的时候,我在这里为您服务。希望我们能愉快的合作!

在Maven中,版本是在依赖的<version>标签内定义的。版本可以是固定的版本号,例如<version>1.4.20</version>,或者可以是变量,例如<version>${project.version}</version>

在您提供的上下文中,依赖的版本以两种方式定义:

  1. 使用固定的版本号:这是依赖的特定版本。例如,com.google.injectguice工件的<version>5.0.1</version>

  2. 使用变量:这是版本号的占位符,它在pom.xml文件或属性文件的其他地方定义。例如,com.ctrip.framework.apolloapollo-common工件的<version>${project.version}</version>

如果依赖项没有定义版本,Maven将尝试使用在<repositories>标签中定义的仓库中可用的最新版本。然而,通常建议始终为依赖项指定版本,以确保构建的一致性。

在您提供的上下文中,<repositories>标签包含了apollo-coreapollo-openapi的快照版本的仓库。如果这些依赖项没有定义版本,Maven将从这个仓库中拉取最新的快照版本。

关于Apollo仓库的版本管理,我没有在仓库中找到答案,但答案可能在其他地方,或者我可能错过了。如果您需要更多信息,欢迎提供更多的上下文。

参考源码:

Sources


This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

@pengbiaobeyond
Copy link
Author

但是我一直拉到的都是1.29版本的包,仓库中已经有2.2版本的包了

@nobodyiam
Copy link
Member

org.springframework.boot:spring-boot-dependencies 中定义的

@pengbiaobeyond
Copy link
Author

谢谢

Copy link

stale bot commented Feb 9, 2024

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days unless it is tagged "help wanted" or other activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Feb 9, 2024
Copy link

stale bot commented Feb 16, 2024

This issue has been automatically closed because it has not had activity in the last 7 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted". Thank you for your contributions.

@stale stale bot closed this as completed Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants