关于 Maven 2 的几个问题

发布于 2024-07-13 16:38:44 字数 817 浏览 5 评论 0原文

我对 Maven 2 有一些疑问,我希望有人能为我解决问题:

  1. 为此创建了一个新线程(链接:Maven 2 插件,build + Surefire)

  2. 是否可以使用 diffrend 值多次定义配置文件(例如使用 diffrend 配置文件)并激活这些配置文件全部简介? 我尝试过一次,似乎只有一个配置文件被实际执行。

  3. 这个解决方案是常见的还是值得推荐的:我有几个项目,它们的 pom 中有很多东西两次(意味着项目 a 有一些报告插件和项目 b 相同),我现在创建一个新项目,它打包为pom 并在那里做我的项目共有的所有事情,并让它们继承这个父 pom。 我实际上认为这很好,因为它使我的 pom 文件更薄,但另一方面,我有一个父项目,它只是一个 pom 文件。

  4. 有人有 Maven + Selenium 的经验吗? 我尝试过 mavenium、ant task selenese 和 maven 插件来执行我的测试.. 坦白地说,他们中的每个人都给我带来了麻烦。 总而言之,蚂蚁塞勒尼斯是真正起作用的……有点。 我感觉我使用了错误的 jar 文件或者不知道我真正需要什么(我认为获得 java-client-driver 就可以了,我还需要 Seleneium-server 或 rc 吗?)

我希望我可以在一个帖子中提出 4 个问题(至少它们都是关于 Maven 2 的)。 预先感谢您的回复。

库库达斯

i have some questions about Maven 2 and i hope somebody can clear things up for me:

  1. made a new thread about that (link: Maven 2 plugin, build + surefire)

  2. Is it possible to define a profile several times with diffrend values (such as use a diffrend configruation file) and activate those profiles all? I tried that once and it seems that just one profile gets actually executed.

  3. Is this solution common or probably recommendable: I have several projects which have a lot of stuff in their pom twice(meaning project a has some reporting plugins and project b the same), i now make a new project which is packed as pom and do all things in there which my projects have common and let them inherit from this parent pom. I actually think this is good because it makes my pom files thinner but on the other hand i have a parent project which is just a pom file.

  4. Does somebody have expierince with Maven + Selenium ? I've tried mavenium, ant task selenese, and maven plugin to execute my tests .. and quiete frankly eveyone of them gave me trouble. All in all the ant selenese was the one who actually worked .. kinda. I'm feeling like i'm using the wrong jar files or don't know what i really need (i thought it would be ok to get java-client-driver, do i need seleneium-server or rc too?)

I hope it is okay that i make one thread with kinda 4 questions (at least they are all about maven 2). Thanks in advance for your response.

kukudas

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

不即不离 2024-07-20 16:38:44

请下次单独提问。

  1. 我无法回答这个问题。 我不太确定我是否理解这个问题。

  2. 不同的配置文件可以包含给定插件的不同值。 通常,如果您激活所有这些,只有其中一个会获胜。

  3. 建议仅使用 Pom 父 pom。 实际上,它们是保持理智的唯一方法。

  4. 我们在运行 selenium 方面拥有丰富的经验,但仅限于 Surefire 插件(以及 jetty 插件),因为我们所有的测试都是基于 junit 的。 它工作得非常好。

Please ask separate questions next time.

  1. I cannot answer that. I'm not really sure I understand the question.

  2. Different profiles can contain different values for a given plugin. Normally if you activate all of them, only one of them will win.

  3. Pom-only parent poms are recommended. Actually they are the only way to stay sane.

  4. We have plenty of experience with running selenium, but only thorough the surefire-plugin (and with the jetty-plugin), since all of our tests are junit based. It works really well.

空城缀染半城烟沙 2024-07-20 16:38:44

Maven 中的配置文件是附加的。 从命令行,您可以像此示例一样进行调用来激活两个配置文件:

mvn package -Pprofile1,profile2

Profiles in Maven are additive. From the command line you can make a call like this example to activate two profiles:

mvn package -Pprofile1,profile2
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文