How do I tell Spring Boot which main class to use for the executable jar?

Execution default of goal org.springframework.boot:spring-boot-maven-plugin:1.0.1.RELEASE:repackage failed: Unable to find a single main class from the following candidates My project has more than one class with a main method. How do I tell the Spring Boot Maven plugin which of the classes it should use as the main class? 10 Answers 10

Spring Boot – parent pom when you already have a parent pom

Is there a specific recommended approach to the inclusion of the spring-boot parent pom into projects that already have a required parent POM? What do you recommend for projects that need to extend from an organizational parent (this is extremely common and even something many/most projects published to Maven central depending on the feeder repos … Read more

Best practices for copying files with Maven

I have config files and various documents that I want to copy from the dev environment to the dev-server directory using Maven2. Strangely, Maven does not seem strong at this task. Some of the options: Simple use a copy task in Maven <copy file=”src/main/resources/config.properties” tofile=”${project.server.config}/config.properties”/> Use the Ant plugin to execute copy from Ant. Construct … Read more

disable maven download progress indication

In our company in the CI machines maven local repository is purged before every build. As result my build logs always have a bunch of noise like this Downloading: http://…/artifactory/repo/com/codahale/metrics/metrics-core/3.0.1/metrics-core-3.0.1.jar 4/2122 KB 8/2122 KB 12/2122 KB 16/2122 KB 18/2122 KB 18/2122 KB 4/480 KB 18/2122 KB 8/480 KB 18/2122 KB 12/480 KB 18/2122 KB 16/480 … Read more

Maven dependencies are failing with a 501 error

Recently Maven build jobs running in Jenkins are failing with the below exception saying that they couldn’t pull dependencies from Maven Central and should use HTTPS. I’m not sure how to change the requests from HTTP to HTTPS. Could someone guide me on this matter? [ERROR] Unresolveable build extension: Plugin org.apache.maven.wagon:wagon-ssh:2.1 or one of its … Read more

‘react-scripts’ is not recognized as an internal or external command

I’ve got a maven project, within which is JavaScript project cloned as a git sub-module. So the directory structure looks like mavenapp/src/main/javascript/[npm project files] Inside my package.json, the test looks like this: “test”: “react-scripts test –env=jsdom”, but when I try to run npm test, it says ‘react-scripts’ is not recognized as an internal or external … Read more

Maven surefire could not find ForkedBooter class

Recently coming to a new project, I’m trying to compile our source code. Everything worked fine yesterday, but today is another story. Every time I’m running mvn clean install on a module, once reaching the tests, it crashes into an error: [INFO] — maven-surefire-plugin:2.18.1:test (default-test) @ recorder — [INFO] Surefire report directory: /lhome/code/recorder/target/surefire-reports [INFO] Using … Read more

Java compiler level does not match the version of the installed Java project facet

I have created a New Dynamic Project under Eclipse Helios Version, where my JRE Version is set to 1.6. I have added Maven capabilities to the Web Application by clicking on Configure → Convert to Maven Project. After adding this, a build error appeared in the Eclipse Problems view: Java compiler level does not match … Read more