Can't find url views when deploying spring boot on WebSphere - spring

I'm starting a simple project in spring boot, right now I just want to show a startup view, but when deploying on a WebSphere 9 server, it appears when I start "Error 404: SRVE0190E: File not Found: /"
and if I put the url of another controller method for example /login
the same error comes out
"Error 404: java.io.FileNotFoundException: SRVE0190E: File not Found: /login"
This is my controller
#Controller
public class HomeController {
#RequestMapping(value="/", method = RequestMethod.GET)
public String home() {
return "example";
}
#RequestMapping(value="/login", method=RequestMethod.GET)
public String login() {
return "example.html";
}
}
Create the explame.html in several places of the project to know if spring recognized it in any of them, but I always got the same message, I leave an image of the initial project structure and my pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.1.BUILD-SNAPSHOT</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>org.com.ioks</groupId>
<artifactId>ExampleFirst</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>ExampleFirst</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
</repository>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
</pluginRepository>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>
structure project
UPDATE
I was able to visualize my start view with / and / login, as I indicated in my controller, it was as #Jalil.Jarjanazy told me in his answer, I put the html file in templates, but not in templates of the empty package that is in src , because when I want to add something there, it shows me the message: "Files created outside of a web content folder will not be included in your deployed Web application.
", I added it in WEB-INF / classes / templates, another very strange thing is that in Eclipse it does not show me the classes folder, but it is in the project, I manually put the html file and ran the project, I think this is not is the proper way to do it, could you tell me what I'm doing wrong, why can't I see the folder classes in eclipse?

Your example.html file should be in the templates folder.
And you should only return the only name of the html file (example) in your controller, so no need for the .html.

Related

Spring Boot application fat jar fails with 'Unable to open root Jar file'

After compiling my Spring Boot application with mvn clean install I am not being able to run the fat jar with java -jar target/myapplication-1.0.jar due to the following error:
java.io.IOException: Unable to open root Jar file 'war:file:/Users/coterobarros/git/repository/myapplication/target/myapplication-1.0.jar*/BOOT-INF/lib/spring-webmvc-5.3.1.jar'
...
Unzipping the application fat jar, the allegedly missing spring-webmvc-5.3.1.jar jar file can be found at BOOT-INF/lib/spring-webmvc-5.3.1.jar.
On the other hand, the application can be successfully run from Spring Tool Suite 4 IDE or issuing mvn spring-boot:run.
Notice an asterisk * between the fat jar path and the path to spring-webmvc-5.3.1.jar. I suppose this is the error, but I don't know where this symbol comes from.
Any Idea?
This is my pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.4.0-SNAPSHOT</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<groupId>com.ofaraday</groupId>
<artifactId>myapplication</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<name>myapplication</name>
<description>myapplication.com application</description>
<properties>
<java.version>14</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
</dependency>
<!-- To add custom properties to application.properties -->
<!-- See https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#configuration-metadata-annotation-processor -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
</repository>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
</pluginRepository>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>

ERROR: Non-resolvable parent POM: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom

I am getting the below exception in my pom.xml when trying to run my application. I saw some posts regarding the error and followed them but no use. I understand the artifact(parent) is referred locally and is not present, but I don't know how to resolve this, could somebody please help me?
The error is
Project build error: Non-resolvable parent POM for com.example:demo:0.0.1-SNAPSHOT: Failure
to transfer org.springframework.boot:spring-boot-starter-parent:pom:1.5.18.BUILD-SNAPSHOT
from https://repo.spring.io/snapshot was cached in the local repository, resolution will not be
reattempted until the update interval of spring-snapshots has elapsed or updates are forced.
Original error: Could not transfer artifact org.springframework.boot:spring-boot-starter-
parent:pom:1.5.18.BUILD-SNAPSHOT from/to spring-snapshots (https://repo.spring.io/
snapshot): repo.spring.io and 'parent.relativePath' points at no local POM
below is the pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>demo</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.18.BUILD-SNAPSHOT</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jersey</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>
Downgrade the spring boot starter to lower version.
Update the Maven project.
Hope it works.
There is an issue with the version of Spring Boot you are using, as it is a build. Just copy another release version of 1.X and replace it.
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.17.RELEASE</version>
<relativePath/>
<!-- lookup parent from repository -->
</parent>
If you can access the url https://repo.spring.io/snapshot/ from your browser, then it can be a Maven issue. Maven is unable to connect to the repository and that can be due to:
Any cache issues in the downloaded dependencies. Try deleting the local dependencies, and try out the solution provided here.
Try Maven Update and Maven Clean.
Try re-opening the IDE after doing the above.
Your pom.xml is fine, it looks like it's a problem with your internet connection. Check if you can reach https://repo.spring.io/snapshot/ with your browser. If yes, check if you need to configure a proxy server. If no, you should contact your internet provider.
Here is the documentation on how you configure a proxy server for Maven:

I'm gettng the error when starting weblogic 12.1.3 with spring boot

I'm using spring boot (web) with weblogic 12.1.3. getting the below error when i right-click run-on server.
Error:
<Oct 25, 2016 3:53:23 PM EDT> <Warning> <HTTP> <BEA-101394> <The exception "The request content-type is not a multipart/form-data" occurred when processing getParameter or getParameterValues from a multipart value of a ServletRequest.>
POM.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>gov.maine.print</groupId>
<artifactId>PrintNotice</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>PrintNoticeService</name>
<description>Notice print for batch and online</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.9.BUILD-SNAPSHOT</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<artifactId>log4j-over-slf4j</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<archive>
<manifest>
<addDefaultImplementationEntries>false</addDefaultImplementationEntries>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>
Weblogic.xml
<?xml version="1.0" encoding="UTF-8"?>
<wls:weblogic-web-app xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-web-app" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.7/weblogic-web-app.xsd">
<wls:weblogic-version>12.1.3</wls:weblogic-version>
<wls:context-root>PrintNotice</wls:context-root>
<wls:container-descriptor>
<wls:prefer-application-packages>
<wls:package-name>org.slf4j.*</wls:package-name>
<wls:package-name>org.springframework.*</wls:package-name>
</wls:prefer-application-packages>
</wls:container-descriptor>
</wls:weblogic-web-app>
Restcontroller call
#RestController
#RequestMapping(method = RequestMethod.GET)
String readResource() {
return "HI.......";
}
Would someone help?
Based on this information from a comment:
That is warning message, when i try to invoke the resource using IE,
It's giving me a attachment file rather than "HI......." message
response. But the same is working as expected on FireFox and Chrome.
You should add #RequestBody annotation, as well as content type using produces=... to your readResource() method. That way Spring will know that you're trying to return response content, with correct content-type, and not a name of a view to render for example.
Example:
#RequestMapping(method = RequestMethod.GET, produces="text/html")
#RequestBody
String readResource() {
return "HI.......";
}

Spring Boot doesn't use datasource properties

I've set up spring.datasource.* in application.properties:
spring.datasource.url=jdbc:h2:./data/test
spring.datasource.username=sa
spring.datasource.password=
spring.datasource.driver-class-name=org.h2.Driver
Then I configured JdbcTemplate Bean
#Bean
#Autowired
public JdbcTemplate jdbcTemplate(DataSource dataSource) {
return new JdbcTemplate(dataSource);
}
But when I start application, I see in console
Starting embedded database: url='jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=false', username='sa'
Instead of my settings. Why?
It's always a magic.
When the problem occured I have had these dependencies:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>
But when I changed it into
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>
The problem gone...
I had the same issue and I hope it helps you.
The problem seems to be:
When you login into H2 console, it writes metadata in your user folder (.h2.server.properties). This file just configures what will appear in the console UI.
Pay close attention to the URL you put in the JDBC URL field of the console UI. It must match with the URL you define in the spring.datasource.url of the application.properties file.
The trick is: when running just an example application, it DO NOT create a data file until you connect/commit something into the database. So, you think the autoconfigure feature is not doing the job.
But when you first modify the database state, H2 creates the data file something.mv.db in the right folder.
Assuming you just created a new application with the following dependencies (i.e. JDBC,H2 and web), try the following to see my point:
1) set up your pom.xml (it is the default for these three dependencies I mentioned):
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>demo</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.0.BUILD-SNAPSHOT</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>
2) in the application.properties file:
spring.h2.console.enabled=true
spring.h2.console.path=/h2-console
spring.datasource.url=jdbc:h2:file:./data/test
3) Open a file explorer window to show the contents of the root folder of your project (the same folder of your pom.xml).
4) Then, go to <server>:8080/h2-console.
In the JDBC URL field of the console UI, type: jdbc:h2:file:./data/test
and connect.
5) You will see the 'data' folder being created and inside it, the data file test.mv.db in this case.
Solution to your question
SpringBoot will always look for embedded datasource only, Check whether you have any other driver's like derby driver in your WEB-INF/lib path.
You exclude the datasource configuration and use importResource annotation to inject your dataSource configuration.
Sample Snippet below.
#EnableAutoConfiguration(exclude=DataSourceAutoConfiguration.class)
#ImportResource({ "classpath:datasource-config.xml"})
public class Sample {
In datasource-config.xml you can use your datasource properties file as well.
Enjoy :-)
If you want to inject JdbcTemplate in your controller class,
private final JdbcTemplate jdbcTemplate;
#Autowired
public MyController(JdbcTemplate jdbcTemplate) {
this.jdbcTemplate = jdbcTemplate;
}
In this way you can autowire jdbcTemplate in any spring bean.
Add spring boot jdbc dependency in your pom.xml
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
See this spring boot documentation for more information.

spring-social-github maven repository

I can't find Maven repository for spring-social-github. Could you please let me know where it is located ?
Spring Social is separated into different Projects which you can find if you follow the link above.
This is the core module with the following maven dependency:
<dependencies>
<dependency>
<groupId>org.springframework.social</groupId>
<artifactId>spring-social</artifactId>
<version>1.1.0.RELEASE</version>
</dependency>
</dependencies>
There is also spring social facebook with the following maven dependency:
<dependencies>
<dependency>
<groupId>org.springframework.social</groupId>
<artifactId>spring-social-facebook</artifactId>
<version>2.0.1.RELEASE</version>
</dependency>
</dependencies>
Spring social twitter can be found here:
<dependencies>
<dependency>
<groupId>org.springframework.social</groupId>
<artifactId>spring-social-twitter</artifactId>
<version>1.1.0.RELEASE</version>
</dependency>
</dependencies>
And so on.
If you want Spring social github you can go to the link before. Or grab this repository so that you will be able to add it to your project.
<dependencies>
<dependency>
<groupId>org.springframework.social</groupId>
<artifactId>spring-social-github</artifactId>
<version>1.0.0.M4</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
Spring will usually not make a public Maven repository available outside of their own repo. This means you have to add the repository above to be able to add Spring projects that are in a testing stage.
Here is an example pom.xml file with Spring social working:
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.test</groupId>
<artifactId>test</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.springframework.social</groupId>
<artifactId>spring-social-github</artifactId>
<version>1.0.0.M4</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
</project>
http://repo.spring.io/milestone
(admittedly taken from the other answer but it was well hidden there)
Bonus question: why isn't it on maven central???

Resources