我搜索并阅读了maven docs ,但没有找到答案。我是java新手,所以如果这是重复的,请原谅我。
在我们公司的项目中,我看到 pom 定义了这样的元素:
<properties>
<application.main.class>com.xxx.classfoo</application.main.class>
<exec.main.class>com.yyy.classbar</exec.main.class>
...others...
</properties>
那么问题是它们之间有什么区别?他们的名字看起来很相似!
最佳答案
引用自maven docs :
Maven properties are value placeholder, like properties in Ant. Their values are accessible anywhere within a POM by using the notation ${X}, where X is the property.
如上所述,它们只是占位符,可以使用 ${propertyName} 进行引用。
现在可能需要引用由 application.main.class
或 exec.main.class
定义的类,这就是为什么它们被定义在 proeprties 中以及任何地方要使用它们,可以使用 ${application.main.class} 或 ${exec.main.class} 引用。
关于java - maven pom : difference between application. main.class 和 exec.main.class,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53834431/