eclipse - What's the fastest way to get all build errors in a Java project? -


currently i'm looking @ integrating build processes source control (git hooks specifically). i'm trying write pre-commit hook checks build errors in java project (a medium-large test development project) , fails allow commits contain errors in build. turning out rather challenging.

the approach here uses command-line eclipse tool build , output warnings , errors. technically work, it's slow , may cause problems eclipse ide (i've had heap allocation errors). i've looked @ solutions using ant these approaches don't seem simple one-line solution, , may still slow.

my main question: what's fastest (run-time compilation speed) way build , validate java project, command line? i'd solution returns 0 no errors , else if errors present, i'm willing @ other things.

let's start basics:

  • pre-commit hooks run on server , not client. there no working directory default. have make sure javac available, , correct version.
  • your pre-commit hook freeze up user's terminal until completion.

now, how long take checkout fresh copy of java project, run ant, wait compile, , process output of compile? minute or two? 20 seconds? 10 seconds? 10 seconds feel forever wait git push complete. and, if other users want commit code, have wait.

a better, , easier approach use continuous build server jenkins. jenkins easy setup. (it comes own application server built in) , has hundreds of plugins can use report health of project. if compile cannot happen, jenkins email culprit , whomever else mention.

we have our jenkins setup ant builds, maven builds, , use either git or subversion our repository (depending upon project). jenkins builds project, keeps console log, , fail build if build.xml fails. @ our place, means start pestering developer fix problem or undo changes. @ last workplace, developers given 10 minutes fix build, or undo changes.

not can jenkins let know when build fails, has plugins can report on java compiler warnings, javadoc warnings, run findbugs, pmd, find duplicate lines of code (via cpd comes pmd), , report in series of graphs. can mark builds unstable (build completes, problematic) or fail build based upon number of issues found these tools.

jenkins can run unit tests, , again graph results, run coverage analysis jacoco or cobertura or emma.

so, take @ jenkins. it's easy setup , want , more.


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -