I have decided to try out Vaadin Touchkit for mobile application development, and am trying to get it installed and working on an example app. I have Windows 7 Pro, eclipse Luna, and maven. I'm happy to use something besides Maven, anything to make it work more easily.
The instructions say I can create a Vaadin project and then modify it to be a Vaadin Touchkit project. So I create a Vaadin project, using the Vaadin eclipse plug-in 3.0.0.
Step 1 in a list "After creating the project", says "Install the TouchKit library in the project by including it in the ivy.xml, as described in Installing as Ivy Dependency, and compile the widget set.
I think it odd that we're switching over to ivy from Maven, but ok. I go to the link indicated by the italics above, and find:
Include the following declaration inside the `dependencies` section in the `ivy.xml`.
But there is no ivy.xml file. I searched the whole directory tree. I know even less about ivy than I do Maven, so I dig around a little and find that ivy.xml is supposed to be in the WEB-INF/lib directory. But there is no such directory.
I suppose I could create an ivy.xml that contained nothing but the lines given in the instructions, but feel like trial-and-error in this kind of situation is not likely to be fruitful. Is there something else I was supposed to do to get ivy.xml in my eclipse Vaadin project? Is there some other way to get the TouchKit jar(s) on the classpath? Aren't I supposed to have a WEB-INF generated somewhere?
I presume others have gotten the TouchKit example to work in eclipse somehow -- if they can point me to a different way that does work, that'd be fine, I don't have to fix this one...
Hm, lacking of Ivy.xml is very very old bug known by vaadin team. No one knows why sometimes it wont create it.(Maybe after some n-times attempts of recreating it may fix this).
Unluckily, you have to deal with maven
Related
IntelliJ newcomer here. I'm having some issues getting my project dependencies working:
So I have a project called ClearDialogue. It's an IDE for making branching dialogue for video games. It relies on my other project, Clear (ClearVG and ClearWindows) for creating its window and also rendering the UI. ClearDialogue also depends on LWJGL3 and a few other dependencies. The projects use Maven to manage its dependencies.
Clear is a project on my machine that I've set up in IntelliJ and successfully ran its demos. ClearDialogue however is where my trouble started; it relies on Clear to work, which is another project (not a JAR thats uploaded for it to fetch). So what I'm saying is: I need to be able to use another IntelliJ project as a library in ClearDialogue.
According to other similar questions, I can achieve this by referencing the other project in the pom file of the project that's referencing it. So I did that and it actually did appear in the "External Libraries" dropdown:
.
There are a few problems:
1) Despite Clear appearing in the External Libraries section, it's still not being recognized by the IDE as a library and when I try to build the project, errors like this are printed to the console:
.
2) It seems that Clear is the only library being downloaded despite LWJGL3 and other libraries being designated as dependencies in the pom file. They aren't being downloaded and aren't appearing in the External Libraries tab. That said, Clear itself uses some of the same libraries (LWJGL3) so is it that it's just making sure they aren't duplicated? Either way, the code itself is drawing red lines because it can't find the LWJGL3 libraries.
Does anyone know ways to fix these issues? Thanks in advance.
I managed to fix both of these problems myself.
To solve the first problem of using another project as a dependency, I was able to use the maven attributes of the projects to do so. I referenced Clear in ClearDialogue's pom file like this:
.
Then I opened the Maven view (View -> Tool Windows -> Maven) and added the pom files from Clear's own modules to the list along with the needed modules within the project itself:
.
After this I pressed the "Reimport all Maven Projects" button (the button in the picture above that looks like a refresh button) and rebuilt the project (Build -> Rebuild Project). This successfully downloaded all of my needed libraries and successfully added the local libraries from my own projects only available on the machine as well. With that I was able to successfully run to program as well.
As for the second half of my problem, I was able to find this answer from another question here on Stack Overflow, which coincidentally was how I was able to figure out how to add local dependencies as well.
General Java question here / a little maven-y also. I downloaded the parent pom from a repository and did a mvn install to get all of the dependencies, but now when I am writing code, specifically in the example below, I might write something like: conn. and expect the proposals to show up, but they are not. Now say I were to a go step further (since I have it in front of me) and say conn.tableOperations(). I would expect theses proposals to show up, but like I said they are not. Here is a pic of what I am talking about if that explanation didnt suffice:
If I were to type String bla; then bla. all of the proposals would show up for that? I know it must / is related to the dependencies but I have never had this problem before. I did a bit of digging and found that maybe a maven clean install with the proper parameters would help, but I have zero clue what they would be. This is what I am referring to in this regard.
Any ideas? Thanks.
I think you are confused about Maven and Eclipse interaction.
I downloaded the parent pom from a repository and did a mvn install to
get all of the dependencies...
That is your first mistake. mvn install is not what you think it is.
You need to start by installing Maven integration in Eclipse.
This is either already available depending on which package solution
you chose, or it is available in the Eclipse marketplace.
Next you need to create a new Maven project in Eclipse.
Lastly you need to specify a dependency on the jar in the m2e
plugin. This will automatically bring in all the necessary
dependencies into your project workspace.
Note the above link has full documentation, including a Getting Started tutorial.
Alright I solved my problem. I couldn't see the proposals because the project I was trying to edit was still inside of the parent project, which wasn't considered a Java project, hence why the Java proposals weren't showing up. I drilled down into the parent project to the project I was trying to edit, right clicked and clicked "Import as project". It keeps the project still under the parent project and edits are made to both, but now the inner project is considered a Java project. Everything works as expected now.
I have setup a dynamic web project in eclipse with JSF in which I trust on code from another project (framework). Therefore, I added the framework project to the build path of the website project.
So far so good, Eclipse recognises every class and the project builds without errors.
Problem is though that when I do "run on server" to test it on tomcat 6.0.24, the application fails. I get ClassNotFoundException on every class from the framework project.
Is this a bug or is some specific configuration necessary for this?
I was googling and ended up here for a similar problem. I wanted to make a note for others about the current situation on Eclipse Indigo, as the terminology has changed a bit by the looks of things.
On your project properties, do a filter/search for "deployment assembly".
It is then straightforward to add a project dependency. Job Done.
Thanks to Alexander's edited answer which led me to this.
Did you check Warnings in Problems view?
Do you see Classpath entry /your/framework.jar will not be exported or published. Runtime ClassNotFoundExceptions may result warning?
If you do.
Right-Click the warning and choose Quick Fix.
Choose "Mark the associated entry as publish/export dependency." from Select a Fix box.
Click Finish.
EDIT
Now, I think I understand where disconnect is. I think now I remember the joy of figuring this out for the first time.
In your website project ( I will speculate here , but I guess you've created it as a Dynamic Web Project ):
Open project properties
Select Java EE Module Dependencies panel
Check your framework project in JAR/Module column. Beware, that for reasons not known to me, the list is not sorted ( and is not sortable ) in any particular order, so you may need to search for your project reference there.
The results of this operation will be written to /website-project/.settings/org.eclipse.wst.common.component file. Put this file into your source control.
I'm developing various in-house extensions for JIRA, the issue tracker we use. So far I worked with Netbeans and everything worked like a charm. However, now I need to switch to Eclipse and I'm having struggle setting up the environment for this development project.
First a clarification why I'm using the approach I'm describing here: building JIRA (in an IDE) is not easily done and I'm absolutely not interested in wasting my time to figure out how to do it. Besides, I don't need to build it, I just want to develop extensions and be able to use the IDE's auto-completion and help support (API docs). Atlassian (the company that develops JIRA) provides a "development" package, but it's just a sorry excuse rather than a real solution.
What I did with Netbeans was to create a library bundle with all relevant jar-files, the Java source files and the API documentation. This way I could use auto-completion, "jump to" the source and the API docs would pop-up when needed.
It seems Eclipse doesn't offer such a functionality, at least I couldn't figure out how to add the sources and the API docs to a "User Library" (which I'd then add as a dependency to my project just as with Netbeans).
My next approach was to create a separate project that holds all the stuff and mark that project as a dependency of my project. This works, but it leaves me with another issue: now I get 37k errors reported (all within the "dependency project"). As said, correctly setting up building for this dependency is a major struggle and not my original goal, therefore I'd happily ignore these errors. Automatic building is turned off and changing the "Errors/Warnings" settings under "Java Compiler" for the project didn't change a thing, so I'm kind of lost now.
Okay, let me try to phrase this as questions:
Maybe I just didn't find it: Is there a way to create a dependency bundle (call it whatever you want) in Eclipse that -- besides just carrying jar-files -- gives me the ability to use the API docs and "jump to" the declaration in the sources?
If not, what's the common practice to do in such a situation?
If the "dependency project" solution is the way to go, how can I completely disable compiler errors for that project?
Check this for illustration with images
Add the source code for jar
Add the Javadoc for a jar
Or just right-click on the jar file in the Package Explorer view. Select "Properties" then set the according paths in the "Java Source Attachment" and the "Javadoc Location" field.
When you create user libs via window->preferences->java-build path->user libraries you can specify which jar you need, sources (in archive or folder) && javadoc (from internet, or local, or from archive). Then you can use this lib in your project via context menu on project->Build path->add library->user library-> choose your lib.
Here you acn pick up more info Eclipse help
My organization has made an upper level decision to move to maven as the standard build tool for Java projects. I have been tasked with helping our local teams migrate projects over to maven.
One of the core tools that is in play is the MyEclipse IDE. MyEclipse seems to have had a "fun" history with the maven team as evidenced in various places, especially when dealing with war projects. I haven't encountered problems with simple jar projects...yet.
After fighting with MyEclipse and failing to make it recognize a war project easily, the question becomes, is MyEclipse worth it for developing maven war apps?
If so, is there a way to get MyEclipse to play nicely with a war project that I've not found? Or, am I simply better off suggesting its time to use Eclipse Java EE edition with m2eclipse?
No. MyEclipse does not support projects that were created outside of it. It is by design only working with projects created using its wizards.
From the Using Maven in MyEclipse Overview
NOTE: Maven is only supported for new projects. Migration of existing
projects to Maven-enabled projects is not supported at this time, but
may be considered for a later release. Right now the MyEclipse team is
focused on providing as fluid a new-Maven-project experience as
possible
I am working as a tech lead, and we recently started moving to maven. I had a couple of issues getting maven to work with myeclipse. First, even when I "Enabled all m2eclipse features" checkbox, I still couldn't check out a project as a maven project, from subversion. That option (that you get from m2eclipse) just wasn't available.
Also, some of the preferences you get with m2eclipse are not available with maven4myeclipse.
Finally, I couldn't just uninstall the maven4eclipse plugin and install m2eclipse. That would have been an acceptable workaround.
I think Genutec tried to make Maven more accesible to newbies, but there are some problems in the impementation, and I don't see them being fixed soon. For us, that will likely delegate MyEclipse to being just a fancy jsp editor.
Mike,
Sorry to hear you are fighting MyEclipse and Maven, in the past the most common problem I've seen causing people pain in this area is when they don't have the Web Root, Java source dirs or resource dirs set correctly.
Using this webpage as reference for a standard Maven2 web project layout, you can easily create a Maven-enabled MyEclipse Web Project. The steps you would want to take are as follows:
File > New > Web Project
Give your project a name, use the Java source dir of "src/main/java" and a Web Root of "src/main/webapp", check the Java EE spec level you want, check "Add Maven support" checkbox and hit Finish (unless you want to setup the artifact/group IDs).
Now, if this is the first time using Maven4MyEclipse, a lot of initialization will take place preparing your local repository and grabbing all the Java EE resources to build your project, but after that's done you should be all set.
You can execute the Maven targets off the Right-click Run As or Debug As menu and even manage custom goal execution using the "Maven build..." shortcut -- this is all similar to m2eclipse.
If you decide you want to use m2eclipse complete, you can navigate to Window > Preferences > MyEclipse > Maven4MyEclipse and check the "Enable all m2eclipse features" checkbox.
Out of the box we only hide the bits that can make Maven confusing for first-time folks, if you enable all the m2 bits, you can do whatever you want with Maven and MyEclipse. If you keep having trouble stop by our forums and let us know and we'll help out as best we can.
Mike,
think the issue is that the project has already been created outside of MyEclipse and >worked thru maven using the command line. Importing it is not successful.
I saw this post when looking for other Maven resources so I'll chime in.
Why not import your existing project using File > Import and turn on all the m2eclipse features and continue to develop it as you did before using maven commandline tools? I've done this and it works well for legacy projects, once m2eclipse features are enabled as mentioned in Riyad's #5.
Personally, I've always thought the maven war format was a bust, but we still have some old projects that use it around. Maven's format is just a default (and a poor one), not some sort of standard. However, we currently leave those old projects "as is" (using the above technique) just because it's easy. But for new work we use the MyEclipse web projects then just enable Maven support on them. The benefit is that you get all the Maven support and it's super easy to use and manage but no more commandline (although that still works too) and all the MyEclipse tools work perfectly on them as well. It's a "best of both" approach, well, at least for us. YMMV.
Hope that helps,
Dave
Mike,
Interesting, what happens when you have developers who are not using MyEclipse?
Not an issue here; I work for a very large company that has been standardized on it for quite some time (happily, I might add as we used to be a WSAD shop -- shudder.)
Anyway, if you have some that use MyEclipse and some that don't I see two options. First, if you create MyEclipse web projects and then "Add Maven capabilities" (or whatever it's called) to them, they'll work in MyEclipse and from the Maven commandline as well. So even if you're not using MyEclipse you can still use the commandline Maven tools. Also, since the MyEclipse structure is the more standard "exploded war" layout, it should work with whatever else you use as well.
Other thing to consider is that Maven's web layout is simply a default and Maven can easily support any project structure, including the one MyEclipse uses, so you should be able to use the MyEclipse project with Maven in any tool with just a little additional config. That's likely why the Maven commandline tools still work on the MyEclipse Web projects -- the MyEclipse guys just automatically configure Maven to recognize the format.
You also could just import the externally created Maven web projects as I said in my last post. We don't like to do that because that structure is unique to Maven and just doesn't work with any tools except Maven. As a result, it basically defeats the the tool support you get automatically in MyEclipse, Eclipse Java EE, or pretty much any other tool. It's just a poor default. Exploded WAR format, that's used by MyEclipse, Eclipse Java EE, WSAD, RAD, and everyone else is simply a better solution. Especially when it still works with Maven just fine as well.
Maven was made to be flexible to project structure. We've just found by using that flexibility a little you can get Maven support and great tool support too.
Dave