在多个开发人员之间使用Trunk / Branches和Tag结构(Using Trunk / Branches and Tag structure between multiple developers)
当涉及到Trunk / Branches和Tags时,我最终会感到困惑。 以下是我的查询:
我们有一个开发团队在一个项目上工作。 开发人员通常分组,他们在同一个项目上处理各种模块。
目前,我们有一个简单的SVN系统(没有任何Trunk / Branches或Tags),每个人都在同一个本地服务器上工作并提交文件。 但问题出现的时候,有几个开发人员在研究未来的模块(不应该立即上线)。 在这种情况下,他们无法提交数据,因为如果他们这样做,他们的开发代码将上传到实时服务器上,最终会弄乱一切。
所以,现在我正在寻找某种解决方案,这些开发人员可以单独工作但是使用相同的代码。 像这样的东西:
开发人员A正在开发新模块A开发人员B正在开发新模块B开发人员C正在开发模块C的漏洞修复(已经在线,但很少有错误需要修复)
因此,开发人员A将在此计算机上拥有自己的副本,并将提交到Developer A的存储库。 (或分支)
同样的逻辑适用于开发人员B,但开发人员C将处理一个常见的稳定副本,该副本将位于标签中,一旦工作完成,它将被标记并推送到主干服务器上传的主干。
一旦开发人员A完成了工作,他就会将所有文件推送到Trunk进行实时上传。 (这也应该合并trunk中的一些常见文件)。 同样的逻辑适用于Developer B.
我不确定SVN是否适合这个解决方案。 我甚至不知道是否有更简单的方法来实现我想要的东西。
欢迎提出任何建议。
谢谢TTR
I end up getting confused when it comes to Trunk / Branches and Tags. Following is my query:
We have a team of developers working on a single project. The developers are often divided in groups and they work on various modules on the same project.
Currently, we have a simple SVN system (without any Trunk / Branches or Tags) where everyone works on the same local server and commits the files. But the problem starts when, a couple of developers work on future modules (which are not supposed to go live immediately). In this situation, they cannot commit the data because if they do, their development code will be uploaded on the live server and it will end up messing up everything.
So, now I am looking for some kind of solution where, these developers can work separately but on the same code. Something like this:
Developer A is working on New Module A Developer B is working on New Module B Developer C is working on Bug Fixes of Module C (which is already on live but few bugs needs to be fixed)
So, Developer A will have it's own copy on this machine and will commit to Developer A's repository. (Or Branch)
The same logic applies to Developer B but Developer C will be working on a common stable copy which will be somewhere in Tags and once the work is done, it will be tagged and pushed to the Trunk for the upload on live server.
Once Developer A is done with the work, he will push all his files to Trunk for live upload. (This should merge some common files in trunk too). Same logic applies to Developer B.
I am not sure if SVN will be the right solution for this or not. I don't even know if there is any simpler way to implement what I want.
Any kind of suggestions are welcome.
Thanks TTR
原文:https://stackoverflow.com/questions/4584379
最满意答案
将文件放在
src/test/resources
某个位置,比如src/test/resources/xmlfiles
; 这将导致Maven自动将这些镜像到target/test-classes
。 然后你可以按照James Lorenzen的描述消费它们:URL path = this.getClass().getResource("/xmlfiles"); File xmlfileDir = new File(url.getFile()); for (File f : xmlfileDir.listFiles(new ...Filter())) { .... }
不需要POM更改。
Place the files somewhere in
src/test/resources
, saysrc/test/resources/xmlfiles
; this will cause Maven to automatically mirror these intotarget/test-classes
. Then you can consume them as described by James Lorenzen:URL path = this.getClass().getResource("/xmlfiles"); File xmlfileDir = new File(url.getFile()); for (File f : xmlfileDir.listFiles(new ...Filter())) { .... }
No POM changes should be necessary.
相关问答
更多-
TestNG已经生成了这些文件,请查看test-output/junitreports 。 TestNG already generates these files, look under test-output/junitreports.
-
编辑 - 通过评论解决:在您的屏幕截图中, test.iml位于您的测试文件夹中。 是否有排除或其他什么? 你能尝试删除那个文件吗? 您可以尝试在IntelliJ File | Invalidate Cache (通过File | Invalidate Cache )。 您还可以在IDE中尝试重建项目(通过Build | Rebuild Project )。 您还可以尝试通过Maven 同步项目 (重新导入所有Maven项目)(右侧某处应该有Maven Tab,或者通过键入Maven Projects进入C ...
-
在IntelliJ Idea中启动一个简单的JUnit / Maven项目(Starting a simple JUnit / Maven project in IntelliJ Idea)[2022-11-08]
创建Maven项目的方式是从控制台生成 - >导入到IDE。 为此,您可以使用maven-archetype-quickstart原型。 只需执行以下命令: mvn archetype:generate -DgroupId = {com.mycompany.app} -DartifactId = {my-app-name} -DarchetypeArtifactId = maven-archetype-quickstart -DinteractiveMode = false 您必须用您的数据替换{...}参 ... -
将trimStackTrace设置为false(适用于Surefire和Failsafe)
org.apache.maven.plugins maven-surefire-plugin 2.18.1 false < ... -
如何确保在使用maven失败的jUnit测试后进行清理?(How to ensure cleanup after failed jUnit tests using maven?)[2023-12-03]
目前, failsafe:verify绑定到integration-test阶段:run-nonautowired-tests integration-test integration-test verify ... -
参数化的junit测试(parametrized junit tests)[2022-10-27]
看一下这个: @RunWith(org.junit.runners.Parameterized.class) public class Test { private final TestParameters parameters; public static class TestParameters { int parameter1; String parameter2; } @Parameters public static C ... -
将文件放在src/test/resources某个位置,比如src/test/resources/xmlfiles ; 这将导致Maven自动将这些镜像到target/test-classes 。 然后你可以按照James Lorenzen的描述消费它们: URL path = this.getClass().getResource("/xmlfiles"); File xmlfileDir = new File(url.getFile()); for (File f : xmlfileDir.listFi ...
-
我在哪里放置属性文件以在Maven上运行JUnit测试?(Where do I put properties files for running JUnit tests on Maven?)[2022-03-02]
如果我使用getClass().getResourceAsStream("/my.properties")我有用。 如果没有/前缀,则路径相对于类的包,因此您必须将属性文件放在src/test/resources/com/mycompany/mypackage/my.properties 。 It works for me if I use getClass().getResourceAsStream("/my.properties"). Without the / prefix, the path is ... -
一个常见的模式(例如Spring Roo应用程序使用的)是将配置文件放在src\main\resources\META-INF\spring\ 然后,您可以通过相同的表达式classpath:META-INF\spring\application-context.xml加载它们classpath:META-INF\spring\application-context.xml在测试和应用程序中。 A common pattern (for example used by Spring Roo applicat ...
-
您可以为此创建和使用JUnitTestSuite。 @RunWith(Suite.class) @SuiteClasses({Test1.class, Test2.class }) public class YourTestSuite { } 测试套件按照@SuiteClasses注释中提及的顺序运行测试用例。 如果您想通过maven目标(如maven测试目标)按顺序运行测试用例,则可以使用此测试套件。 只需排除测试用例并通过下面给出的插件配置包含测试用例。
...