Could not find the selected project in the reactor Maven : Jenkins - maven

I’m using Jenkins to build a multi-module Maven project. Recently, I removed a module from our parent pom
when we run the build in Jenkins with the following options …
mvn -T 8C clean install -PTata
However, the build ultimately fails with the below error.
“Could not find the selected project in the reactor: com.customization:Avg”
Project Structure
- src
Customization
Tata
Avg
Qlip
Suggest to solve this issue...

Related

AEM 6.5 WKND repo build issues

I created a maven project in batch mode by typing the following command:
mvn archetype:generate -B -DarchetypeGroupId=com.adobe.granite.archetypes -DarchetypeArtifactId=aem-project-archetype -DarchetypeVersion=22 -DgroupId=com.adobe.aem.guides -Dversion=0.0.1-SNAPSHOT -DappsFolderName=wknd -DartifactId=aem-guides-wknd -Dpackage=com.adobe.aem.guides.wknd -DartifactName="WKND Sites Project" -DcomponentGroupName=WKND -DconfFolderName=wknd -DcontentFolderName=wknd -DcssId=wknd -DisSingleCountryWebsite=n -Dlanguage_country=en_us -DoptionAemVersion=6.5.0 -DoptionDispatcherConfig=none -DoptionIncludeErrorHandler=n -DoptionIncludeExaples=y -DoptionIncludeFrontendModule=y -DpackageGroup=wknd -DsiteName="WKND Site"
when I type mvn -PautoInstallSinglePackage clean install
I get the following error:
[ERROR] Failed to execute goal on project aem-guides-wknd.ui.apps: Could not resolve dependencies for project com.adobe.aem.guides:aem-guides-wknd.ui.apps:content-package:0.0.1-SNAPSHOT: Could not find artifact com.adobe.aem.guides:aem-guides-wknd.ui.frontend:zip:0.0.1-SNAPSHOT
From the error I guess and when I searched that there is no such artifactid in maven repository. Can someone please help me out here?
If your sole requirement is to build the wknd project, then just download the maven project from git and import it as a maven project in eclipse. After that build it. That should hopefully resolve your issue.
You have below options :
1.You Can check your root pom.xml file. There you can comment out ui.frontend module i.e. <!--module> ui.frontend </module-->. After hat you can run your package build command.
2. you can got to each sub-module like core,ui.appss and run following command to build individually mvn clean install -PautoInstallBundle
Let me know if this helps or will look into some other solution.
Inside parent pom.xml comment dispatcher module
example :
<modules>
<module>all</module>
<module>core</module>
<module>ui.frontend</module>
<module>ui.apps</module>
<module>ui.apps.structure</module>
<module>ui.config</module>
<module>ui.content</module>
<module>ui.content.sample</module>
<module>it.tests</module>
**<!--<module>dispatcher</module>-->**
<module>ui.tests</module>
</modules>

Want to only build specific submodules of a maven project

I have a multi module maven project with multiple levels of directory heirarchy. Normally we build the whole project, but have hit some resource issues building docker images (these are orchestrated from the maven modules), and a workaround is to create multiple build jobs, each of which builds a single image.
One option is to simply cd to the relevant subdirectory and build from there, but I would ideally like to use the 'mvn -pl' option, though am struggling with the useage
We use groupid 'org.odpi.egeria' & The pom is structured as
. (egeria)
open-metadata-resources (open-metadata-resources)
open-metadata-deployment (open-metadata-deployment)
docker (open-metadata-docker)
egeria (open-metadata-docker-egeria)
This is just one part of the tree to demonstrate the issue
Using the -pl option specifying directory names to build
Using the -pl option specifying artifacts to build
mvn -pl open-metadata-resources/open-metadata-deployment/docker/egeria clean install
mvn -pl org.odpi.egeria:open-metadata-docker-egeria clean install
In both cases I get:
[ERROR] [ERROR] Could not find the selected project in the reactor: open-metadata-resources/open-metadata-deployment/docker/egeria #
[ERROR] Could not find the selected project in the reactor: open-metadata-resources/open-metadata-deployment/docker/egeria -> [Help 1]

Maven default evaluation of the pom xml file

We do not have project design in parent and module way.We have project A and project B . Project A has dependency of project B . we passing the version of the dependency jar by command prompt in eclipse, Its compiling and install properly. but its pom shows always error.and error is like
Missing artifact
com.testdependency:testdependency:jar:org.apache.maven.model.Build#5ae16e48
Passed the build parameter by command line like -Dbuild. Is there any way resolve this ?
pom.xml would need the dependencies present in your local .m2 repository. If you don't install the dependencies to your local repository, pom.xml can't find them. So, run a build on your dependency project with goals selected as clean install, which should insall the artifact to your local repository. Then in your eclipse, right click on the main project and execute Maven -> Update Project. This should resolve your issue.
Refer to this link for the details on the repositories

How to skip some java files from compilation in maven using command line?

I am using maven with jenkins. On eclipse the project build works fine. When I use jenkins I get the following error
[ERROR] /E:/jenkins/workspace/product/src/test/java/com/new/ftp/FTPTest.java:[102,55] package com.fasterxml.jackson.databind does not exist
The options for maven are as follows:
mvn clean install -X
I want to know if I can pass some arguements to maven to skip that package. I don't want to modify my pom.xml yet .
P.S - The project consists of a main pom.xml which calls other child modules.

How to update the version of Maven used by IntellijIdea

I try to open the Maven project in IntellijIdea. This project uses spark and scala. When I run:
mvn clean install -DskipTests
then it gives the error:
[ERROR] Failed to execute goal
org.scalastyle:scalastyle-maven-plugin:0.7.0:check (default) on
project spark-mllib_2.10: Failed during scalastyle execution: You have
50 Scalastyle violation(s)
I think that the problem is in the version of Maven. Indeed in IntellijIdea Settings I have the version Bundled (Maven 3) 3.0.5, while pom.xml defines <maven.version>3.3.3</maven.version>
If I run mvn -version in terminal, it points Maven 3.3.3
So, how can I update the version of Maven used by IntellijIdea?
Install the new version of maven (If not already installed)
Go to File -> Settings and use the search bar to find maven settings
Edit the Maven home directory setting so it points to the installation folder of the desired version
It may sometimes happen that after configuring maven in Intellij and changing as following it does not work by command build, so build it by Intellij maven tool.
Setting > Maven > Importer - select the JDK
Setting > Maven > Runner - select the JRE
After that, try to build by Intellij maven tool instead of Intellij console.

Resources