Skip to content
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

Add pom.xml to build with maven. #23

Closed
wants to merge 6 commits into from
Closed

Add pom.xml to build with maven. #23

wants to merge 6 commits into from

Conversation

nitay
Copy link
Contributor

@nitay nitay commented Oct 26, 2013

Build the project with maven using just the "mvn" command. This has a whole bunch of things built in e.g. running findbugs, pmd, a license checker, executing the tests, building jar for code, sources, and javadoc. You can also easily put in things like code coverage. Also it can generate a pretty nice html website with reports for everything that is run.

Maven is a really a powerful tool, I highly recommend it. The initial learning curve is steep but once you get used to it you'll never want to go back to ant.

I think we should move anything else you need out of the build.xml, and get rid of altogether. I'll leave it to you to decide when it's best to do that. For example I noticed there are some executable tasks in there, we could make simple bash scripts for that.

As I already mentioned we should fix up the ProjectSearcher as right now the code won't really work as a library. Are there other things that are path dependent? We should probably replace them with proper resources usage.

Also another thing I noticed: The tests should really be separated from the main code. With maven you normally make a separate directory for tests, and then can run them with "mvn test". Note just running "mvn" will also run them as it does the full build. Furthermore it's rather weird that we use JUnit in non-test code.

I've actually already used a tweak of this to deploy the jar to maven central under my group name:
http://search.maven.org/#artifactdetails%7Ccom.nitayjoffe.thirdparty.org.ggp%7Cggp-base%7C0.1%7Cjar. The tweaked pom.xml is here: https://github.com/nitay/ggp-base/blob/dev/pom.xml. As you can see I just replaced org.ggp with com.nitayjoffe.thirdparty.org.gpp. Also this jar looks for classes under ~/code/ggp-base/bin (see https://github.com/nitay/ggp-base/blob/dev/src/org/ggp/base/util/configuration/ProjectConfiguration.java).

@nitay nitay mentioned this pull request Oct 26, 2013
@nitay
Copy link
Contributor Author

nitay commented Nov 11, 2013

Any thoughts on this @samschreiber? I have another one coming that makes all the image files be resources in the built jar which can then be easily loaded with resource methods. This will remove the rest of the ProjectConfiguration stuff. That diff is much easier to do with maven instead of ant though so let me know your thoughts on this.

@AlexLandau
Copy link
Member

Since this was posted, we've moved to Gradle as a build system, which fulfills many of the needs here and provides an easy path forward for others. There's some planning in issue #91 for making it easier to use GGP-Base (or portions thereof) as a library.

@AlexLandau AlexLandau closed this Dec 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants