How to add swagger-input to my spring boot application - java

I used to work in a company where we use this swagger-input file and this is where we declare all the endpoints and all of the class files will be automatically generated once we built our maven project.
I always wanted to know how to set this up by myself and I haven't figured it out even if my task was to create a new microservice. We always used a custom archetype when generating maven projects and I assumed that is where it was all setup(ed?).
I've been searching for tutorials on how to do this but it would really be of great help if someone could point me in the right direction for this. Thank you for your time.

Related

Build Very Simple Minimalist Java Plugin Container

I'm working on an app where I'm in need of building a very small and minimal plugin container.
Below are the things I'm trying to achieve.
Application is divided into smaller plugins packaged as Jars.
Plugin container should get them and load all jars.
Each plugin should not interfere with other plugins and should run on it's own along with it's dependant libraries. Basically all plugins should be isolated at runtime.
I tried using OSGI container, but it adds high complexity. Also many of the third party libraries which are not compatible with OSGI creating problem which is taking lot of time to debug. Also checked out Spring Boot, JPF etc. and not very interested. So thought of using very small homegrown plugin framework.
I have no clue on how to do and where to start. Please anyone can point me in right direction where I can get detailed information on this.
Thank you in advance.
If you truely want something minimalistic, have a look at Java's ServiceLoader class.
Here's a tutorial.

OIOSAML Maven integration

I came across the project(OIOSAML, based on OpenSAML) and thought it was great and very easy to try out with the demo and implement in a simple war-project. Within a few minutes i was set up to access my ADFS.
However when going over to my current project(that uses GWT & builds with Maven) i found it difficult to add all the dependencies. I found no repository or any good way to add all the libraries. Maven keeps trying to look for xescer:xml-apis:1.4.01 (which isn't included in the OIOSAML lib/ folder) so my question is: Does anyone have expereince setting up OIOSAML with Maven? Could you please lend a hand?
TL;DR
Can't get OIOSAML.java working wtih Maven, need help.
If you want payment for your time maybe we can arrange that. Contact me here on the forums or via email and we cant take it from there or by phone.
Kind regards,
Oscar
After manually adding every dependency to our Sonatype Nexus and creating a new maven war project, it finally worked. It doesn't work with our main project though as dependencies are clashing.
I guess sometimes it's good to re-invent the wheel to be able to reduce the amount of dependencies clashing. Especially for something like this which could be used in and kind of project.

How can you programatically create projects and build types in TeamCity?

I have been studying the TeamCity OpenAPI and I'm trying to figure out if it's possible to create new projects and build types programatically. As far as I understand, it's not exactly possible via the REST API.
Could somebody explain how this works and if it at all can be done? Any examples or pointers to existing plugins which already do this, would be highly appreciated
Actually you can create projects and build configurations with help of TeamCity REST API, see: http://confluence.jetbrains.com/display/TW/REST+API+Plugin#RESTAPIPlugin-ProjectSettings
But if you prefer using Open API, then you need to obtain jetbrains.buildServer.serverSide.ProjectManager spring bean and use it like this:
ProjectManager pm;
SProject p = pm.createProject("my project name"):
SBuildType bt = p.createBuildType("my build type name");
and so on.

How to find Spring XML definition from Java Class in Eclipse

I work on a large Spring/Struts project in Eclipse. One thing I have to do frequently is dig through the spring.xml file so that I can update the definition for the class that I am working on. It seems like there should be an easy 2 or 3 click way to go from the Java class I am in to the Spring definition.
I have SpringSource installed, but this doesn't seem to offer anything that's actually useful to me. Does anyone know if this is possible in Eclipse and how to do it?
Bonus Question: is it possible to jump from a Struts Action class to it's corresponding struts.xml definition in Eclipse?
in your eclipse project, just add the spring nature. Right click the project and select the Spring Tools option -> Add Spring Nature. This will ensure eclipse keeps your java classes and spring context in synch.

How to organize projects?

I've been working with Visual Studio for a long long time, but now I'm been requested to work on a Java web project. We've decide to use Spring MVC as framework, and we want to use Log4J (for logging obviously =P) and JUnit for unit testing. Now, in the "Microsoft way" I will create a Solution, and I'll add A web project and a Unit testing project; now that I'm usign Netbeans, is it possible to do like that? Or how should I organize my projects?
Thanks for sharing your experience!
Have you thought about using Maven as a way to manage your project? I've heard really good things about it.
You can find a list of what Maven is, exactly, here.
In short, it has the following goals (I took these from the web site):
Making the build process easy
Providing a uniform build system
Providing quality project information
Providing guidelines for best practices development
Allowing transparent migration to new features
Try to use maven, and there is a standard way for a project :)
In Netbeans you specify what type of project you want to create, say Java Web Application. Netbeans will then create the files and folders to support that project. Within the project view explorer, you can see the 'Test Packages' node, this is where you add java classes to support your unit testing. When you add a unit test, Netbeans will add a reference to the correct JUnit library to your project (you can see this on project properties > libraries > compile test).
For Spring MVC, the same goes. You add a dependency in Netbeans, either at project creation time, or from the properties dialog afterwards.
This is just tip of the iceberg. So I hope this information allows you to at least get started and you can return with more specific questions as you get further in.

Categories