Step By Step settings avalon with Spring Boot + Spring web MVC + Maven

Post Reply
paulosobrinho17
Posts: 3
Joined: 26 Sep 2017, 15:41

31 May 2018, 16:42

I have many problems when i try run Spring Boot.

I add in my pom:

Code: Select all

 <parent>
	<groupId>org.springframework.boot</groupId>	
	<artifactId>spring-boot-starter-parent</artifactId>
	<version>2.0.2.RELEASE</version>	
	<relativePath/>	
	<!-- lookup parent from repository -->
</parent>
new dependecies in my pom.xml:

Code: Select all

 
 		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-test</artifactId>
			<scope>test</scope>
		</dependency>
		
		
		

		<dependency>
		    <groupId>com.h2database</groupId>
		    <artifactId>h2</artifactId>
		    <version>1.4.187</version>
		    <scope>test</scope>
		</dependency>
And new plugin:

Code: Select all

  
  			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
			</plugin>

I add file java for run SrinngBoot in default package

Code: Select all

package org.primefaces.avalon;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class DemoApplication {

	public static void main(String[] args) {
		SpringApplication.run(DemoApplication.class, args);
	}
}

I add file aplication.properties for h2 databse, required when I try run SpringBoot.
The file directory

Code: Select all

# H2
spring.h2.console.enabled=true
spring.h2.console.path=/h2
# Datasource
spring.datasource.url=jdbc:h2:file:~/test
spring.datasource.username=sa
spring.datasource.password=
spring.datasource.driver-class-name=org.h2.Driver



Now i recived error:

Code: Select all

[b][ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.0.2.RELEASE:repackage (default) on project avalon: Execution default of goal org.springframework.boot:spring-boot-maven-plugin:2.0.2.RELEASE:repackage failed: Unable to find a single main class from the following candidates [DemoApplication, org.primefaces.avalon.DemoApplication] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
		
		
		<!-- https://mvnrepository.com/artifact/com.h2database/h2 -->[/b]


Have any example using SpringBoot and Spring MVC ?

cagatay.civici
Prime
Posts: 18128
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

01 Jun 2018, 09:06

I'm afraid we're unable to help as it goes beyond the scope of Avalon support since it is related to Spring instead.

paulosobrinho17
Posts: 3
Joined: 26 Sep 2017, 15:41

07 Jun 2018, 20:05

I tried this example, is more similar for add project in spring boot.
After that is more easly for add another types spring frameworks.


https://www.codenotfound.com/jsf-primef ... -boot.html


In this case, tis used commom the primefaces.
If i was add jar avalon theme in the file "application.yml".
I tried put "avalon" for theme name, but in execution time has error.
How i specify the primefaces prime theme in this file configuration, how the premium theme is reconized ?

Error in execution time:

/avalon/dasboard.xhtml Not Found in ExternalContext as a Resource

aragorn
Posts: 3762
Joined: 29 Jun 2013, 12:38

11 Jun 2018, 08:35

Do you have dasboard.xhtml page in your project? If no, please remove outcome="dashboard.xhtml" in all your pages.

Post Reply

Return to “Avalon - PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 0 guests