Issue in Maven java swing build in Netbeans - maven

I am working on a Netbeans Maven Java Application in Netbeans. not able to build a java swing application. Dependency are not downloading in .m2 folder.

.
Add the above code in the setting.xml file (C:\Users\PC.m2\settings.xml)

Related

When is it a maven project?

When I download the .zip-file from start.spring.io, I download a maven-project, right?
Is it a maven-project, as soon as I use maven to manage my dependencies? Or is a maven-project something seperate, which I include into my project?
You have two possibilities:
1. To download a Maven Project from start.spring.io using Spring Initialzr.
2. To download a Gradle Project from start.spring.io using Spring Initialzr.
The project that you download from start.spring.io, in your case it's a Maven Project with all the selected dependencies already. You can recognize a Maven Project about pom.xml file where all the dependencies are included. So, all you must do after downloading the zip file from start.spring.io is to unzip the archive and after that to import the maven project (chosing the pom.xml file) in you IDE.

How to force NetBeans load Gradle project instead of Maven pom?

We have a project with both build.gradle script and an old maven pom.xml. Netbeans (8.0) will try to load the project as a maven project because of the existence of the pom.xml. Is there a way to force it to load the project as a gradle project using build.gradle? Thanks.
Nope, this is not possible in NetBeans. The simplest way is to remove/rename pom.xml. Maven support will ignore this folder in such case and it will be recognized.
I filled RFE for this - https://netbeans.org/bugzilla/show_bug.cgi?id=243778

maven does not copy dependencies

I have Dynamic Web Application project in eclipse that was converted to maven project.
Problem is that all dependencies are copied to:
<project>/target/<project>-SNAPSHOT/WEB-INF/lib
not <project>/WebContent/WEB-INF/lib
so when I run application from eclipse, there are no libs from maven and I get some errors.
I assume that application started from eclipse i.e on tomcat server gets it source from <project>/WebContent/WEB-INF/lib.
You should use m2e (Maven Plugin for Eclipse). It automatically adds Maven dependencies to the classpath, so you donĀ“t need them in /WEB-INF/lib while running from Eclipse.

Deploy MavenWebApp in Eclipse Tomcat

I have the following Problem:
I have a Maven MainProject with some SubProjects.
Two of this SubProjects are WebApplications. (One WebApp and one WebService)
If I build the MainProject in the command line with mvn clean package the 2 .war files are deployable in an external Apache Tomcat 6.0.
If I build the MainProject in eclipse with the m2e plugin i can also deploy the .war files into an external Tomcat.
BUT if i want to deploy the WebProjects in an Apache Tomcat in Eclipse, it doesn't boot.
The Problem is, that the file structure of the eclipse build for the internal Tomcat is different to the Maven one.
In the Maven build (console / m2e) the path is correctly from e.g. Project/src/main/java/com/... to WEB-INF/com...
The eclipse build for the internal Tomcat creates the structure like WEB-INF/main/java/com/...
So many of the .xml files which are mandatory for the Tomcat boot are not found bacause of the wrong path.
How can i tell eclipse that it should do the similar build like m2e or maven on command line so that i can use an internal tomcat in eclipse?
I am using
Eclipse Juno 4.2 or Helios 3.6
m2e - Maven Integration for Eclipse / 1.1.0.20120530-0009 / org.eclipse.m2e.feature.feature.group
Maven Integration for WTP / 0.15.2.20120306-2040 / org.maven.ide.eclipse.wtp.feature.feature.group
I fixed the problem.
The problem was the deployment assembly options in the eclipse projects.
Eclipse default option is to deploy /src to / folder.
Because of the maven structure /src/main/java/com the deployed folder also looks like /main/java/com.
I only had to change the source folder from /src to /src/main/java (the destination still remains /). If there are other necessary files i had to add them the same way, e.g. /src/main/resources.
The /src/main/webapp folder was already set correctly by eclipse to /WEB-INF

Using maven jetty plugin in multi-module project under Eclipse

I am working on a simple multi module maven project under Eclipse using m2eclipse with maven 3 and jetty plugin version 7. One of my module is a jar and the other module is a war which has a dependency on the jar.
Even though the workspace dependency resolution is enabled, the call to mvn jetty:run fails if I don't run mvn install before.
Having read about workspace dependency, I am not sure why a call to mvn install is required. I would like to be able to run the jetty plugin without installing the artifacts to my local repository. Is it possible?
Thanks in advance.
There is an integration module between m2eclipse and the WTP (Web Tool Platform).
WTP allow starting Jetty/Tomcat/... from Eclipse, debugging inside Eclipse, redeploy on change,...
Here is it: m2eclipse Extras

Resources