Add JSF-Tomahawk library to Eclipse - eclipse

I've been trying to add tomahawk library to a JSF app.
I click on project -> BuildPath -> Libraries -> Add external Jars.
But when I try to deploy there's a message that says that there's no taglib for t.
So, what's the correct way of adding a library?

The correct way of adding webapp-specific libraries is just dropping the JAR files in /WEB-INF/lib. That's all. Eclipse is smart enough to detect changes in the /WEB-INF/lib and will take appropriate actions automagically. You really don't need to fiddle with Build Path in project's properties. It would possibly make things worse. Undo all changes which you made in the Build Path.

Are the libraries also part of your web-inf/lib ?

Related

What jars are required to use the latest Mockito?

I'm using an Eclipse project and don't want to use a Maven pom. I want to drop the jars needed for Mockito into a directory and reference them from Eclipse build properties. But Mockito.org doesn't supply a download link nor mention what jars are needed to get Mockito running.
How do I determine what jars I need to download?
Mockito.org is mysteriously evasive about what Jars are needed for specific releases. They really want people using the .pom, but sometimes we don't wanna use Maven. (Developers are capricious and stubborn after all.)
Here's how to derive what jars you'll need if you're willing to read a .pom:
Go to Maven.org and type "mockito" into the search box. Look for the latest version of a "mockito*" in the "artifact ID" column. Decide which .jar "looks right." In this case I used mockito-core. Click on the "jar" link and now you've got your first jar.
But you need to get the dependencies:
Click on the link to the .pom and look at the listed dependencies. You'll see listed artifact-ids such as byte-buddy, byte-buddy-agent, and objenesis.
Using the maven.org search box, enter in the artifact-id and download the jar for each of them. Put them all together in a directory and change your build properties so you can use Mockito in your Eclipse project.
Basically you are looking for
mockito-core.jar
and on top of that, you also want:
mockito-core-sources.jar
mockito-core-javadoc.jar
It often helps to have the source code, or at least the javadoc content at your fingertips within your IDE.

Adding project dependency to web project in Eclipse

I have a Dynamic Web Project that gets deployed as a WAR that I have created in Eclipse. The project depends on 2 other small projects. I have them marked for export, and have them on the build path, but Eclipse warns me that it will not be exported, and sure enough, I get a ClassNotFoundException when I try to compile.
If need be, I can pull all the java files into a .zip file, but I don't know how to add a .zip file as a dependency. I'm sure I'm making this harder than it needs to be.
Open the web project's Properties dialog (context menu, or Project menu from the menu bar) and go to the Deployment Assembly page. This is where you tell it to also make them jars when deploying.

Another GWT module may need to be recompiled

I'll start with the other threads I've read:
GWT module may need to be (re)compiled REDUX
Some subtlety of GWT compilation - "gwt module may need to be (re)compiled."
Google App Engine - recompile GWT module
GWT Maven : Module 'xxx' may need to be (re)compiled
I have taken the following steps to fix this:
Cleared my browser cache.
Deleted gwt-unitCache folder.
Deleted *.nocache.js.
Deleted every file that was left over from a previous build. (I did this by looking at the date and time it was created.)
Run both maven clean and gwt:clean on my project.
Compile by right clicking on the project and going to Google > GWT Compile.
Run maven package.
Put the war in my JBoss EAP 6.1 (JBoss AS 7) folder.
Connect to it and still get the "GWT module may need to be recompiled" error.
What else could be causing this error to come up?
This has happened to me in the past when I imported a GWT project to a different computer. Seems you have already done some things I have tried. Before you start, right click on your project, hit Refresh, so you don't miss anything that's not in sync with the file system. There are multiple things it may be, so here's all the things I did to get it working:
Before the following steps also helps if you use the same version of GWT that was originally used to create your project. Also, make sure gwt-servlet.jar, gwt-servlet-deps.jar, validation-api-1.0.0.GA.jar, and validation-api-1.0.0.GA-sources.jar in your libs directory are the same as the ones from your GWT SDK directory (only if your app uses them).
Delete gwt-UnitCache
Open up the war directory.
Delete ALL compiled module folders.
Delete the war/WEB-INF/deploy folder.
Delete the war/WEB-INF/classes folder. It may be hidden in Eclipse, so you may have to do it via your file system.
Now, on the menus: click Project > Clean...
Make sure a build happens too. Either make "Build automatically" is selected, or use the option in the "Clean" dialog.
Do a GWT Compile. If you have more than one module, ONLY compile the main module. Any inherited modules will also be compiled.
I hope this helps. Ask if you need any clarifications.

Generalized Steps for configuring imported jsf project's libraries in eclipse

i have checked similar posts and have googled but could not find an eligible answer to this. When ever i import a jsf project from some other system (where its working fine) OR delete the tomcat server in eclipse and add new server back again...there are lots of tag libs and imports that go "unresolved". Such applications are often not created by me and i dont exactly know which libraries are to be added to configure and fix project in eclipse.
I want to ask, is there any general way to find out all the required libraries for any imported jsf project and then add them.
Thanks in advance.
Download the javax.faces.jar file and drop it in project's /WEB-INF/lib folder.
That's all.

How to get peer project source in eclipse and maven

creating a parent project with only a pom.xml, and lots of sub projects such as:
my-web
my-core
my-backoffice
etc. is easy, and the sonotype eclipse plugin does most of the work.
However, getting one project to know about the source in the other project seems to be hard. E.g. when you are debugging the my-web project, and step into my-core, eclipse doesnt know where to get the source.
Looking in the Java Build Path in eclipse, the maven plugin has added my-core as a folder under "Web App Libraries". I.e. its not using the my-core-0.0.1.SNAPSHOT.jar or similar, its using the raw java files. Great!
But how to tell maven to tell eclipse to look for the source in the same place?
Im not really sure where to start. Im guessing its possible to get maven to put the source in a special jar using the maven-soure-plugin, but this will usually be out of sync with the actual java files which the web project seems to be using directly.
A quick and dirty solution is to manually Edit the Java Build Path for each project, and add my-core and other dependant projects in the "Projects" tab. Is this best practice? Any other suggestions?
A quick and dirty solution is to
manually Edit the Java Build Path for
each project, and add my-core and
other dependant projects in the
"Projects" tab.
If this doesn't happen automatically you have a configuration problem.
My Guess would be that you have a version mismatch between the pom dependencies and the actual project versions. Or your projects have an unusual name template (m2eclipse resolves projects by their artifactId AFAIK)
Either way, what always helps is in your Debug configuration (Run > Debug Configurations ...) select the Source tab and just Add... the selected projects.