Can someone name me one mini framework in Java that will allow me to build a REST API? The thing is that all need maven installation or Gradle or something similar, but I need something that will "play" with a very simpler installation like installing just a jar or something similar.
Maven and Gradle are project management tools .Developers use them mostly to manage dependencies , but there is no any hard rule saying you must use it compulsory.So if you don't want to use them , you can neglect them ,but then as you asked you need to add all those JAR files externally by searching them through the internet or mostly in maven central repository.Best option would be spring boot application but if you don't like to use maven then I suggest you to go with Spring framework ,but then you should add all those JAR files manually.As an alternative JAX-RS + Jersy will also be fine .
Related
Currently, I have a few custom maven plugins which use the same libraries (JARs) as my application which uses it.
It is pertinent to mention that the libraries are also custom libraries developed by us and not 3rd party.
I want to let go of these libraries and integrate all of them directly inside my application source code - just have one problem - what do I do with
the maven plugins which use them.
Is there a way I can use the application source code (after integrating the libraries) while compiling / running the maven plugins?
Personally I wouldn't go on this path because of dependency hell etc, but if you really need to you could create a jar containing the source files (see https://maven.apache.org/plugin-developers/cookbook/attach-source-javadoc-artifacts.html) and then in the project you need to source unpack it like this https://maven.apache.org/plugins/maven-dependency-plugin/examples/using-dependencies-sources.html.
ps: what is the reason to drop the libraries and instead use the source code?
Today, i donwloaded Spring Framework 4.0.6 latest version but unable to locate the jar files, and i donwloaded eclipse plugin for spring too, here i find nothing and looking for a way to include these jar files into eclipse, here is a pic.
Some tutorials website refers that it contains into lib folder but i can't see it, please help!
It sounds like you have a number of hurdles to overcome:
How to use Eclipse
How to manage Java dependencies
How to use Spring
I'm not sure what your level of experience is, but you may wish to consider using Spring Tool Suite as your IDE - it's based on Eclipse with additonal plugins to aid Spring development.
I also urge you to use Maven or Gradle to manage your dependencies. The Spring documentation provides the configuration for adding the dependencies in both. I'd recommend Maven as a starting point as it is easy to use with little knowledge and is well suited to small, standard projects. Gradle is worth a look once you are comfortable with Maven.
Work though the Guides - I'd start with 'Building Java Projects with Maven'.
Edit
Maven is a dependency management and build tool that favours convention over configuration. Dependency management is powerful in that you can declare a dependency on Spring Core, for example, and it will download all the related dependencies for you.
Gradle performs similar functions to Maven but also provides the ability to use scripting. Gradle is seen by many as Maven's predecessor and has been adopted by Spring over Maven.
In my opinion Maven is easier for you at this stage.
I have been trying to start a simple Spring project as a part of my study. From the tutorials (they are about a year old resources i am refering), it seems the Spring related libraries were easily available online then. But now; I was unable to get something like a "spring_ver_no.zip" from the spring source site. It is having options to download a tool suite which is about 350 MBs large.
Can you please guide me if that download is the way to setup a Spring development environment?If not what is the way to set up a simple Spring environment in eclipse.
Thanks
Angie
You should use a dependency management tool like Gradle or Maven, and let this tool download the libraries for you. See the quick start for how to include Spring in your dependencies. If you still want to download the jar files and add them manually to your project, then download them directly from the Maven central repository: http://search.maven.org/#search|ga|1|g%3A%22org.springframework%22
Spring is, for a long time, splitted in several modules. You have to download all the modules you need.
Spring is using Maven lately. You should use it too. Maven is a build tool and dependency manager that will ease your life.
When you use the Google-Eclipse plugin to create a new Web Application Project, and you select the option to "Add support for listing on Google Apps Marketplace", the plugin automatically adds an apps-marketplace.jar file on your classpath.
Does this - at any point in time, for any reason - ever need to be bundled with your WAR? I ask because it contains a bundled version of SLF4J that is causing JAR hell issues with other dependencies that use a different version of SLF4J.
I bundled it into my WAR because I thought it was necessary, but if its something that is just used by the plugin, or is perhaps available as some service to GAE apps when they're running in production, then I don't need it and would like to remove it as a dependency. Thanks in advance.
This jar is not needed. You can remove it from your build path and your WAR directory. We need to fix the plugin so that it gets rid of this jar.
I have a feeling it was first added in to make it easy to access certain Google APIs from your Marketplace app. It included a bunch of classes for handling OAuth. However, I think that all of the classes in here are basically deprecated, and there are better ways to make these Api calls now.
Where can I find the jar file or the source code of JEE6? Or is there another way how you can get autocompletion for this in Netbeans/Eclipse?
And I have just installed glassfish so that i can use JAX-RS but i do not understand how it works. Why does the javacompiler find these classes but netbeans does not? I building with maven2 but have not set any paths or so.
And why am I not able to install JEE6 without glassfish? I just do not need an application server for a REST service with Jersey.
Best regards,
CQQL
Question #1:
See this example project.
The example project is built with maven, which may answer your question about auto-complete. Netbeans 6.8+ (approx) has built-in maven support. After the first build of the example project, I think you'll see that auto-complete works better for any dependencies (i.e. jersey) inside the pom.xml. In my Netbeans, auto-complete works, but the javadocs are not there, which may mean that Jersey wasn't bundled with them.
Question #2: Your maven on the command line and the one inside Netbeans are different copies. You can make Netbeans use a specific copy of maven in Tools/Options/Misc/Maven/External Maven Home. This may clear up some confusion.
Question #3: Jersey can run in Tomcat or Jetty if you find Glassfish to be too much app server for your needs.