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

Introduce parent project for maven building #179

Closed
bethard opened this issue Apr 14, 2015 · 14 comments
Closed

Introduce parent project for maven building #179

bethard opened this issue Apr 14, 2015 · 14 comments
Labels
🐛 Bug Something isn't working Priority-Medium

Comments

@bethard
Copy link
Contributor

bethard commented Apr 14, 2015

Original issue 181 created by ClearTK on 2011-01-05T18:13:00.000Z:

One thing that is going to get annoying very quickly about the current arrangement is that building all of the projects requires some effort. It sure would be nice if we had a parent pom.xml file that we could run to compile, test, and possibly install all of the projects. I think uimaFIT does a nice job with this and we can model our approach on that. Any thoughts?

@bethard
Copy link
Contributor Author

bethard commented Apr 14, 2015

Comment #1 originally posted by ClearTK on 2011-01-05T19:19:38.000Z:

It would also be nice if this pom file could generate a single set of javadocs.

@bethard
Copy link
Contributor Author

bethard commented Apr 14, 2015

Comment #2 originally posted by ClearTK on 2011-01-05T21:27:30.000Z:

The fix for Issue 179 added a parent pom.xml so as to make it easier to update our UIMA and UimaFIT versions all at once. In theory, that should now work in the same way that UimaFIT's does. In practice, the fact that everything depends on SNAPSHOT versions means that you can still only work from Eclipse, and I can't figure out, e.g. how to run all the tests at once from Eclipse.

@bethard
Copy link
Contributor Author

bethard commented Apr 14, 2015

Comment #3 originally posted by ClearTK on 2011-01-05T22:02:59.000Z:

I'm not exactly sure what to do with the parent pom file. I had already checked out trunk as a plain non-java eclipse project. So, presumably I can just update that project and the pom file will show up and then run it from the command line. You don't actually have a java project in eclipse at the trunk level do you? Now that I think about it I have a non-java project in eclipse for uimafit-parent and that seems pretty straightforward. In fact, (as I ramble on) I realize now that the pom.xml file in uimaFIT just sits under trunk (not a uimafit-parent subdirectory.) Ok - you don't have to respond to this - I think I get it.

@bethard
Copy link
Contributor Author

bethard commented Apr 14, 2015

Comment #4 originally posted by ClearTK on 2011-01-05T22:39:14.000Z:

Yeah, you can just go into the root 'cleartk' directory and run, e.g. "mvn clean" and it will clean all the individual projects. "mvn compile" will fail though unless you "mvn install" all the various SNAPSHOT versions.

@bethard
Copy link
Contributor Author

bethard commented Apr 14, 2015

Comment #5 originally posted by ClearTK on 2011-01-07T21:03:17.000Z:

I decided to checkout the cleartk project into a clean workspace so that I can update the "developer setup" wiki. I have no idea how I was getting the various projects to compile before. Probably, because I hadn't actually updated since before r2232.

So, I tried to first compile at the top level and this exploded as expected. Next, I tried to compile cleartk-test-util which complained that it couldn't find junit. This is because the dependency for junit is scoped with "test" in the parent pom. So, I added junit as a dependency directly to the cleartk-test-util/pom.xml file and now I can compile and install it. Next, I tried to compile and install cleartk-util. It gives the following complaint:

Cannot find parent: org.cleartk:cleartk-jcasgen for project: org.cleartk:cleartk-test-util:jar:0.6-SNAPSHOT for project org.cleartk:cleartk-test-util:jar:0.6-SNAPSHOT

I'm not sure what this means - but thought it might mean that I should install cleartk-jcasgen. So, I tried that but that was not the right answer because this just exploded.

What do I do next?

@bethard
Copy link
Contributor Author

bethard commented Apr 14, 2015

Comment #6 originally posted by ClearTK on 2011-01-07T21:05:43.000Z:

So, oddly, I am able to get all the code to compile in the tests to run within eclipse. Still hung up on getting this done from the command line.

@bethard
Copy link
Contributor Author

bethard commented Apr 14, 2015

Comment #7 originally posted by ClearTK on 2011-01-07T23:22:06.000Z:

How did installing cleartk-jcasgen explode?

@bethard
Copy link
Contributor Author

bethard commented Apr 14, 2015

Comment #8 originally posted by ClearTK on 2011-01-08T00:02:32.000Z:

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Unnamed - org.cleartk:cleartk-jcasgen:pom:0.0.1-SNAPSHOT
[INFO] task-segment: [install]
[INFO] ------------------------------------------------------------------------
[INFO] Preparing exec:java
[WARNING] Removing: java from forked lifecycle, to prevent recursive invocation.
[INFO] No goals needed for project - skipping
[INFO] [exec:java {execution: default}]
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] An exception occured while executing the Java class. null

C:\workspace-ClearTK\cleartk\cleartk-jcasgen\src\main\resources\null (The system cannot find the path specified)
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8 seconds
[INFO] Finished at: Fri Jan 07 17:00:57 MST 2011
[INFO] Final Memory: 29M/146M
[INFO] ------------------------------------------------------------------------

@bethard
Copy link
Contributor Author

bethard commented Apr 14, 2015

Comment #9 originally posted by ClearTK on 2011-01-08T00:17:52.000Z:

Hmm... Yeah, it's trying to run the build phase of jcasgen, while jcasgen is never meant to be built, only used as a parent. I guess we need to figure out how to say "only run this phase in the modules, not in the parent".

@bethard
Copy link
Contributor Author

bethard commented Apr 14, 2015

Comment #10 originally posted by ClearTK on 2011-01-08T15:25:49.000Z:

Ok, this should be fixed now, and "mvn install" from the cleartk main directory should install everything. The only error I'm getting now is an encoding problem TreebankFormatParser.java that I'm not sure how to fix (it kind of looks like you're reading in some UTF-8 file as latin1 so that you get an extra character before a plus-or-minus character, and then making TreebankFormatParser.java strip off that extra byte).

@bethard
Copy link
Contributor Author

bethard commented Apr 14, 2015

Comment #11 originally posted by ClearTK on 2011-01-09T05:30:26.000Z:

I agree that TreebankFormatParser looks it's doing something stupid. When I remove the offending line, the tests still pass - so I went ahead and removed it. This will force me to read in whatever file prompted this silly fix with the correct encoding if I ever run into this again. That said, I don't understand why the compiler is complaining now. That file has been like this for quite a while.

Btw - please don't close this issue until the developer setup wiki is updated. I am happy to do this but don't have time just now.

@bethard
Copy link
Contributor Author

bethard commented Apr 14, 2015

Comment #12 originally posted by ClearTK on 2011-01-09T18:27:49.000Z:

Yeah, both DeveloperSetup and CreatingARelease need to be updated. Some thoughts:

  • If you want to compile, install, release, etc. all of the modules, run it from the top level directory.
  • If you want to compile, install, release, etc. a single module, run it from that module's directory

For releasing, I'm guessing we'll want to do a first one-time release from the top level. That will release the top level pom and our current versions of all the sub-modules. After this first time, most releases should just be done for the individual sub-modules from their individual directories. The only time we'd want to do another top-level release would be if we update the top-level pom, which should be pretty rare. (Probably it would only happen if we add extra sub-modules or change the sub-module directory names.)

@bethard
Copy link
Contributor Author

bethard commented Apr 14, 2015

Comment #13 originally posted by ClearTK on 2011-01-11T23:56:44.000Z:

I have updated DeveloperSetup and I think it should be good to go. I think it is a bit awkward to fix up CreatingARelease before actually doing so. So, I just marked the page as out-of-date and added your bullet items as a comment.

Since updating all of the out-of-date documention is an actual issue (see # 121) I am happy to close this issue before that page gets updated.

Thanks for helping out with the pom.xml file. Everything seems to be working fine for me now.

@bethard
Copy link
Contributor Author

bethard commented Apr 14, 2015

Comment #14 originally posted by ClearTK on 2011-01-12T02:49:42.000Z:

Thanks for updating DeveloperSetup. Turns out that for SNAPSHOT versions, you don't actually need to run "mvn install" anywhere, you can just run "mvn compile package" from the top level. If you accidentally just run "mvn compile" you'll get an error like:

[INFO] Failed to resolve artifact.

Missing:

  1. org.cleartk:cleartk-token:test-jar:tests:0.0.1-SNAPSHOT

This is a known bug in maven:

http://jira.codehaus.org/browse/MNG-3559

But basically the workaround is simple - run "package" and then maven will find that "test-jar".

The only problem you should run into is that the cleartk-timeml module fails a test because it can't find

file:/Users/bethard/Projects/cleartk/cleartk-syntax-opennlp/target/cleartk-syntax-opennlp-0.0.1-SNAPSHOT.jar!/models/OpenNLP.Sentence.English.bin.gz

The only fix for this is to upgrade OpenNLP so that we can use InputStreams instead of Files.

@bethard bethard closed this as completed Apr 14, 2015
@reckart reckart added the 🐛 Bug Something isn't working label Nov 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working Priority-Medium
Projects
None yet
Development

No branches or pull requests

2 participants