hallucynogenyc (1) [Avatar] Offline
#1
I was trying to follow the very first example on the book (SimpleProcessTest), and spent 8 hours trying to figure out what was happening. If I used maven from the shell I would get a lot of unresolved imports on Eclipse and if I used the eclipse plugin, when trying to run the test I would get a ClassNotFoundException.

The Appendix A states that Maven 2.X or 3.X are supported and that if using the plugin, it will give some errors but that you should just use the Eclipse quick fix.

Well, about the quick fix, to me Eclipse only gave me a quick fix suggestion for 1 of the multiple errors the project had after the "convert to maven...". I have still been unable to use the plugin, however I could finally make it work with the command line maven. Here's what was happening.

When I first installed maven (via apt-get on Ubuntu), I was offered two options: Maven and Maven2. I installed Maven2 thinking Maven was Maven version 1 and that Maven 3 was maybe still not included on the repository. Anyways, version 2 was supposed to work according to Appendix A. Well, it seems it doesn't, after hours of struggling I tried to uninstall Maven2 and install Maven, which to my surprise happens to be Maven 3 and voila, all works.

Hope this helps someone smilie
tijs.rademakers (494) [Avatar] Offline
#2
Re: Nightmare with Maven 2
Alfresco recently changed to a HTTPS Maven repository instead of a HTTP repository and Maven 3 handles HTTPS better it seems. One question, did you use the latest code available in the Google code project?

Best regards,

Tijs
Cologne4711 (1) [Avatar] Offline
#3
Re: Nightmare with Maven 2
Maven support is only delivered by the JAVA Edition of ECLIPSE- Indigo, but the Installation instruction of Activiti only needs the Classic Edition.
And now a Update from Maven 2 to Maven 3 is needed and what's next?

Why don't you deliver working examples ?
Best regards.
tijs.rademakers (494) [Avatar] Offline
#4
Re: Nightmare with Maven 2
I'm sorry, but I don't understand your comment. I've tried to make the installation of the examples as easy as possible and Maven is a part of that. If you install an Eclipse distribution without m2eclipse, it's very easy to add it via the install new software wizard in Eclipse. If you have suggestions about how to deliver the examples in another way let me know. With a question like "Why don't you deliver working examples" I can't do a lot.

Best regards,

Tijs
lspellman (4) [Avatar] Offline
#5
Re: Nightmare with Maven 2
I've been experiencing much of the same issues. I've been through 2 installations of Eclipse to try and get EXACTLY the right environment. I'm running on a Mac, and the command line mvn is consistently failing to pull all jar files down. Update dependencies from Eclipse or command line fails to resolve problems.

While I understand that over time, updates happen, and what worked when the book was written, may fail to work today. But your book is going to be totally worthless to me and others if we can't get off the ground without days of frustration trying to figure out where the problems are. And I'm a 10 yr Java developer...just never got on the Maven track.

I suggest, at a minimum, that you take a look at the bpmn-examples sourcecode and try to post a more complete, and updated set of instructions for what works TODAY. Fighting through both Activiti and Maven unfamiliarity to just get to step 1 is a huge burden to adoption/follow through.

BTW: if not for demo.bat working from the actual Activiti site download, I'd probably already be gone. Thank God for that.

UPDATE: Specific issue (changes with each attempt) that I'm seeing right now is (from Eclipse): Archive for required library: '/Users/lancespellman/.m2/repository/com/h2database/h2/1.2.132/h2-1.2.132.jar' in project 'bpmn-examples' cannot be read or is not a valid ZIP file.

Looking in my .m2 repository, there is a path to the .jar file, but it's a bad file, "invalid zip file" when you jar -tf it.

Previously, I'd had issues with commons-mail doing the same thing. Eventually after blowing everything up and starting over, that one's now okay, but h2's now a problem. I assume there are probably others that are missing as well.

Message was edited by:
lspellman
lspellman (4) [Avatar] Offline
#6
Re: Nightmare with Maven 2
Environment: Mac OSX 10.6.8
Java: 1.6.0_33
Maven: 3.0.3 (command line on mac)
Eclipse: Indigo classic edition
Eclipse Maven: Embedded (3.0.2/1.0.200.20111228-1245)
User settings: /Users/lancespellman/.m2/settings.xml
Local Repository: /Users/lancespellman/.m2/repository
tijs.rademakers (494) [Avatar] Offline
#7
Re: Nightmare with Maven 2
The intention of the examples is that they should be very easy to setup. Nothing has changed from the moment I wrote the book and now, I even updated the source code in the Google code repository last week.
Where did you get the source code of the book? Did you get it from the Google code repository? Alfresco has changed their Maven repository URL recently, so it's important to have the most up-to-date source code from the Google code repository.
If a Maven download goes wrong for some reason, a JAR file can be corrupt. This can be solved by deleting the invalid JAR from the Maven repository.

Best regards,

Tijs
lspellman (4) [Avatar] Offline
#8
Re: Nightmare with Maven 2
Thanks for the feedback Tijs,

I'm going to wipe everything: repository, Eclipse, source code and start over. Originally I pulled the code from google code repository. Looking at it this morning, it says it was uploaded May 31st, so it doesn't look like your update from last week is showing there.
tijs.rademakers (494) [Avatar] Offline
#9
Re: Nightmare with Maven 2
Okay let me know if you keep getting issues.
Here you can see the list of changes:

http://code.google.com/p/activitiinaction/source/list

Best regards,

Tijs
lspellman (4) [Avatar] Offline
#10
Re: Nightmare with Maven 2
Resolved issue: new source code not necessary, although nice to know its there. The key error was that I'd been generating the maven repository from the mac command line PRIOR to creating the project in Eclipse. Once I deleted the repository and removed the eclipse files (i.e. start fresh), I started in Eclipse and did a File | Import | Maven | Existing Maven Projects and navigated to the BPMN Examples directory. It created the project structure and built out the Maven repository without errors.

Your description on page 12 is adequate:

When you import the bpmn-examples project (used in this chapter), the Activiti libraries have to be added to the Java build path. The book’s source code uses Maven to retrieve all the necessary dependencies. The sample project’s code structure is explained in detail in chapter 4 and appendix A. But, starting from Eclipse Indigo (version 3.7.x), there’s good built-in Maven support, so it’s easy to get it working. Acti- vate the Maven project capabilities by choosing the Configure–Convert to Maven Proj- ect option in the project menu when you right-click on the bpmn-examples project in Eclipse. Eclipse will download all the necessary dependencies and configure the class- path for you.

Before the sentence starting, "Activate the Maven project capabilities...." I would have put the instructions for importing the Maven project, as its not clear how the bpmn-examples project gets into your workspace in the first place. With the approach I took, the next steps you describe became unnecessary.

Thanks for the assistance! At this time I've read most of the book and had played around with the demo installation and am quite pleased with everything I've seen. My only frustration was in not being able to follow along with the book with code.
nrnickolov (1) [Avatar] Offline
#11
Re: Nightmare with Maven 2
Following along with the book I experienced similar problems with Maven as described above using Eclipse Juno on OS X 10.7.5. Tons of errors and when I ran the ant build for Chapter 5, the build would be successful, but the resulting jar file would be empty.

Finally I was able to solve most of the issues by installing Maven 3.0.4. I followed the installation instructions for Unix-based systems on http://maven.apache.org/download.html. Then I configured Eclipse to use the new Maven install - Preferences / Maven / Installations / Add... and pointed it to the directory where Maven 3.0.4 is installed.

Deleted the project in Eclipse and imported it again using the Import / Maven / Existing Maven Projects wizard. I get some warnings now, but no more errors and the jar file seems to work.

Hope this post could save someone some time.

Nick