Invoking Actions other than Build and Clean & Build - maven

I am new to NetBeans and am trying to define and run various custom goals for my Maven proj. My Maven proj uses a number of plugins; once for building the Java classes, another for pre-compiling JSPs, another for building an OSGi bundle, and another for deploying to my dev app server.
It seems that by default, NetBeans has Build, and Clean & Build as easily accessible "build options" in the main toolbar bar. These trigger the install goal which runs through the entire build processes (compiles everything and deploys to my dev).
In NetBeans, I can edit the Properties for the project, and define a "development" profile, and then define custom actions (or modify the default NetBeans actions).
How do I:
Invoke Actions that aren't Build or Clean & Build in NetBeans
Define only certain goals for specific plugins to run, and invokes those actions.

First go to the Project Properties > Actions and create your MVN build
The above will run:
mvn install -P initdb,initdb-qa -DskipTest=true -Dprop.name=dev
Then it will become available under "Custom"

This is really just a comment on #Ev0oD's answer, but I want to add an image so it has to be a separate answer.
After I created the toolbar button using:
Tools -> Options -> Java -> Maven -> Execution -> Edit Global Custom Goal Definitions
I then had to add the button to the toolbar using:
View -> Toolbars -> Customize (or just right click the toolbar header and select Customize)
I could then see the new button in the "Maven" group in this dialog:
I then had to drag the button onto a toolbar as shown. Note: Don't try to drag it to the blank part on the right of the toolbar header as this won't work.

If you want to use some custom goals on more projects and you want to have a quick access to them, you can use global custom goals, that are present in NetBeans 8.0.1 (not sure in which version they were introduced).
Access Tools -> Options -> Java -> Maven -> Execution -> Edit Global Custom Goal Definitions...
There you can add many of these and they will be present for all projects in the Custom section, as shown in the accepted answer.
A good thing is you can add it also to the Toolbar by clicking (Show in toolbar) and selecting one of six different colors of icon available. You will end up with something like this:

alternatively you can use the Custom popup on project node and within the Custom... action's dialog, setup goals for execution and eventually remember the setup for subsequent executions. The remembered item will appear in the same popup menu. For global (for every project) goal definitions, please see the global options.

Related

Error raised while performing clean install in maven (IntelliJ)

cannot access default field of properties
I tried to clean and reinstall and also manually tried to override plugin in Pom.xml
In the right sidebar, you will see the maven tab:
click it -> you'll see something like in the picture -> click on generate sources (the second top icon)

Eclipse RCP: Accidently added plugins that contribute to UI

So I accidently added a few plugins, whichs name I have forgotten to the runtime configuration of my application. Since then a ton of not needed contributions to the UI where made:
Help-> "Like 5 new links"
New Entry "Window"
Menu-Icon-Bar: Open Task, Create new visual class.
I'm unable to figure out what the responsible plugins are (There are about 300 plugins selected). If you happen to know which plugins make these contributions please let me know.
You can get the minimum set of plugins needed for your RCP using:
Open the Run Configuration for the RCP.
Go to the Plug-ins tab.
Click Deselect All
Select your plug-ins in the Workspace
Click Add Required Plug-ins
You should end up with just the plug-ins required. Use the -clean option on the next run to make sure the plug-ins cache data is rebuilt.

Build Phase Tab Hidden or Missing

I'm probably asking a very elementary Xcode question, but here it goes. My layout has no 'Build Phase' tab. I might have inadvertently changed my layout. A lot of tutorials state that you should go to the Build Phase tab and link to a library. Well, I've Clicked on the Target, and the File under the Target, Searched the Toolbar, searched the project settings, Info. When I right click on the Target File I get a list including "Copy Build Phase" and Add Build Phase, but that's not giving me access to the Build Phase Tab. I've tried 'reset to default or factory layout'.....Build Phase Tab. How can I display the layout with a Build Phase tab in the toolbar, and save it to utilize in my projects? By the way I'm using XCode 3.2 maybe it's a version limitation?
It sounds like those tutorials are for Xcode 4. For your version, if you open the target in the sidebar, there should be some groups. Those are your build phases. Just drag the library into the one that says something like "Link Executable", or click the checkbox to add it to your target and it should go there automatically.

Why does VS force my build to x64?

Before I build, I choose x86 (or Any CPU, too) in the Properties tab for the project.
I save these properties, and if I re-open the Properties tab it's back to x64 as the platform and target, why?
Choosing a build configuration in Properties doesn't actually change the active build configuration. It only allows you to switch between the various build configurations that are defined for your project so that you can edit the settings for each of those configurations. It's only a configuration selector.
The easiest way to change the active build configuration is using the drop-down boxes on the toolbar:
Those commands should be present in your toolbar by default. If you don't see them, follow these steps to get them back where they belong.
Make sure that your .csproj file is not readonly.
Make sure that your changing the build target, not the configuration selector.

Xcode : Adding a project as a build dependency

Im playing around with the soundcloud api, in its instructions it says to
drag SoundCloudAPI.xcodeproj into your project
add it as a build dependency
I can drag the project in pretty easily, but how does one accomplish the next step?
To add it as a dependency do the following:
Highlight the added project in your file explorer within xcode. In the directory browser window to the right it should show a file with a .a extension. There is a checkbox under the target column (target icon), check it.
Right-Click on your Target (under the targets item in the file explorer) and choose Get Info
On the general tab is a Direct Dependencies section. Hit the plus button
Choose the project and click Add Target
Select your project in the navigator on left.
Open up the drawer in the middle pane and select your target.
Select Build Phases
Target Dependencies is an option at that point.
Tough one for a newbie like me - here is a screenshot that describes it.
Xcode 10.2.1
Under TARGETS in your project, right-click on your project target (should be the same name as your project) and choose GET INFO, then on GENERAL tab you will see DIRECT DEPENDENCIES, simply click the [+] and select SoundCloudAPI.
Just close the Project you want to add , then drag and drop the file .
Xcode add a project as a dependency
Xcode 10
drag-n-drop a project into another project - is called cross-project references[About]
add the added project as a build dependency - is called Explicit dependency[About]
//Xcode 10
Build Phases -> Target Dependencies -> + Add items
//Xcode 11
Build Phases -> Dependencies -> + Add items
In Choose items to add: dialog you will see only targets from your project and the sub-project
Today I faced with the same problem.
As the result of the first run I got next error:
Lexical or Preprocessor Issue: 'SDKProjectName*/*SDKProjectName.h'
file not found.
But before running, I, obviously, added my SDK into the demo project, just drag&drop .xcodeproj file into my test project's source tree. After that, I moved into Build Phases tab in setting of the main xcodeproj file (of the demo) and added my SDK as target dependency and embed framework into corresponding tabs.
But at the result, I got an error above!
So, the problem was into empty line on the Header Search Paths option. I just wrote "../**" as value for this key and project compiled successfully. So, after that, you can add #include <SDKName/SDKName.h> into any project, which includes this SDK.
ps. My test app was created into root SDK folder.

Resources