【发布时间】:2010-11-26 10:21:58
【问题描述】:
我喜欢 Maven。我什至非常非常喜欢它。 自从我从 Ant 切换到它后,我节省了大量时间,构建构建文件,管理依赖项等,并在我的源代码控制存储库中节省了大量空间。
问题是 maven 文件过于冗长。并不是说 Ant 文件不那么冗长,而是它们的详细程度适合它们的工作。
例如,而不是写作:
<dependencies>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
<dependency>
<groupId>com.myosproject</groupId>
<artifactId>superlibrary</artifactId>
<version>7.5</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
我想写一些类似
的东西<dependencies>
commons-logging/commons-logging/1.1.1
com.myosproject/superlibrary/7.5
test:junit/junit/3.8.1
</dependencies>
或代替
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
</plugins>
我想要
<build version="1.5"/>
并且(最后一个例子我们已经完成了),而不是写:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>native2ascii-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>native2ascii</goal>
</goals>
<configuration>
<encoding>UTF8</encoding>
</configuration>
</execution>
</executions>
</plugin>
我不想写什么。即,maven 会检测到 native2ascii 文件夹的存在并默认执行正确的操作。
我知道我将内置功能与插件和其他东西混合在一起,但请尝试从一个 maven 用户的角度来看,他对这个工具非常满意,但认为他可以更快乐。
所以:
有没有办法可以配置 maven 使其像这样工作? (这样做是否明智)
是否有其他我不知道的工具可以做到这一点?
【问题讨论】:
-
+ 1 表示您的问题的良好精神:)
标签: java maven-2 project-management build-process