Reputation: 3592
I get these errors while trying to build a Java EE(Maven) project in Netbeans (Also got the same error building from cmd with mvn clean install -U
)
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project myproject: There are test failures.
The wierd thing is, I get the same error while trying on my other PC, but, when I tried building at school there was no error and it worked fine . There is zero test errors in school.
Why is this happening? Does anyone have any idea?
And sorry if this question is a "bad" stackoverflow question, but I have nowhere to turn to get help.
EDIT:
Now Im getting this:
Tests run: 10, Failures: 0, Errors: 0, Skipped: 0
which is good, but Im still getting this error and build failure:
Failed to execute goal org.apache.maven.plugins:maven-source-plugin:2.4:jar (attach-sources) on project backend: Execution attach-sources of goal org.apache.maven.plugins:maven-source-plugin:2.4:jar failed: Plugin org.apache.maven.plugins:maven-source-plugin:2.4 or one of its dependencies could not be resolved: Failed to collect dependencies for org.apache.maven.plugins:maven-source-plugin:jar:2.4 (): Failed to read artifact descriptor for org.apache.maven:maven-archiver:jar:2.5: Could not transfer artifact org.apache.maven:maven-archiver:pom:2.5 from/to central (http://repo.maven.apache.org/maven2): repo.maven.apache.org: Unknown host repo.maven.apache.org -> [Help 1]
And at the beginning of the build I am getting these warnings:
Some problems were encountered while building the effective model for edu.cth.myproject:backend:ejb:1.0-SNAPSHOT
build.plugins.plugin.version for org.apache.maven.plugins:maven-source-plugin is missing.
build.plugins.plugin.version for org.apache.maven.plugins:maven-javadoc-plugin is missing.
build.plugins.plugin.version for org.apache.maven.plugins:maven-deploy-plugin is missing.
It is highly recommended to fix these problems because they threaten the stability of your build.
For this reason, future Maven versions might no longer support building such malformed projects.
I dont know what to do?
Upvotes: 1
Views: 1605
Reputation: 75416
You have test failures. This mean that code explicitly designed to test if things are working, now say that it doesn't.
Investigate the test report to find out what the failures are - this is probably easiest from within Netbeans (tell it to run the tests). This could be just about anything. My guess would be that the tests try to talk to a server on the schools network you cannot reach from home, but you need to investigate to be sure.
EDIT: The error message posted in the comments says the code expected a database server running on port 1527, but none were.
Apparently this is the Derby database (which is available in a slimmed down version in the JDK), and you need to invoke the server manually. You may have received information from your teacher about how to set this up correctly.
This youtube video claims to say "How to fix netbeans database port 1527 error". https://www.youtube.com/watch?v=DM7g0hm_s4w
Upvotes: 2