Maven project build faild [closed] - maven

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 3 years ago.
Improve this question
When I create a maven project on Netbeans 8.0.2 it gives the following error and the build fails:
No plugin found for prefix 'archetype' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\Users\user1.m2\repository), central (http://repo.maven.apache.org/maven2)] -> [Help 1]
How can I solve this?

Your version of NetBeans (8.0.2) uses bundled maven which doesn't support a new requirement of using https with the Maven Central Repository.
You can:
Update to NetBeans 11.0 LTS (or 11.2)
Download and install last version of standalone maven
Please, see the detailed answer here.

Check if your firewall is blocking to access the maven repo, and allow it if so. You can check this answer.

Related

Cannot resolve dependencies in spring boot when creating a new application [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
Error occurs when creating a new application n try to download n build dependencies for the app. I Cannot resolve dependencies when creating a new spring boot application in intellij.
Resolve dependencies error
Cannot resolve org.apache.tomcat.embed:tomcat-embed-core:9.0.50
Cannot resolve org.springframework.boot:spring-boot-test-autoconfigure:2.5.3
Cannot resolve org.springframework.boot:spring-boot-test:2.5.3
Cannot resolve mysql:mysql-connector-java:8.0.26
Cannot resolve org.springframework.boot:spring-boot-starter-test:2.5.3
Cannot resolve org.springframework:spring-jcl:5.3.9
Cannot resolve org.springframework:spring-test:5.3.9
How do i solve these issues. Spring boot 2.5.3
You will have to go to your .m2 folder on your machine depending if you are using windows it should be in
C:/Users/username/.m2 and delete the content of that folder.
Of course, you need to be sure that you have dependencies in your pom.xml that are complaining about, if you do have all dependencies, you can go to the next step.
Go back to your IntelliJ and you can run two maven commands ( clean, install ), you can either run them from the terminal of your IntelliJ, or you can run them from maven UI which is located on the top right side of the IntelliJ, next to database UI.
try this two things
1> building project from console,if not work.
2> if it is a new project try to create project create project using spring initilizr
second approach is recommended.

ANT Vs MAVEN comparison with respect to Build time [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 months ago.
Improve this question
We are currently using ANT as our build tool and we are proposing our developers to use Maven as their build tool.
Our developers are resisting this change and asking us to give the benefit we will achieve by migrating to Maven. From the blogs what I read Maven can help in reducing build time when compared with ANT.
Can you please give us any reasoning how MAVEN Build script can reduce the build time when compared to ANT? Is this statement true in the first place?
NOTE: Ours is a legacy application that is developed in Core Java.
Are there any other powerful features in Maven which might pique interest of developers that can help us get their confidence in migration to Maven?
Transitive dependency resolution, standardised builds, lots of plugins, works with Maven repositories which are the de facto standard for storing Java artifacts.
maven can be faster than ant, if you know how to
structure your code into modules
use parallel build of (multiple) modules (a feature ANT really don't has)
use semi-incremental build (use newest compiler-plugin) - build only modules, which have changed files or which depend on other changed modules
other benefits are
maven can help you, to describe your build in a more standardised and structured way
standard project layout (folder src/main/java src/test/java ...)
clear build-process with a strict path of executed steps
clear definition of used dependencies
thirdparty dependencies
in-project dependencies
many helpers for a clear CI/CD setup like
plugins supporting gitflow
plugins supporting special release processes
plugins supporting integration-testing

Plugin for JIRA throws errors in 7.4.1 but runs well in 7.4.2 [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 3 years ago.
Improve this question
I want to port my plugin for JIRA to make it compatible with JIRA 7.4.x
When I change the version of JIRA to 7.4.1 in pom.xml I get the following compilation errors:
package com.atlassian.crowd.embedded.api does not exist
package org.apache.velocity does not exist
package org.apache.velocity.app does not exist
package org.apache.commons.codec.binary does not exist
class file for com.atlassian.crowd.embedded.api.Group not found
class file for com.atlassian.plugin.web.Condition not found
When I set the version to 7.4.2, I can compile the plugin, and also run it in JIRA without problems.
Here is a paste with properties and dependencies of my pom.xml.
What can we do to make the plugin also compatible with JIRA 7.4.1 ?
Thanks :)
I have started with atlassian plugins and development a while ago, and I think that some parts of those packages are added in 7.4.2, so they are not usable in 7.4.1 (this is my opinion). I can only give you my opinion since I've had the problems with atlassian sdk myself and had to solve them alone since the documentation on official atlassian is not so great.
I found this article and this one with the similar problem to yours, you can check it out since it's marked as "solved", hope it will help you.
I had to add <import-package> instructions in the maven-jira-plugin in my pom.xml to solve this.
Docu: https://developer.atlassian.com/docs/advanced-topics/configuration-of-instructions-in-atlassian-plugins
Also this answer solved my further classpath / dependency errors.

Purpose of POM.xml in Maven [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am very new to Maven. I have the following questions:
Do we need to create POM file our own?Do we need to understand POM file fully to use Maven?
We are mentioning Plugin in the POM. will that plugins only be downloaded by Maven when use Maven? or by default all plugins will be downloaded?
Please explain.
First you need to understand the pom content otherwise you are not able to influence the build process. The pom file should be created manually but there are some exceptions like Spring Roo which will create the pom but it's better to understand the pom to see if something is going wrong.
The plugins mentioned in the pom will be downloaded automatically by Maven but there are plugins which are by default in the life cycle which will be downloaded as well in contradiction to naming them in the pom file.
You need at least to understand some basics of Maven: dependencies, how to configure plugins, how to start a new POM (you can do this in IDE or create a project from an archetype), basic commands: mvn compile, mvn package, mvn install. If your only need is to build your classes into JARs, Maven configuration would be as small as a list of dependencies.
Everything in Maven is downloaded by default - all artifacts are being searched in Central and any other configured repositories. Once downloaded, they are stored on your machine at $HOME/.m2/repository.
Might be helpful: Maven Quick-start Guide.

Unstable build with Maven+Nexus+Jenkins

I have a build environment with Maven3.0.4, Nexus 2.2 and Jenkins 1.508. To support an active and dynamic development environment, all artifacts in my solution use snapshot version and maven tries to get latest snapshot on every build.
The build is not that smooth as expected. Main problem is sometimes build fails due to unresolvable dependencies, and the solution is just re-run the job.
I am suspicious that it is caused by bottleneck in Nexus server in peak load, which causes Maven unable to retrieving pom files during build. But I have no idea about how to diagnose and fix the issue. Anyone has a good idea?
This question has been answered. Please refer to Does Maven build "thread safe" for snapshot projects?.
B.R.

Resources