在IDE中运行java springboot项目和使用maven clean package有什么区别?



我是Java Springboot的新手,我已经对它进行了一段时间的修补(实现缓存)。

我正在尝试重新创建**

样品/coherence-spring-demo coherence-spring-demo-boot项目

**在以下Github repo https://github.com/coherence-community/coherence-spring按照https://spring.coherence.community/3.1.0/refdocs/reference/htmlsingle/index.html#coherence-spring-documentation

中的说明我一直在VS Code与STS扩展工作,当我点击运行,应用程序运行良好。但是当我使用

创建它时

mvnw clean package

我得到以下错误:

[ERROR] Failed to execute goal on project coherence-spring-demo-boot:无法解析项目的依赖关系com.oracle.coherence.spring: coherence-spring-demo-boot: jar: 3.3.0-SNAPSHOT:com.oracle.coherence.spring: coherence-spring-demo-core: jar: 3.3.0-SNAPSHOT没有被发现https://oss.sonatype.org/content/repositories/snapshots期间以前的尝试。此故障缓存在本地存储库中,并且的更新间隔之前不会重新尝试解析snapshot -repo已过期或强制更新->[帮助1][错误]要查看错误的完整堆栈跟踪,请使用-e开关。[ERROR]使用-X开关重新运行Maven以启用full调试日志记录。[ERROR] [ERROR]有关错误的详细信息和可能的解决方案,请阅读以下文章:[错误][帮助1]http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

我已经检查了pom.xml文件,并且已经添加了依赖项,并且还检查了nexus存储库以找到相同的包。

如果它可以在运行应用程序时解决依赖项,为什么它不能在试图构建它时找到依赖项?

你还能告诉我运行作为spring-boot应用程序和在springboot中构建包之间的区别吗?和

作为Spring-boot应用程序运行→启动嵌入式Tomcat服务器(或ThymeLeaf或Jetty)以及spring启动应用程序(启动IOC容器,初始化bean,内部依赖项等)

mvn clean package

  1. mvn→Maven命令

  2. 清洁→Maven目标,它清理(removes)类、资源和工件,作为Target文件夹的一部分可用

  3. 包→Mavenphase,它打包您的应用程序(In JAR or WAR无论POM中指定的哪个),并将工件放入本地存储库

Maven是一个构建工具i.e.,它提供了一个项目应该是什么样子或组织的基本结构。例如,哪个文件留在哪里,存放外部资源,依赖项等

然而,Spring-boot是Spring框架的一个模块,可以简单地作为Java应用程序运行

在这里阅读更多关于mvn的信息

https://www.journaldev.com/33659/maven-build-lifecycle-phases-goals: ~:文本= Maven % 20球% 20代表% 20 % 20特定目标% 20通过% 20 % 20命令% 20行。amp;文本= % 20是% 20一个% 20例% 20,目标从% 20 % % 20 20命令% 20行。

这里的Spring boot功能和技术

https://spring.io/projects/spring-boot

最新更新