Eclipse build path is incorrect using maven - maven

I am working on to run the WebObjects project using maven. I build and run the project successfully but the problem is that the execution directory path is from build folder, not target folder. For example: - X:\WOMavenProject\ProjectName\build\ProjectName.woa\..... But it should be target in place of build.

Is maven building the project, or are you getting it invoked with maven? The phrase "I am working on to run the ... project" is not clear.
If the WOLips Incremental Builder is being used to build the project, it will pu the build products into the build directory.
When I use the Ant Builder, it builds into dist.
Presumably you have installed the Maven Builder. I assume here is one, but I have never used it. How is it configured? Does the Builder allow you to specify where the build products will appear?

Related

Maven Build Scripts Found - IntelliJ - What are the build scripts, where are they cached?

So basically, as the title of the post states, I'm wondering what IntelliJ is referring to when it says that Maven build scripts were found? Are these scripts that Maven keeps cached or are they IntelliJ specific? If they are generated by Maven, where are they stored/ how can I view them if that is possible?
Thanks!
This notification is to inform you that you are working with IntelliJ IDEA project that is not linked to the external build system (Maven or Gradle).
When you open a project in IntelliJ IDEA that was not initially imported from Maven/Gradle and IDE detects pom.xml or build.gradle files in the project, it will display a notification so that you can properly import the project from the build script.
Build script in your specific case is a pom.xml file stored inside a project directory. It's recommended that you open Maven projects by importing the root pom.xml file.
When a project is not imported from the external build system, your source roots configuration may be incomplete and you may be missing the dependencies.

Can I run IntelliJ unit tests in a maven project without re-running maven goals?

I have a project with a deep maven structure and am evaluating switching from Eclipse to IntelliJ.
I've imported the top-level pom.xml. I know that I can:
Build the whole project with maven goals (I use 'test-compile' to build the test classes)
Run the tests from the IntelliJ test runner. This seems to find the classes/test-classes from the target folder of the project.
However, I would like to just change a test or the code under test, save it, and rerun it without having to manually run the maven test-compile again (like I could with Eclipse). Is this possible with IntelliJ?
I think the issue is that the IntelliJ 'Build Project' action does not build the test classes (and other classes) into the target folder that the test runner looks in.
If you import a Maven project in IntelliJ IDEA, you will be able to build and run the tests from the IDE instead of Maven which is a lot faster because of the incremental compilation.
Make sure this option is disabled and use JUnit Run/Debug configuration, don't run the maven goals.
Thanks to the suggestion from #CrazyCoder, I was able to get this working by following these steps, as I think the issue was Eclipse artifacts fighting with IntelliJ artifacts:
Remove all .classpath, .project and .iml files from the entire code tree
Remove .idea from the root - we need to start again
Open the top-level pom.xml in IntelliJ
If needed, perform a mvn compile (needed for me due to some generated sources)
Rebuild your project
After this, don't open your project in Eclipse again!

war already exists issue with maven and Team Foundation Server

I am using Maven build tool and Team Foundation Server in my J2EE project.
while I am doing the maven clean for the project, build success But when I am doing the maven install for the same project build is a success but in eclipse console, I am getting an error like
The item $/ProjConnect/Main/source/ProjWeb/target/test.war already
exists
I am new to maven and Team Foundation Server.
Is this error regarding maven or Team Foundation Server?
and Please help me to resolve this error.
The clean phase, per convention, is meant to make a build
reproducible, i.e. it cleans up anything that was created by
previous builds. In most cases it does that by calling
clean:clean, which deletes the directory bound to
${project.build.directory} (usually called "target")
According to the error, the $/ProjConnect/Main/source/ProjWeb/target/test.war should generated by a previous build. Without clean option the file will not deleted during the build pipeline. More details please take a look at this question: How is "mvn clean install" different from "mvn install"?

How to deploy custom JavaScript rules in Sonarqube?

I recently happened to work on Sonarqube version 5.3. I installed it and the Sonar server is running fine, I even analysed some code and installed some plugins, but now I want to define some custom rules in JavaScript. I downloaded the sample code from Sonarqube website for custom rule in JS.
The downloaded folder has one pom.xml and src folder. I don't know how to deploy this custom rule, somewhere I read that I need to create .jar file and place it in "extension/plugins" folder. I am stuck here: I don't know how to generate .jar file.
You've downloaded the source code, which is a Maven Project, now you should build the plugin with Maven (mvn).
See SonarQube documentation on Building Plugins.
When you download the "javascript custom rule" project from https://github.com/SonarSource/sonar-examples/tree/master/plugins/javascript-custom-rules
You can see that it's a Maven project as it has pom.xml
Now you have 2 option to create .jar out of this project.
Option#1: Open this project in Eclipse and do "Run==> maven Clean" and then "Run==> maven install"
It will generate a .jar for you which you can see in Eclipse console.
Option#2: Open Linux terminal or windows cmd, ensure that you have maven installed. Go to the project path where pom.xml is there and invoke command: "mvn clean install"
It will generate a .jar for you which you can see in console.
Thanks !

is it possible to do a Maven build using Build Forge?

Is it possible to do a Maven build using Build Forge? Currently we use Build Forge, ClearCase and ClearQuest with Ant scripts; would like to try a Maven build. Not sure if I can I have no test environment so don't want to mess up any thing and still learning all this stuff too
Maven can be invoked from any build automation framework.
Create a buildforge step that invokes your Maven build as follows:
mvn -s /path/to/maven/settings/files/mysettings.xml clean package
Explicitly selecting the settings file is recommended as this enables you customise the Maven configuration for each project.
Project isolation can be further enhanced by ensuring that each project has it's own local repository location (See the "localRepository" parameter in the settings file documentation)

Resources