SpringBoot can't find JSP (even with tomcat installed) - java

I'm trying to use SpringBoot to display a .JSP page using embedded tomcat. Whenever I try to access the localhost URL, I get the Whitelabel Error Page with 404 Not Found. As you'll see below, I tried making a method for #RequestMapping to find the JSP location, to no avail. Previously, I was having issue importing Tomcat into pom.xml (was giving "not found" error). I fixed this by commenting out the <repositories> section in pom.xml, running it, then uncommenting it. How can I get my project to view .JSP files properly? I am following all steps in this Udemy course to a T. I will provide more info where needed.
SpringBoot version is 3.0.0 M3
My Java version is 18.0.1.1 2022-04-22
I'm using IntelliJ IDEA 2022.1.3 Community Edition
The JSP is called "sayHello.jsp" and it's located at /src/main/resources/META-INF/resources/WEB-INF/jsp/sayHello.jsp (the file directory picture below shows this). It just has Hello World HTML code in it
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>3.0.0-M3</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.springboot</groupId>
<artifactId>springboot-first-web-app</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>springboot-first-web-app</name>
<description>My first SpringBoot web application from the Udemy Course</description>
<properties>
<java.version>18</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</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> <!-- Commenting/Un-commenting out <repositories> made it so tomcat-embed jasper dependency worked -->
<repositories>
<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-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>
SayHelloController.java (directory of files pictured later below)
package com.springboot.springbootfirstwebapp.hello;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
#Controller
public class SayHelloController
{
#RequestMapping("say-hello")
#ResponseBody
public String sayHelloDefault()
{
return "Hello! What are you learning today?";
}
#RequestMapping("say-hello-jsp")
public String sayHelloJsp()
{
return "sayHello";
}
#RequestMapping("say-hello-html")
#ResponseBody
public String sayHelloOld()
{
StringBuffer sb = new StringBuffer();
sb.append("<html>");
sb.append("<head>");
sb.append("<title>My first SpringBoot HTML page!</title>");
sb.append("</head>");
sb.append("<body>");
sb.append("This is an HTML page with a body!");
sb.append("</body>");
sb.append("</html>");
return sb.toString();
}
}
application.properties
spring.mvc.view.prefix=/WEB-INF/jsp/
spring.mvc.view.suffix=.jsp
# For more information
logging.level.org.springframework=debug
The DEBUG log showing the 404 Not Found error
My file directory in IntelliJ

Your folder structure is wrong. Should be
main -> webapp -> WEB-INF -> jsp -> sayHello.jsp

Related

How to download maven dependency as *.jar file?

I attempt to implement the example from here, but upon the Maven dependencies installation I can't find jar file amongst downloaded dependencies.
My pom.xml looks like this:
<?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>
<!-- This is often your domain name (reversed.) -->
<groupId>com.abc</groupId>
<!-- The name of this project (actually, the name of the artifact, which is the thing that this project produces. A jar in this case.) -->
<artifactId>javaparser-maven-sample</artifactId>
<!-- The version of this project. SNAPSHOT means "we're still working on it" -->
<version>1.0-SNAPSHOT</version>
<properties>
<!-- Tell Maven we want to use Java 8 -->
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<!-- Tell Maven to treat all source files as UTF-8 -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<geotools.version>2.5.7</geotools.version>
</properties>
<repositories>
<repository>
<id>maven2-repository.dev.java.net</id>
<name>Java.net repository</name>
<url>http://download.java.net/maven/2</url>
</repository>
<repository>
<id>osgeo</id>
<name>Open Source Geospatial Foundation Repository</name>
<url>http://download.osgeo.org/webdav/geotools/</url>
</repository>
<repository> <!--Add the snapshot repository here-->
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>opengeo</id>
<name>OpenGeo Maven Repository</name>
<url>http://repo.opengeo.org</url>
</repository>
</repositories>
<dependencies>
<!-- Here are all your dependencies. Currently only one. These are automatically downloaded from https://mvnrepository.com/ -->
<dependency>
<groupId>com.github.javaparser</groupId>
<artifactId>javaparser-core</artifactId>
<version>3.15.21</version>
</dependency>
<!-- https://mvnrepository.com/artifact/mil.nga.geopackage/geopackage -->
<dependency>
<groupId>mil.nga.geopackage</groupId>
<artifactId>geopackage</artifactId>
<version>3.5.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.geotools/gt-api -->
<dependency>
<groupId>org.geotools</groupId>
<artifactId>gt-api</artifactId>
<version>20.5</version>
</dependency>
<dependency>
<groupId>org.geotools</groupId>
<artifactId>gt-epsg-hsql</artifactId>
<version>${geotools.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.geotools/gt-geometry -->
<dependency>
<groupId>org.geotools</groupId>
<artifactId>gt-geometry</artifactId>
<version>2.5-M2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.geotools/gt-referencing -->
<dependency>
<groupId>org.geotools</groupId>
<artifactId>gt-referencing</artifactId>
<version>17.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.locationtech.jts.io/jts-io-common -->
<dependency>
<groupId>org.locationtech.jts.io</groupId>
<artifactId>jts-io-common</artifactId>
<version>1.16.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.opengis/geoapi -->
<dependency>
<groupId>org.opengis</groupId>
<artifactId>geoapi</artifactId>
<version>3.0.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.geotools/gt-jts-wrapper -->
<dependency>
<groupId>org.geotools</groupId>
<artifactId>gt-jts-wrapper</artifactId>
<version>17.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.geotools</groupId>
<artifactId>gt-swing</artifactId>
<version>17.0</version>
</dependency>
</dependencies>
<!-- This blob of configuration tells Maven to make the jar executable. You can run it with:
mvn clean package
java -jar target/javaparser-maven-sample-1.0-SNAPSHOT-shaded.jar
-->
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.3</version>
<executions>
<execution>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<shadedArtifactAttached>true</shadedArtifactAttached>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.abc.conversion.LogicPositivizer</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
I am able to download all the jars except geotools related jars. When I clean and run the project, in the .m2 folder I am not able to see the geotool related jars. Even in the maven repository I am not able to download the jar file.
Maven repo
Is there any alternative way to proceed?
The repository run by Boundless has been replaced by one hosted by OSGeo. The OSGeo webdav repo was merged into the new OSGeo repo. Details are here (https://docs.geotools.org/latest/userguide/tutorial/quickstart/maven.html)
Replace this block
<repository>
<id>osgeo</id>
<name>Open Source Geospatial Foundation Repository</name>
<url>http://download.osgeo.org/webdav/geotools/</url>
</repository>
<repository> <!--Add the snapshot repository here-->
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>opengeo</id>
<name>OpenGeo Maven Repository</name>
<url>http://repo.opengeo.org</url>
</repository>
with
<repository>
<id>osgeo</id>
<name>OSGeo Release Repository</name>
<url>https://repo.osgeo.org/repository/release/</url>
<snapshots><enabled>false</enabled></snapshots>
<releases><enabled>true</enabled></releases>
</repository>
<repository>
<id>osgeo-snapshot</id>
<name>OSGeo Snapshot Repository</name>
<url>https://repo.osgeo.org/repository/snapshot/</url>
<snapshots><enabled>true</enabled></snapshots>
<releases><enabled>false</enabled></releases>
</repository>
If you paste the Open Source Geospatial Foundation Repository URL in your web browser and hit enter it will return 404 Not Found error. This happens when Maven attempts to connect to that resource to fetch dependency for you but it's no longer available. However, if you pay close attention to Maven Repo link, there is a note:
Note: this artefact is located at Boundless repository (https://repo.boundlessgeo.com/main/)
Try to replace http://download.osgeo.org/webdav/geotools/ with a given in the note URL and run mvn clean install
Please let me know if that worked for you.

Serving HTML pages in a Spring Boot application

I have a Spring Boot Application. I am trying to pass a variable to a HTML page but unfortunately I cannot seem to do it, on application start nothing is rendered except the static text: "WORLD". My controller is as below:
#Controller
public class IndexController {
#RequestMapping(value = "/index", method = RequestMethod.GET)
public String index(Model model) {
model.addAttribute("message", "HELLO");
return "index";
}
}
And my index.html:
<html>
<body>
<h1>${message}</h1>
<h2>WORLD</h2>
</body>
</html>
I was looking for an answer and I found these articles:
How to serve .html files with Spring
How to serve html files with Spring
How to handle static content in Spring MVC?
These are useful examples, but in my project I don't have files such as: mvc-dispatcher-servlet.xml, web.xml, or even the whole WEB-INF directory.
The files I have after creating a Spring MVC Project are in the screenshot below. Should I add the files mentioned in the above literature to fix this issue or what?
My Project view via IntelliJ IDEA:
My pom.xml file:
<?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>offersmanager</groupId>
<artifactId>webapp</artifactId>
<version>1</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.2.6.RELEASE</version>
</parent>
<properties>
<!-- Java version -->
<java.version>1.8</java.version>
<!-- Use UTF-8 sources encoding -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<!-- Local model -->
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>model</artifactId>
<version>${project.version}</version>
</dependency>
<!-- Spring boot -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
<!-- MAIN CODE SETTINGS -->
<sourceDirectory>src/main/java</sourceDirectory>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<!-- TEST CODE SETTINGS -->
<testSourceDirectory>src/test/java</testSourceDirectory>
<testResources>
<testResource>
<directory>src/test/resources</directory>
</testResource>
</testResources>
</build>
<repositories>
<repository>
<id>spring-releases</id>
<url>https://repo.spring.io/libs-release</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-releases</id>
<url>https://repo.spring.io/libs-release</url>
</pluginRepository>
</pluginRepositories>
</project>
You're using Thymeleaf as your templating language, and you should read the documentation for it. In Thymeleaf, to substitute a variable, you'll use an attribute on the HTML tag, so something like this:
<html>
<body>
<h1 data-th-text="${message}">this gets replaced</h1>
<h2>WORLD</h2>
</body>
</html>

Issue finding .html resource in Maven using Spring

New to using Maven/Spring, and messing around trying to create a simple web app. I've got an index.html which I've added to src/main/resources/templates, as well as the main Application, Controller etc.
I'm also using cucumber to do testing, and one of the steps is to GET "http://localhost/billparser/index". I've also set up an application.properties file under src/main/resource, with the entry:
#server.contextPath=/billparser
However I get these lines of logging out:
17:41:47.935 [main] DEBUG o.s.w.s.r.ResourceHttpRequestHandler - Trying relative path [index] against base location: ServletContext resource [/]
17:41:47.935 [main] DEBUG o.s.w.s.r.ResourceHttpRequestHandler - Trying relative path [index] against base location: class path resource [META-INF/resources/]
17:41:47.936 [main] DEBUG o.s.w.s.r.ResourceHttpRequestHandler - Trying relative path [index] against base location: class path resource [resources/]
17:41:47.936 [main] DEBUG o.s.w.s.r.ResourceHttpRequestHandler - Trying relative path [index] against base location: class path resource [static/]
17:41:47.936 [main] DEBUG o.s.w.s.r.ResourceHttpRequestHandler - Trying relative path [index] against base location: class path resource [public/]
I've checked, and my index.html file has been put into target/classes/templates.
I've done some googling online but I'm new to any of this sort of stuff, and seem a little bewildered. I'm using https://github.com/excellentdrums/Cucumber-JVM-Spring-MVC-Test-HTMLUnit-Demo as a bit of a template for getting it working, and followed what he's done but having no luck myself.
I've done some googling but I'm still lost. Can anyone point me in the right direction?
Thank you.
Pom.xml looks as such:
<?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.tmh.bill</groupId>
<artifactId>billParser</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>Bill Parser</name>
<description>Parse out a JSON to show a bill.</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.0.0.RC5</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf-spring4</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test-mvc-htmlunit</artifactId>
<version>1.0.0.M1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-spring</artifactId>
<version>1.1.6</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-junit</artifactId>
<version>1.1.6</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-htmlunit-driver</artifactId>
<version>2.40.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<start-class>bill.Application</start-class>
<java.version>1.7</java.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-milestone</id>
<url>http://repo.spring.io/libs-milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-milestone</id>
<url>http://repo.spring.io/libs-milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
A Spring Boot application starts up on port 8080 by default. Also, the server.contextPath property in your application.properties file is commented out, so this does not affect your context path. The correct URL for you should be http://localhost:8080/index, as long as you have the /index path mapped in your controller.
You can test this by running the example GitHub project you referenced and navigating to http://localhost:8080/hello, which will give you the following:

Cannot build Spring 4 project with Maven

I am going through this guide:
https://spring.io/guides/gs/rest-service/
I use Maven for building, so I've fetched the pom.xml linked in the official Spring guide:
https://github.com/spring-guides/gs-rest-service/blob/master/initial/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.springframework</groupId>
<artifactId>gs-rest-service</artifactId>
<version>0.1.0</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.0.1.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
</dependencies>
<properties>
<start-class>hello.Application</start-class>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-build</artifactId>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snapshots</id>
<url>http://repo.spring.io/libs-snapshot</url>
<snapshots><enabled>true</enabled></snapshots>
</repository>
<repository>
<id>spring-repo</id>
<name>Spring Repository</name>
<url>http://repo.spring.io/release</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<url>http://repo.spring.io/libs-snapshot</url>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</project>
I get the following error when running mvn install
[ERROR] Error resolving version for plugin
org.springframework.boot:spring-boot-maven-build' from the
repositories [local (C:\Users\Laszlo_Szucs.m2\repository),
spring-snapshots (repo.spring.io/libs-snapshot), central
repo.maven.apache.org/maven2)]: Plugin not found in any plugin
repository -> [Help 1]
How do I know which version to provide in the pom.xml for this?
Check whether http://repo.spring.io/libs-snapshot is in pom.xml. If not, Add http://repo.spring.io/libs-snapshot to maven repository.
<repository>
<id>spring-repo</id>
<name>Spring Repository</name>
<url>http://repo.spring.io/release</url>
</repository>
And upgrade the maven to 3.0.5 above.
In my case, removing the ~/.m2/repository/org/springframework/boot folder and then cleaning the project resolved the issue. After this issue, I also faced another issue in which STS complained that my maven project was not updated. However, right clicking on the issues in the Markers area and selecting Quick Fix popped up a window which prompted me to update the maven projects. Selecting the projects and clicking the update button in this window resolved the issue.
I specified d goals as "spring-boot:run" (without quote) it works for me
procedure: right click on myproject>run as >run configurations >click on mavenbuild>goals(specify goal name)>run

Gephi dependency in Maven Missing artifact 0.9- SNAPSHOT

I am trying to add the dependency of Gephi in POM.xml file (in Eclipse). Here is the POM file:
<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>ch.unifr</groupId>
<artifactId>facebook</artifactId>
<version>1.0</version>
<packaging>war</packaging>
<name>Facebook Example</name>
<repositories>
<repository>
<id>gephi-snapshots</id>
<name>Gephi Snapshots</name>
<url>http://nexus.gephi.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>gephi-releases</id>
<name>Gephi Releases</name>
<url>http://nexus.gephi.org/nexus/content/repositories/releases/</url>
</repository>
</repositories>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<gephi.maven.requiredVersion>3.0.4</gephi.maven.requiredVersion>
<netbeans.run.params.ide/>
<netbeans.run.params>${netbeans.run.params.ide}</netbeans.run.params>
<!-- Netbeans Platfrom version -->
<netbeans.version>RELEASE721</netbeans.version>
<!-- Gephi version -->
<gephi.version>0.9-SNAPSHOT</gephi.version>
<!-- Java compilation settings -->
<gephi.javac.source>1.6</gephi.javac.source>
<gephi.javac.target>1.6</gephi.javac.target>
<gephi.javac.xlint>-Xlint:all</gephi.javac.xlint>
<gephi.javac.debug>true</gephi.javac.debug>
<gephi.javac.optimize>true</gephi.javac.optimize>
<gephi.javac.showDeprecation>true</gephi.javac.showDeprecation>
<gephi.javac.showWarnings>true</gephi.javac.showWarnings>
<gephi.javac.fork>true</gephi.javac.fork>
<!-- Testing settings -->
<gephi.junit.version>4.7</gephi.junit.version>
<gephi.test.maxMemory>768M</gephi.test.maxMemory>
<gephi.test.reportsDirectory>${project.build.directory}/surefire-reports/plain</gephi.test.reportsDirectory>
<gephi.test.failureIgnore>${testFailureIgnore}</gephi.test.failureIgnore>
<!-- Repository URLs -->
<gephi.release.repository.id>gephi-nexus</gephi.release.repository.id>
<gephi.snapshot.repository.id>gephi-nexus</gephi.snapshot.repository.id>
<gephi.release.repository.url>http://nexus.gephi.org/nexus/content/repositories/releases</gephi.release.repository.url>
<gephi.snapshot.repository.url>http://nexus.gephi.org/nexus/content/repositories/snapshots</gephi.snapshot.repository.url>
<!-- SCM -->
<gephi.scm>git</gephi.scm>
<!--==== Plugin Versions ==================================================================================-->
<gephi.maven-assembly-plugin.version>2.4</gephi.maven-assembly-plugin.version>
<gephi.maven-clean-plugin.version>2.5</gephi.maven-clean-plugin.version>
<gephi.maven-compiler-plugin.version>3.0</gephi.maven-compiler-plugin.version>
<gephi.maven-dependency-plugin.version>2.6</gephi.maven-dependency-plugin.version>
<gephi.maven-deploy-plugin.version>2.7</gephi.maven-deploy-plugin.version>
<gephi.maven-gpg-plugin.version>1.4</gephi.maven-gpg-plugin.version>
<gephi.maven-install-plugin.version>2.4</gephi.maven-install-plugin.version>
<gephi.maven-jar-plugin.version>2.4</gephi.maven-jar-plugin.version>
<gephi.maven-jarsigner-plugin.version>1.2</gephi.maven-jarsigner-plugin.version>
<gephi.maven-javadoc-plugin.version>2.9</gephi.maven-javadoc-plugin.version>
<gephi.maven-license-plugin.version>1.9.0</gephi.maven-license-plugin.version>
<gephi.maven-release-plugin.version>2.3.2</gephi.maven-release-plugin.version>
<gephi.maven-resources-plugin.version>2.6</gephi.maven-resources-plugin.version>
<gephi.maven-source-plugin.version>2.2.1</gephi.maven-source-plugin.version>
<gephi.maven-surefire-plugin.version>2.13</gephi.maven-surefire-plugin.version>
<gephi.build-helper-maven-plugin.version>1.7</gephi.build-helper-maven-plugin.version>
<gephi.wagon-maven-plugin.version>1.0-beta-4</gephi.wagon-maven-plugin.version>
</properties>
<dependencies>
<dependency>
<groupId>com.restfb</groupId>
<artifactId>restfb</artifactId>
<version>1.6.12</version>
</dependency>
<dependency>
<groupId>com.google.code.facebookapi</groupId>
<artifactId>facebook-java-api</artifactId>
<version>3.0.2</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.0-beta9</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.0-beta9</version>
</dependency>
<dependency>
<groupId>org.openrdf.sesame</groupId>
<artifactId>sesame-model</artifactId>
<version>2.7.7</version>
</dependency>
<dependency>
<groupId>org.gephi</groupId>
<artifactId>gephi-toolkit</artifactId>
<version>0.9-SNAPSHOT</version>
<dependency>
</project>
As you may notice, the dependency is for Gephi. This is part of the error message as below:
Multiple annotations found at this line:
- Missing artifact org.netbeans.api:org-netbeans-modules-queries:jar:RELEASE721
- Missing artifact commons-codec:commons-codec:jar:1.6
- Missing artifact org.apache.xmlgraphics:batik-util:jar:1.7
- Missing artifact gnu.trove:trove:jar:2.1.0
- Missing artifact javax.activation:activation:jar:1.1
- Missing artifact org.netbeans.api:org-openide-modules:jar:RELEASE721
Could anyone help me how to solve this problem? I do not know why POM does not accept the Gephi dependency however I have already added some other dependencies such as openrdf and restfb. I also added the Gephi repository as shown in the POM file. Your help is very much appreciated.
Looking at the documentation page, it looks like you'll need to add their repository to your POM, as well:
<project>
...
<repositories>
<repository>
<id>gephi-snapshots</id>
<name>Gephi Snapshots</name>
<url>http://nexus.gephi.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>gephi-releases</id>
<name>Gephi Releases</name>
<url>http://nexus.gephi.org/nexus/content/repositories/releases/</url>
</repository>
...
</repositories>
...
</project>

Categories

Resources