Build apache ignite with netbeans ide - java

I want to build apache ignite source code with NetBeans IDE 8.2 and maven 3.3.9 in ubuntu 16.04 but when I build it, it encounters the following error:
Failed to execute goal org.codehaus.mojo:flatten-maven-plugin:1.0.1:flatten (flatten) on project ignite-tools: The plugin org.codehaus.mojo:flatten-maven-plugin:1.0.1 requires Maven version 3.2.5 -> [Help 1]
To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.
For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginIncompatibleException
After correcting the problems, you can resume the build with the command
mvn <goals> -rf :ignite-tools
and it is stopped with failure on the "Ignite tools" step.
It is normally built with the terminal command, but I need to build it with IDE.
I've already modified the Maven version, but the same error still appeared.

Just checked: You need to supply updated Maven to Netbeans instead of built-in version.
You have to go Tools -> Options -> Java pane -> Maven tab.
Maven Home: Browse..., choose your own downloaded Maven version directory, since built-in 3.0.2 < 3.2.5. You will have to download a fresh Maven install, I assume you already did.
You also need to choose [x] Skip tests for builds not related to testing, otherwise Apache Ignite will not build for you (running all tests takes 24h or so).
Then you can do Run -> Clean and Build Project, it will build all right.

Related

What is the difference between running a java springboot project in an IDE and using maven clean package?

I am new to Java Springboot and I have been tinkering with it for a while now (implement caching ).
I am trying to recreate the **
samples/coherence-spring-demo/coherence-spring-demo-boot project
** in the following Github repo https://github.com/coherence-community/coherence-spring following the instructions in https://spring.coherence.community/3.1.0/refdocs/reference/htmlsingle/index.html#coherence-spring-documentation
I have been working on VS Code with the STS extension and when I click on run, the application runs fine. But when I build it using
mvnw clean package
I get the following error.
[ERROR] Failed to execute goal on project coherence-spring-demo-boot:
Could not resolve dependencies for project
com.oracle.coherence.spring:coherence-spring-demo-boot:jar:3.3.0-SNAPSHOT:
com.oracle.coherence.spring:coherence-spring-demo-core:jar:3.3.0-SNAPSHOT
was not found in
https://oss.sonatype.org/content/repositories/snapshots during a
previous attempt. This failure was cached in the local repository and
resolution is not reattempted until the update interval of
snapshots-repo has elapsed or updates are forced -> [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/DependencyResolutionException
I have checked the pom.xml file and the dependency has been added and also checked the nexus repository to find the same package.
If it could resolve the dependency while running the application while running, why could it not have found the dependency while trying to build it?
Also can you tell me what the difference between Run as spring-boot app and building the package is in springboot? and
Run as Spring-boot app -> Startup Embedded Tomcat server (or ThymeLeaf or Jetty) along with your spring boot application (Starts up IOC container, initializes beans , dependencies etc internally )
mvn clean package ->
mvn -> Maven command
clean -> Maven goal, which cleans (removes) classes, resources and artifacts available as part of Target folder
package -> Maven phase, which packages your application (In JAR or WAR whichever specified in POM) and puts the artifact in your local repository
Maven is a build tool i.e. It provides a basic structure of how your project should look like or be organized. For example, which file stays where, place for your external resources, dependencies etc
While, Spring-boot is a module of Spring framework which can be simply run as Java application
Read more on mvn here
https://www.journaldev.com/33659/maven-build-lifecycle-phases-goals#:~:text=Maven%20goals%20represent%20a%20specific,goals%20through%20the%20command%20line.&text=Here%20is%20an%20example%20to,goal%20from%20the%20command%20line.
Spring boot features and technicals here
https://spring.io/projects/spring-boot

spring project (from the spring initialzr plug in on the IDE) being Unloadable

When i create an spring project (from the spring initialzr plug in on the IDE) on netbeans 8.2 it ends up being Unloadable. How can i fix that problem?
This is the error i find:
Scanning for projects...
Downloading: http://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-starter-parent/2.4.3/spring-boot-starter-parent-2.4.3.pom
The build could not read 1 project -> [Help 1]
The project com.nexus:RegistroEmpleados:0.0.1-SNAPSHOT (C:\Users\RobotDyn\Documents\NetBeansProjects\InitializrSpringbootProject\pom.xml) has 1 error
Non-resolvable parent POM: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.4.3 from/to central (http://repo.maven.apache.org/maven2): Failed to transfer file: http://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-starter-parent/2.4.3/spring-boot-starter-parent-2.4.3.pom. Return code is: 501 , ReasonPhrase:HTTPS Required. and 'parent.relativePath' points at no local POM # line 5, column 10 -> [Help 2]
To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.
For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
This is my parent code:
4.0.0
org.springframework.boot
spring-boot-starter-parent
2.4.3
Maven dependencies are failing with a 501 error
Easiest way is to update Maven to version >= 3.2.3.
Update the Maven version repository:
Download the Apache Maven binary that includes the default https addresses (Apache Maven 3.6.3 binary). And open the Options dialog window in tools of NetBeans menu bar (Java Maven Dialog View). And select browse option in Maven Home List Box (Maven Home List Box View). After adding the Apache Maven newly downloaded version (Updated Maven Home List Box View), the project builds and runs successfully.

Jenkins: build failing because of third party jar : Could not find artifact com.oracle:ojdbc7:jar:12.1.0.1.0

On my windows machine: I have setup jenkins CI to automatically create build.
But every time build is failing because of the third party ojdbc7.jar file.
[ERROR] Failed to execute goal on project abc-cc-onboarding-repository: Could not resolve dependencies for project com.abc.cc:abc-cc-onboarding-repository:jar:1.0-SNAPSHOT: Could not find artifact com.oracle:ojdbc7:jar:12.1.0.1.0 in central (https://repo.maven.apache.org/maven2) -> [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]
When I manually build using: mvn -U clean build, everything works fine.
because I have manually installed ojdbc7.jar in the local repository (.m2)
Something is wrong with the Jenkins integration with maven.
Can anybody suggest on this?
Something is wrong with the Jenkins integration with maven.
No. That's not the problem. Jenkins integration with Maven works just fine.
The problem is that ojdbc7.jar is not in the Maven Central repo ... which is the default place that Maven looks. (Or at least, it is not in Maven Central not with those artifact "coordinates". There are some ojdbc artifacts with different coordinates. YMMV.)
The real problem is that Oracle don't want you to download Oracle JARs from Maven Central. Oracle want you to download from their Maven repo instead.
One solution is to do what you have been doing. Simply add the artifact to your local repo (or Jenkins' local repo for the project). But you are not happy with that.
The other solution is to configure the remote repos that Maven uses.
Here is a page that explains how to configure (stand alone) Maven to include the Oracle repo:
Get Oracle JDBC drivers from the Oracle Maven Repository - NetBeans, Eclipse & Intellij
For the Jenkins case, you need to configure the settings that the Jenkins server uses:
How to manage maven settings.xml on a shared jenkins server?
This lists various ways of doing this.
SOLUTION THAT WORKED FOR ME:
What i found after the analysis and it resolved my problem, hope it will help somebody like me.
Actually jenkins creates a separate repository for separate projects.
like if i have 10 project in my jenkins workspace then it creates 10 repository one for each project (inside the project on top level we can see that).
so now i installed manually ojdbc7.jar inside my jenkins project repo and it solved my problem.
The above error occurs mostly when Jenkins is unable to download the oracle jar.
To sort the above issue
Create the settings.xml and settings-security.xml files in Jenkins through the "Managed files" in the administration home. To do that follow this link - https://wiki.jenkins.io/display/JENKINS/Config+File+Provider+Plugin#ConfigFileProviderPlugin-Howitworks
NB: Ensure to put in your Oracle credentials in these two files. To do that follow this link - https://docs.oracle.com/middleware/1213/core/MAVEN/config_maven_repo.htm#MAVEN9017
In your jenkins project under configurations in Build Environments include this files under the option Provide Configuration files. As shown below:
Once done build it and it should work.

Do I need to install Apache Maven on my PC first, or is it enough to install the plugin in Netbeans to run a Maven project?

I build an Apache Project in java which runs fine on my laptop, now that I try to run the same project in Netbeans on my work PC I get an error:
Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (default-cli) on project aping: Command execution failed.
With a reference to:
For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
The Maven plugin in Netbeans was installed by default. When I tried to find out if the Apache version in the POM file was correct I tried to check the version on my PC with mvn -version I got the error:
'mvn' is not recognized as an internal or external command,
operable program or batch file.
Does this mean that Maven is not installed on my PC and should I also install Maven on my PC first in order to use the plugin, or should just installing the plugin be enough and do I have a different problem?
The error message you see is
Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (default-cli) on project aping: Command execution failed.
This is a message from the Maven executable embedded inside Netbeans (so Maven is running), saying that a specific maven plugin (here exec-maven-plugin) failed. This is most likely trying to invoke another program on your computer that is not installed so Netbeans (and hence the embedded Maven) can see it.
If you want to run maven outside Netbeans, you must download and install a copy and invoke the "mvn" binary inside.
You Have to install Maven To run Maven on your PC - http://www.avajava.com/tutorials/lessons/what-is-maven-and-how-do-i-install-it.html see how to install maven
in linux - http://www.mkyong.com/maven/how-to-install-maven-in-ubuntu/
I mistakenly assumed that the problem had something to do with Maven, the problem seems to be something in my source code unrelated to Maven. When I change some of the code the program is build succesfully

To build this project Maven (or greater) is required

I installed latest version of Netbeans (8.0.2) with Maven (4.27.1) installed as a plugin (so by default).
When I try to build latest version of optaplanner (6.3.0) I get exception
Building OptaPlanner examples 6.3.0.Final
------------------------------------------------------------------------
--- maven-enforcer-plugin:1.3.1:enforce (enforce-plugin-versions) # optaplanner-examples ---
--- maven-enforcer-plugin:1.3.1:enforce (enforce-java-version) # optaplanner-examples ---
--- maven-enforcer-plugin:1.3.1:enforce (enforce-maven-version) # optaplanner-examples ---
Rule 0: org.apache.maven.plugins.enforcer.RequireMavenVersion failed with message:
To build this project Maven 3.2.3 (or greater) is required. Please install it.
------------------------------------------------------------------------
BUILD FAILURE
--------------------------------------------------------------
Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.3.1:enforce (enforce-maven-version) on project optaplanner-examples: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed. -> [Help 1]
To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.
What can I do in order to build this project ?
4.27.1 can be a Netbeans Maven Plugin version, but not Maven version (there is no Maven 4 yet). You need to find out in settings what Maven is used and maybe install a new version in your system if you have Maven 2 (instead of 3) installed.
in the setting of intellij there is a option called maven, in which you can set the maven version intellij should use.
As I recall the default ist 3.10 or so but if you have maven installed (with an other version) you can select it in the intellij settings

Categories