-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Profiles to groups specs (individual, full, web-profile) #327
Comments
I might be missing something but given your example, what's the difference to |
Maybe I'm just not smart enough to fully understand how Maven works, but for some reason -pl has just never worked for me. It certainly doesn't seem to work when using Eclipse. With the -pl jaspic option it just does the following and nothing more:
E.g. it builds, but never starts the tests despite using the "test" goal. I'm aware I may be doing something wrong as I'm not the biggest Maven expert in the world. The profile has the additional advantage though that we can use "web-profile" to test TomEE and "full-profile" to test the other servers. |
if you do |
Hmmm
Who would have guessed, but I'll give it a go. Thanks! |
Why's that? You're basically looking for a shortcut for |
I tried that a long time ago, but it doesn't work out of the box. For the Java EE samples project doing just that results in this:
And after
So then I need to install the parent pom, and with it all child modules? It will then start to run all tests as well, so I'd need to find the command to not run (skip) the tests. Plus that I need to monitor carefully when doing pulls if any of the dependent installed modules have changed. All of this is not really user friendly, unless there's a better way that I don't know of (as said, I'm not the biggest Maven expert), the profile option may be easier to explain as it does run out of the box. |
This takes me to another thing that was discussed some time ago, but without any conclusion: Split the projects so they can be cloned per spec. |
Indeed, that's a bit similar. I thought the profiles would be a simpler thing though. Unless the project gets overwhelmingly huge, I'm not entirely sure cloning is the real issue. I don't have the fastest Internet connection in the world and the entire repo clones relatively fast. What I think you almost always want is restrict the test run to a single module. In theory when reading the documentation it looks like Maven claims to be able to build dependent modules when giving it a module to build, but in practice it just always bails out with supposedly not able to find something that logically you'd say it should be able to build. If someone knows a better way I'm all for it, but the profiles thingie just seems like a very simple solution that actually works. Only small downside is that when specifying a profile for another server than the default you also have to specify the profile for the tests (at least, as far as I can tell). |
Is not only a matter of being faster to clone. It's because sometimes developers are only interested in a single spec and they have to mount the entire project in their IDE. Also, it allows you to branch and implements tests for new standalone versions of the specs. |
That's utterly clear. I hear this all the time.
At least in Eclipse when you clone the entire project it's just a folder initially. After that you can import all projects or just individual projects (right click on module -> import -> maven -> existing maven project). But if this is different in other IDEs I can see how this can be a problem indeed. Then only one question remains: Shall I do the PR as indicated in the beginning of this issue for the short term, while we look how to do the splitting up to individual projects? The latter may a bit more work, and I suppose we have to publish the parent dependencies in a Maven repo then? Or shall I close this issue, and wait, how long it may take, for that splitting up to happen? |
I guess we can work with the profiles for the moment, until we figure out what is the best approach to split the project. Also, I feel that we need more contributors involved to make a final decision on that particular item. |
Okay, sounds like a plan. One additional thing to do is adjusting the CI jobs then. I'm not sure how much love these get at the moment. They seem to have defaulted to GlassFish now, meaning it's not the pom.xml default profile, so the module set to test would have to be specified then. |
I'm not even sure what CI are we using atm. For some time, we were using Cloudbees, but I guess it was abandoned. |
The link on the main project page still points to Cloudbees: https://javaee-support.ci.cloudbees.com but it hasn't worked for some time. A PR kicks of a CI build using travis-ci.org, see e.g. https://travis-ci.org/javaee-samples/javaee7-samples/builds/89004029 |
Ok, we also need to make sure that this is set up properly. I don't have much experience with Travis. |
By putting modules in a profile we can easily run the samples per spec, for the full profile or the web profile.
E.g.
After this you can do e.g.
mvn -Pwildfly-managed-arquillian,jaspic test
or
mvn -Pwildfly-managed-arquillian,jpa test
etc
I can do a PR for this.
The text was updated successfully, but these errors were encountered: