-
Notifications
You must be signed in to change notification settings - Fork 105
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
rearrange project to build with maven #2
Conversation
This is great! I also suggest:
|
Hi @ruckc ! Thank you for your contribution, I've not worked with maven before so please give me a bit to download maven and make sure everything works out. I will get back to you shortly, please bare with me. :D |
Maven and support for it is actually built into all latest versions of Eclipse |
Hi @eugener so it is possible I can keep my existing jar descriptions and support both? Just let me make sure it still builds alright. Can someone clarify the reason for the inclusion of the Google checkstyle guidelines? I use the XML formatter imported in Eclipse I am not sure if this is a duplicate of that or something else I hadn't considered. |
Yes... it will support both. The reason for maven and other tools is that not everyone is using Eclipse. In fact most people don't. You also need to be able to build your project from command line for CI purposes Alternatively, in ControlsFX, we use Gradle, which is already configured. |
Alright that sounds reasonable. I am actually interested in working to get a future more complete and integrated version into ControlsFX so perhaps going with Gradle would be better. Would that satisfy this pull request owner's needs? |
Either Maven or Gradle will do, but PR sender did the work configuring project with Maven |
Alright i understand I've pulled locally and it seems fine the layout is similar to Gradle's, while I have used neither Gradle nor Maven I've been reading up on both. It's failing to import in Eclipse right now. If I can fix the Eclipse project and get it working I'll push it into master with the fixed Eclipse project. |
Re-import as Maven project, which will auto-modify your Eclipse configuration |
@eugener Alright that is one step closer, will I need to update the import statements? It's failing to build right now because he did not update the import statements or I am unsure if I've simply imported the project wrong. |
Maven is just a build tool. Change your code as much as you need. |
I didn't update the eclipse project files. I didn't want to break those further. |
It is ok ruckc, I am willing to go with this just please excuse me for not having used Java CL tools before. It is building after updating the package name in all the sources however I am getting an exception. Image dockImage = new Image(DockFX.class.getResource("docknode.png").toExternalForm()); This in the demo.DockFX where I load the test graphic. This is erroring because it's in a resources package separate from this class. What is the appropriate way to load this file now? |
The way Maven plugin in Eclipse works is it keeps your Eclipse project configuration in sync with your Maven one. This makes a lot of sense and allows you to work in Eclipse using maven project. Usually IDE specific files are not committed into source repositories. |
I moved the graphics and css into src/main/resources. Maven/Gradle convention has them in separate paths, but merged in the final jar. |
Yes.. should work exactly the same way because it is brought into the same location during the build |
Hrm, I must be missing something in the pom.xml I see org.dockfx which I think indicates that nothing should be changed. @ruckc Do you think it is possible you could fix the Eclipse project? I generally use command lines only for C++ and I would switch to one for Java but I only touch Eclipse because of the awesome code refactoring. |
There is no need for jardesc files anymore - your |
Oh excellent that was as I had assumed. I've configured the environment variables and Maven seems to be working. After that command I have the following:
However I believe this is configured to build the library? I'm not sure where the demo has outputted to and am unable to find it. I really appreciate your guidance. |
I'm sure it is part of your jar. You can run it by specifying the main class. |
@eugener Alright from the following link I think I know how to get it. Is it reasonable to use a separate pom.xml file for my demo? Such as pom-demo.xml? I am not looking to specify a main class for the library. |
Not really. Just describe the main class + manifest in your |
Check out this link http://www.vogella.com/tutorials/EclipseMaven/article.html |
Great that link fixed everything! For now I guess we'll just always use the demo as the main class, so I made the demo run without the presence of the readme.html which is optional. Later it can be configured through a profile to set the main class and copy the readme.html to the target/ folder. Thank you for all of your help! |
I'm not an Eclipse user, so I rearrange the project for Maven. I also incorporated the Google Java checkstyle guidelines.