How to use Netbeans "Actions" in a maven project - netbeans

In a Netbeans 15 maven project, I can view/configure "Actions" for the project inside the project properties:
However, I cannot find where in Netbeans I can execute these actions on the project
I see that Custom actions do show up under right click --> Run Maven. But all of the default actions are missing.

Related

How to Run/Debug a Ant Project in directly in tomcat through Eclipse?

In this project ....
Web.xml is located under Project Folder > web > Web-INF > web.xml
This project is already created by or clients and we are maintaining it.
Actually we do the build using the build.xml script using ant, it will generate a app.war then we will deploy it in tomcat to run.
In the above process there is no way i can debug the code.
More info:
This is not a struts project, it is Spring MVC project
Why don't you add Ant plugin to eclipe and run it through eclipse?
Help: How to run ant project in eclipse
Running Ant buildfiles
To run an Ant buildfile in the Workbench:
In one of the navigation views, select an XML file.
From the file's pop-up menu, select Run Ant.... The launch
configuration dialog
opens.
Select one or more targets from the Targets tab. The order in
which you select the items is the order in which they will run. The
order is displayed in the Target execution order box at the bottom
of the tab. You can change the order of the targets by clicking the
Order... button.
(Optional) Configure options on the other tabs. For
example, on the Main tab, type any required arguments in the
Arguments field.
Click Run.
or Check this answer
Want an eclipse java project to run ant build files automatically

github project not launching as web app inside eclipse

I have eclipse mars installed with the egit plugin. It successfully downloads projects from github, but how do I convert the downloaded github projects into eclipse maven web projects that can successfully launch via Run As ... Run on server in eclipse?
Let's take this two step authentication project on github as an example. How do I get this project to launch from eclipse using Run As.. Run on server?
Here are the steps I took so far:
1.) Right click on white background of eclipse Project Explorer.
2.) Choose Import > Import ...
3.) Select Git > Projects from git from the resulting dialog box
Click Next
4.) Select Clone URI then click next again
5.) Enter the following in the URI field: https://github.com/kyleboon/two-step-authentication-example
6.) Click Next
7.) Click Next Again
8.) Click Next a Third time
9.) Select Import using the new project wizard. Then click next again.
10.) Select maven project and import
11.) Right click on root of resulting project in eclipse Project Explorer and choose Properties.
12.) Select Project Facets
13.) Enable Project Facets
14.) Select Dynamic Web Module to make it a dynamic web project. Click OK.
15.) Right click on project root in eclipse Project Explorer. Select Maven download sources, then Maven update project.
16.) Right click on project root in eclipse and choose Run As...Run on server
The result is that tomcat gives a 404 error when it launches the following url: http://localhost:8080/two-step-authentication-example/
So what steps do I do instead in order to successfully launch this specific github project in eclipse using Run As...Run on Server? This question is general for all github web projects, but we are using this specific project as a case study to test a method that will be repeatable for other github projects.

Eclipse add source files to package explorer

I checked out a Maven project folder from SVN. It is coming up as folders in the Package Explorer, and when I right click -> Build Path -> no actions available.
Is there anyway to add the source folder to appear as a package?
The project is not set up as an Java or Maven project inside Eclipse. You can apply the Maven and Java nature afterwards in the project properties, you could run mvn eclipse:eclipse outside of Eclipse and import the created Eclipse project into your workspace (it could even exist as option in the project's context menu under "Maven", depending on how the project is setup right now).
Or, much easier, you just checkout a Maven project from SVN. Within the "New Project..." dialog there should be an option "Maven > Check Out Maven Projects from SVN". Then it will be configured automatically.

How do I configure a Java EE maven project in Eclipse?

I know Maven pretty well, but I usually work with Netbeans, which makes it quite easy to deploy Java EE applications - and handle hot deployment of any changes.
The team I work with now uses Eclipse as their IDE of choice, but none of them has worked with Maven projects before; so I need to know how to correctly add Eclipse's project facets to the maven projects we have, in order to support (hot) deployment through WTP. We are using Weblogic 12c for this particular endeavour.
Our project layout is as simple as it gets:
super-project (pom)
project-ear (pom)
project-ejb (pom)
project-web (pom)
Thanks for any resource you can point me to.
I suppose that you've installed all required plugins to the Eclipse already. As #MichaƂ Politowski mentions, M2E, M2E-WTP and so on.
Add Archetype Catalog
Go to menu Window--->Preferences.
At the Preferences window, select Maven---->Archetypes,
On the Right Panel, click Add Remote Catalog... button.
At the Remote Archetype Catalog windows enter the following: -
Catalog file: http://repo.maven.apache.org/maven2
Description Maven Central
Add more remote catalog.
Catalog file: http://download.java.net/maven/2
Description Java.Net
Click OK to apply change.
Create the parent project
Go to menu File ---> New ---> Other.
At the Select Wizard Windows, select Maven ---> Project.
Click next and enter the required information so that we are at the New Maven Project.
At the Filter textbox, enter pom
Choose org.codehaus.mojo.archetypes:pom-root:1.1
Click next and enter the required information so that the parent creation is finished.
Create the child project
Right click at the parent project and select New ---> Other.
At the Select Wizard Windows, select Maven ---> Project.
Click next and enter the required information so that we are at the New Maven Project.
You will see that the Parent Project = MY PARENT
Enter the Module name, e.g. my-ear, my-ejb or my-web. Then click Next button,
At the Filter textbox, enter some of the following
org.codehaus.mojo.archetypes:webapp-javaee6:1.5
org.codehaus.mojo.archetypes:ejb-javaee6:1.5
org.codehaus.mojo.archetypes:ear-javaee6:1.5
Click next and enter the required information so that the child creation is finished.
Summary
I've used both NetBeans 7.x and Eclipse Juno together. When I move to Eclipse I've face the issue as same as your. Then I've captured the steps above from NetBeans logs one by one, and do the same thing manually by using Eclipse.
I hope this may help.
I would make one small change:
Create the child project
Right click at the parent project and select New ---> Other.
At the Select Wizard Windows, select Maven ---> **Maven Module**
This way it will automatically recognize this as a child project of the parent.

Maven dynamic web project in eclipse deploys invalid jar files for dependent project(s)

I have a maven web project that imported into eclipse. I have another maven project (generates a jar file) that the web project depends on.
Both of these projects work correctly when executed from the command line. mvn package creates a war file which pulls the jar it depends on from the maven repository for the web project. mvn package creates a valid jar file when run for the library.
When I import the library into Eclipse, m2e recognizes that the web project depends on the library and updates parts of the project to take advantage of the fact that both maven projects are hosted within a single Eclipse workspace. The "Maven Dependencies" section of the "Libraries" tab of the "Java Build Path" preference for the web project removes the library jar file and replaces it with the library project. As the library is updated in Eclipse, the web project recognizes those changes without having to install/deploy the library.
The problem occurs when I attempt to run the web application in Eclipse. Because Eclipse is actually building the Web project against the version of the library in Eclipse, it does not deploy the library file from the maven repository, it creates a new jar file that's a snapshot of the current version of the library in Eclipse. All of this has generally worked well for me, but on the project I'm currently working on there's a problem with the jar file that Eclipse is creating. Instead of inserting the class files for the library, it appears that it's taking the "src" directory of my Maven project and zipping it up as the jar file. The contents of the jar file look something like:
-main
-java
-com
-... *.java
-resources
-...
-test
-java
-com
-... *.java
Where I would expect it to look more like:
-com
-... *.class
Since I have successfully used this type of project before, I'm trying to figure out if there's something I need to configure or if I've just run into a bug.
I'm using the latest update of m2e (1.0.200.20111228-1245) on Eclipse Indigo (Build id: 20120216-1857).
In Eclipse, we can disable the "Workspace Resolution" so that it will use our dependencies directly from the local maven repository as the following steps: -
Disable Workspace Resolution
Right click at the project inside the eclipse
Select "Maven" from the context menu.
If it display "Disable Workspace Resolution" which means it is enable. We click it with purpose to disable it. Please note, after that it will display "Enable Workspace Resolution" which means we have disabled already.
We may need to update the project configuration and other related dependencies as the following steps: -
Update Project Configuration
Right click at the project inside the eclipse
Select "Maven" from the context menu.
Click the "Update Project Configuration..."
The "Update Maven Dependencies" windows will be displayed.
Select the required projects and click "OK".
Update Dependencies
Right click at the project inside the eclipse
Select "Maven" from the context menu.
Click the "*Update Dependencies"
The "Update Maven Dependencies" windows will be displayed.
Select the required projects and click "OK".
Please take a note, since we not use the related dependencies directly from the workspace anymore, It will use directly from our local maven repository. Then all related artifacts should be installed to our local maven repository by using the following command line.
mvn install
Anyhow it can be done by using the context menu inside the Eclipse as the following steps:-
Right click at the project inside the eclipse
Select "Run As" ---> "Maven Install".
Here's the solution that I came up with.
It appears that in my case the rules for the "Deployment Assembly" for the library project are still followed.
To change it go to the library properties->Deployment Assembly
In my case that just contained a mapping from '/src' -> '/'. I removed that entry and replaced it with a mapping from '/target/classes' -> '/' and '/src/main/resources' -> '/'.
Once I had that mapping in place, when the jar file was deployed it contained exactly what I had configured in the Deployment Assembly. That allows Eclipse to continue to be used without explicitly republishing the library for every change. But, it doesn't seem to auto redeploy to tomcat for me when the library is updated -- I still need to manually restart tomcat for library changes to be reflected.
It's still not entirely clear to me what's going on with this project. I do have previous projects that have a similar structure, and in those projects the Deployment Assembly has not been updated to explicitly include the class files and yet the proper jar file is still deployed.