Spring Jars to download - spring

I am using below link for downloading spring jars.
http://repo.spring.io/release/org/springframework/spring/4.1.4.RELEASE/
I am confused with so many links.
Which link should i use to download the jar?
I am using a Windows machine and create a project directly through New Java Project.

Please refer this url http://repo.spring.io/release/org/springframework/spring/ and Choose the which version Spring Jars you want.
Choose the spring-framework-X.X.X.RELEASE-dist.zip

You should be using this link to download spring jars. Other links in there are for checksum or documentation.

Important points to understand in all the spring related repo is that it contains 3 zip files .
spring-framework-{version}-dist.zip : contains all the spring
related jars.
spring-framework-{verison}-docs.zip : contains all the standard documents in HTML format for spring and related java api documents. It is similar to Oracle API Documentation.
**Note : Inside all the folders you will find and index.html file. U can consume it typing the folder path till index.html in web browser.
spring-framework-{version}-schema.zip*: contains all the spring modules based standard xsd for xml based spring development.

I hit the same issue and I followed Brian Clozel advice above.
Create a new Maven project in eclipse.
Edit the pom.xml and add the Spring dependencies as follows -
org.springframework
spring-core
5.0.6.RELEASE
When you build the project in eclipse,it hits the maven repo and downloads the requisite spring jars for you. The indirect dependencies should also be downloaded automatically.
Hope this helps.

Step 1) Place this URL in browser
https://repo.spring.io/ui/native/release/org/springframework/spring/
Step 2) Scroll down & select latest version. Example : 5.3.9/
Step 3) Click on the file similar to "spring-5.3.9-dist.zip" to download
Step 4) Hence JAR files of latest spring is downloaded in zip format.

Related

Maven Generate OpenAPI JSON for SpringBoot REST Controllers

Is there a Maven plugin which can generate an openapi.json file at build time for my SpringBoot RestControllers?
If not a Maven plugin, is there another simple package to generate the file at build time?
I only want the openapi.json file, I don't want Swagger UIs auto-integrated, etc.
I was able to get this working with SpringDoc.
I couldn't find a project which showed exactly my use-case (without all the swagger ui stuff), so I created an example project on GitHub for others to use as reference: springdoc-maven-plugin-demo
You can use Spring-doc which support OpenAPI 3
Look at the demos

cannot find service.jar file custom portlet liferay

I am using liferay 6.2 & built a maven portlet and working fine, I want to use its tables to store data for another portlet so that I need its services in this portlet.
But we can't access it externally so i find a way something like: required-deployment-contexts=Portlet-Project1 inside liferay-plugin-package.properties, then found its works for Ant only.
I was also finding the xxx-portlet-service.jar but didn't able to, so that i could manually put it in other portlet's lib folder i.e inside tomcat-webapps-xxxportlet-WEB-INF.
Just want to find how to use xxxLocalService.util in other in maven portlet
The best approach you can implement is a plugin to manage all the interaction with the DB.
First of all you must create a Service with a maven project and include it into your pom.xml in each portlet that you need. Then you can invoke its methods whenever you want because each portlet will store the dependencies.
Create Service Plugin into jar file
Rebuild with mvn clean liferay:build-service
Custom your own methods to manage the iteraction with the DB (LocalServiceUtilImpl and rebuild).
Include this plugin into pom.xml portlets
Rebuild your portlet.
The JAR will be placed in your .m2 folder, then each time that you rebuild your Service Plugin will be updated.
If i understood your question correctly, You need to create service builder project using maven and then you can add as dependency in other project wherever you need access to use xxxLocalServicutil class.
You can follow below link to create maven service builder project.
http://www.liferay-guru.com/how-to-use-liferay-servicebuilder-archetype/
As you mentioned in your question.
was also finding the xxx-portlet-service.jar but didn't able to, so
that i could manually put it in other portlet's lib folder
To answer this, manually putting .jar file in lib directory will not help when you are working with maven project

How to build an Angular2 type script with spring boot back end in STS

I am learning angular 2 currently and trying to hosted in springboot java application.
I created a separate project using angular cli , then I created spring starter project with web only.
Next I imported the angular cli project inside /src/main/resources/static directory.
when I opened the browser , I was not able to see the basic index.html.
Then I removed all the imported files and imported only the content of the directory , which is the resulting compiled ES5 java script after transpiling the type script files in directory, this time it worked.
My questions are:-
1) What is the best practice , to use the GUI under /src/main/statis or create /src/main/public or /src/main/webapp ?
2) Does spring understand only js and not ts ( java script and not type script)?
3) Do I need a maven plugin for typescript and if so how to tell maven bundle the compiled js with the spring war while excluding the rest directories and files
4) How to include the testing unit / e2e with maven build
I searched for step by step guide for ANgular 2 and spring boot but could not find one. It would be helpful to many if some guide like this exist.
Many thanks for your support guys.
1) What is the best practice , to use the GUI under /src/main/statis or create /src/main/public or /src/main/webapp ?
Since typescript compiles to JavaScript I strongly recommend using GULP. I have my source files under src/client and I build with gulp to add the files to src/main/public
I believe either public or webapp works and there's not a huge difference.
2) Does spring understand only js and not ts ( java script and not type script)?
The newer version of STS has support for typescript, but I prefer to use visual studio code when viewing typescript files as there is better support.
3) Do I need a maven plugin for typescript and if so how to tell maven bundle the compiled js with the spring war while excluding the rest directories and files
If you use gulp, the typescript is compiled to js and added to the src/main/public directory where your springboot app sees the files when running with maven.
4) How to include the testing unit / e2e with maven build
I searched for step by step guide for ANgular 2 and spring boot but could not find one. It would be helpful to many if some guide like this exist.
Many thanks for your support guys.
I recommend using an angular seed or starter, this seems like the most up to date one that I've found:
https://github.com/antonybudianto/angular2-starter
This uses gradle, but is spring boot and angular 2:
https://github.com/borysn/spring-boot-angular2
I shared a project on github that integrates Angular 2 With spring boot. Just need to follow the step on readme or check commit history. You can access here Angular 2 with spring boot

How to upload custom jars to Maven repository

I have a custom jar named core-ui-1.0.jar which is based on Spring. I used http://download.java.net/maven/2/ repository to download spring jars to compile my java files inside core-ui-1.0.jar. Now my core-ui-1.0.jar is ready to release
Can someone help me how can I release my core-ui jar to http ://download.java.net/maven/2/ so that any person can download it from maven 2 repository the way we download spring, hibernate jars etc.
Please let me know if I have the right to upload anything to http://download.java.net/maven/2/ or am I thinking in wrong direction.
Thanks in advance.
You need to create a release. I suggest using the maven-release-plugin if you're build is based on maven.
To have your artifacts available in maven central follow the instructions here:
http://maven.apache.org/repository/index.html (and follow the links)
http://maven.apache.org/guides/mini/guide-central-repository-upload.html
I think this applies best to your project: http://central.sonatype.org/pages/ossrh-guide.html
http://central.sonatype.org/pages/requirements.html
http://central.sonatype.org/pages/choosing-your-coordinates.html

org.springframework package cannot be imported

As the topic says I cannot import this package in my web dynamic project using SpringSource Tool Suite.The command Spring Tools --> Add Spring Project Nature has been already executed.
Thank you.
What kind of project did you create? Is it a Maven project? If so, you need to make sure that you are importing 'at least' the spring-context dependency like so
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-context</artifactId>
    <version>3.1.0.RELEASE</version>
    <scope>runtime</scope>
</dependency>
(or whatever version you want to use)
[EDIT]
Since as you say, you are using a Dynamic Web Project through this example -> http://www.vaannila.com/spring/spring-mvc-tutorial-1.html, you need to physically add the following jar files to your WEB-INF/lib folder
antlr-runtime-3.0
commons-logging-1.0.4
org.springframework.asm-3.0.0.M3
org.springframework.beans-3.0.0.M3
org.springframework.context-3.0.0.M3
org.springframework.context.support-3.0.0.M3
org.springframework.core-3.0.0.M3
org.springframework.expression-3.0.0.M3
org.springframework.web-3.0.0.M3
org.springframework.web.servlet-3.0.0.M3
You should have the following:
Adding the 'Spring Project Nature' does not add the dependencies for you, but only instructs the IDE that this project is using Spring.
Use maven.it automatically adds the necessary jar files.otherwise u need to manually do it.you can have a look at this http://www.mkyong.com/maven/how-to-convert-java-web-project-to-maven-project/
to migrate an existing project into maven
OR
You can manually add the necessary jar files.
Right click on the spring project>>
properties>>
java build path>>
libraries>>Add jars
:)

Resources