No goals have been specified for this build. You must specify a valid lifecycle phase | INTELLIJ - scala

I have cloned one of the project from git to IntelliJ , I am new to all this and facing alot of difficulty.
code I am trying ( just a demo code)
import org.apache.spark.sql.SparkSession
SparkSession.clearActiveSession()
SparkSession.clearDefaultSession()
val sparkSessionParams = SparkSession.builder()
.appName("Master_Case_Policy")
.enableHiveSupport()
.getOrCreate()
import sparkSessionParams.implicits._
class master_case
{
var recordcounts = ""
var notifymsg = ""
/*logger.info("Starting the count calculation for member policy")*/
val updateddate = sparkSessionParams.sql(s"select distinct update_dt from
clinical.mbr_cse_pol_ref SORT by date(update_dt) DESC LIMIT 3")
notifymsg = s"Updated Records : $updateddate"
}
ERROR:
"C:\Program Files\AdoptOpenJDK\jdk-8.0.292.10-hotspot\bin\java.exe" -Dmaven.multiModuleProjectDirectory=C:\Users\sbhatt56\IdeaProjects\CASE_DETAIL_FACT "-Dmaven.home=C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 2021.2.2\plugins\maven\lib\maven3" -Didea.modules.paths.file=C:\Users\sbhatt56\AppData\Local\JetBrains\IdeaIC2021.2\Maven\idea-projects-state-fea32a82.properties -Dclassworlds.conf=C:\Users\sbhatt56\AppData\Local\Temp\idea-2-mvn.conf "-Dmaven.ext.class.path=C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 2021.2.2\plugins\maven\lib\maven-event-listener.jar" "-javaagent:C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 2021.2.2\lib\idea_rt.jar=64235:C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 2021.2.2\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 2021.2.2\plugins\maven\lib\maven3\boot\plexus-classworlds-2.6.0.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 2021.2.2\plugins\maven\lib\maven3\boot\plexus-classworlds.license" org.codehaus.classworlds.Launcher -Didea.version=2021.2.2
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.optum.csgbdptenant.clinical.cdf:Clinical_CDF:jar:4.0-SNAPSHOT
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.apache.hbase:hbase-spark:jar -> version 1.1.8-mapr-1710 vs 1.1.8-mapr-1904 # line 156, column 21
[WARNING] 'dependencies.dependency.systemPath' for com.optum.csgbdptenant.Common:Common:jar should not point at files within the project directory, ${project.basedir}/jars/Common-6.4.jar will be unresolvable by dependent projects # line 172, column 25
[WARNING] 'dependencies.dependency.systemPath' for PBEEncryption_Optum:PBEEncryption_Optum:jar should not point at files within the project directory, ${project.basedir}/jars/PBEEncryption_Optum.jar will be unresolvable by dependent projects # line 180, column 25
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-surefire-plugin is missing. # line 234, column 21
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-jar-plugin is missing. # line 209, column 21
[WARNING] 'build.plugins.plugin.version' for net.alchim31.maven:scala-maven-plugin is missing. # line 222, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.132 s
[INFO] Finished at: 2022-03-26T11:46:23+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoGoalSpecifiedException
Process finished with exit code 1
I can also attach my POM.xml if needed. I am not even able to locate my build.xml
Thanks in advance !!

Related

Сan't run examples. Couldn't find artemis.home error

I get an error when I want to run any example through mvn verify
[ERROR] ********************************************************************************************
[ERROR] Could not locate suitable Artemis.home on either D:\Documents\IdeaProjects\activemq-artemis\examples\features\standard\security\..\..\..\.. or D:\Documents\IdeaProjects\activemq-artemis\examples\features\standard\security\..
\..\..\..\artemis-distribution\target\apache-artemis-2.18.0-SNAPSHOT-bin\apache-artemis-2.18.0-SNAPSHOT
[ERROR] Use the binary distribution or build the distribution before running the examples
[ERROR] ********************************************************************************************
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.087 s
[INFO] Finished at: 2021-02-26T22:03:39+03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.activemq:artemis-maven-plugin:2.18.0-SNAPSHOT:create (create) on project security: Couldn't find artemis.home -> [Help 1]
I tried to specify the path to the directory with artemis at startup, but it does not help mvn verify -Dartemis.home="D:\Documents\apache-artemis-2.17.0"
How to fix this error?
It appears you're running the example directly from the project source since it reports 2.18.0-SNAPSHOT. If that's the case then you should do what the ERROR message indicates:
Use the binary distribution or build the distribution before running the examples
You can get a snapshot binary distribution here or you can build the distribution from the source using mvn install -Prelease -DskipTests.
If you must point the example at a different home directory you can do so using the activemq.basedir system property, e.g.:
mvn verify -Dactivemq.basedir="D:\Documents\apache-artemis-2.17.0"
Or you can change the activemq.basedir property defined in the example's pom.xml.

Library cannot be resolved

When I package Scala project using SBT, I face the following problem:
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
[info] Loading project definition from D:\marathon-master\project
Version '20170916T025229' is not fully supported, please update the git tags.
[info] Set current project to marathon (in build file:/D:/marathon-master/)
[info] Constructing RAML model
java.lang.RuntimeException: Library cannot be resolved: D:\marathon-master\docs\docs\rest-api\public\api\appContainer.raml -- D:\marathon-master\docs\docs\rest-api\public\api\v2/types/app.raml [line=6, col=17]
at scala.sys.package$.error(package.scala:27)
...
[error] (marathon/compile:ramlGenerate) Library cannot be resolved: D:\marathon-master\docs\docs\rest-api\public\api\appContainer.raml -- D:\marathon-master\docs\docs\rest-api\public\api\v2/types/app.raml [line=6, col=17]
And the 5-7 lines code in app.raml like that:
uses:
appContainer: appContainer.raml
artifact: artifact.raml
the directory of app.raml and appContainer.raml is "D:\marathon-master\docs\docs\rest-api\public\api\v2/types/" both. So I change 6 line of app.raml like that:
appContainer: v2/types/appContainer.raml
But when I run "sbt package" again, a warning shows up:
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m;
support was removed in 8.0
[info] Loading project definition from D:\marathon-master\project
Version '20170916T025721' is not fully supported, please update the git tags.
[info] Set current project to marathon (in build file:/D:/marathon-master/)
[warn] File D:\marathon-master\docs\docs\rest-api\public\api\v2\types\v2\types\appContainer.raml does not exist (referenced by
D:\marathon-master\docs\docs\rest-api\public\api\v2\types\app.raml)
[info] Constructing RAML model
java.lang.RuntimeException: Library cannot be resolved: D:\marathon-master\docs\docs\rest-api\public\api\artifact.raml -- D:\marathon-master\docs\docs\rest-api\public\api\v2/types/app.raml [line=7, col=13]
...
[error] (marathon/compile:ramlGenerate) Library cannot be resolved:
D:\marathon-master\docs\docs\rest-api\public\api\artifact.raml -- D:\marathon-master\docs\docs\rest-api\public\api\v2/types/app.raml [line=7, col=13]
why have this warning? Any idea?

Building Apache Spark 2.1.0 from source fails

Am trying to build Apache Spark 2.1.0 source, but get these errors below that baffle me...
Hadoop 2.8.0 was installed and is working
Scala 2.12.1 was installed in advance of executing the Spark install (Which seems to auto install Scala 2.11.8 ?!?)
My build line is:
build/mvn -Pyarn -Phadoop-2.7 -Dhadoop.version=2.7.0 -DskipTests clean package
Does anybody know why I get:
user#server:/usr/local/share/spark/spark-2.1.0$ sudo /usr/local/share/spark/spark-2.1.0/build/mvn -Pyarn -Phadoop-2.7 -Dhadoop.version=2.7.0 -DskipTests clean package
[sudo] password for user:
exec: curl --progress-bar -L https://downloads.typesafe.com/zinc/0.3.9/zinc-0.3.9.tgz
######################################################################## 100.0%
exec: curl --progress-bar -L https://downloads.typesafe.com/scala/2.11.8/scala-2.11.8.tgz
######################################################################## 100.0%
exec: curl --progress-bar -L https://www.apache.org/dyn/closer.lua?action=download&filename=/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
######################################################################## 100.0%
Using `mvn` from path: /usr/local/share/spark/spark-2.1.0/build/apache-maven-3.3.9/bin/mvn
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=512M; support was removed in 8.0
[INFO] Scanning for projects...
Downloading: https://repo1.maven.org/maven2/org/apache/apache/14/apache-14.pom
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for org.apache.spark:spark-parent_2.11:2.1.0: Could not transfer artifact org.apache:apache:pom:14 from/to central (https://repo1.maven.org/maven2): repo1.maven.org: Name or service not known and 'parent.relativePath' points at wrong local POM # line 22, column 11
#
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project org.apache.spark:spark-parent_2.11:2.1.0 (/usr/local/share/spark/spark-2.1.0/pom.xml) has 1 error
[ERROR] Non-resolvable parent POM for org.apache.spark:spark-parent_2.11:2.1.0: Could not transfer artifact org.apache:apache:pom:14 from/to central (https://repo1.maven.org/maven2): repo1.maven.org: Name or service not known and 'parent.relativePath' points at wrong local POM # line 22, column 11: Unknown host repo1.maven.org: Name or service not known -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
I tested downloading manually (To see if that was causing the errors), which downloads without issues:
https://repo1.maven.org/maven2/org/apache/apache/14/apache-14.pom
I also tested accessing the URL below, which also shows content:
https://repo1.maven.org/maven2
Hope somebody smart knows how to solve this...
I found out what the issue was:
I had to configure our proxy settings in the SETTINGS.XML in the directory:
/usr/local/share/spark/spark-2.1.0/build/apache-maven-3.3.9/conf
After editing the file, the build went without any issues :)
Hope this helps someone else running into the same issue...
EDIT: Just to be extra clear, having a working proxy configuration in bash only is NOT SUFFICIENT for the Maven Build to succeed. I was able to download all files from bash manually, but Maven needed the proxy configuration in the SETTINGS.XML file present as well...

Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: UnresolvedAddressException

I have integrated Maven with Eclipse and trying to create a maven project. Every time i am trying to create project, its POM.xml shows error.
Multiple annotations found at this line:
- Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile
(execution: default-compile, phase: compile)
- Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:2.3.2:testCompile
(execution: default-testCompile, phase: test-compile)
- CoreException: Could not calculate build plan: Plugin org.apache.maven.plugins:maven-compiler-plugin:2.3.2 or one of its
dependencies could not be resolved: Failed to read artifact
descriptor for
org.apache.maven.plugins:maven-compiler-plugin:jar:2.3.2:
ArtifactResolutionException: Failure to transfer
org.apache.maven.plugins:maven-compiler-plugin:pom:2.3.2 from
htt:///repo.maven.apache.org/maven2 was cached in the local
repository, resolution will not be reattempted until the update
interval of central has elapsed or updates are forced. Original error:
Could not transfer artifact
org.apache.maven.plugins:maven-compiler-plugin:pom:2.3.2 from/to
central (htt:///repo.maven.apache.org/maven2): null to htt://
repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/2.3.2/maven-compiler-plugin-2.3.2.pom
If I try to run maven-install or any of the maven run option. i get this error
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J:
See htt://www.slf4j.org/codes.html#StaticLoggerBinder for further
details. [INFO] Scanning for projects... [INFO]
[INFO]
------------------------------------------------------------------------ [INFO] Building CQ5 MyApp UI 0.0.1-SNAPSHOT [INFO]
------------------------------------------------------------------------ Downloading:
http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.5/maven-resources-plugin-2.5.pom
[INFO]
------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO]
------------------------------------------------------------------------ [INFO] Total time: 12.289s [INFO] Finished at: Thu Mar 14 14:39:09 IST
2013 [INFO] Final Memory: 1M/15M [INFO]
------------------------------------------------------------------------ [ERROR] Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or
one of its dependencies could not be resolved: Failed to read artifact
descriptor for
org.apache.maven.plugins:maven-resources-plugin:jar:2.5: Could not
transfer artifact
org.apache.maven.plugins:maven-resources-plugin:pom:2.5 from/to
central (htt://repo.maven.apache.org/maven2): null to
htt://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.5/maven-resources-plugin-2.5.pom:
UnresolvedAddressException -> [Help 1] [ERROR] [ERROR] To see the
full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] [ERROR] For more information about the errors and possible
solutions, please read the following articles: [ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
What should I do?
If you are working on windows like me, just go to C:\Users\Owner.m2\repository and delete all the files in it. Make sure to keep your eclipse close.
Open eclipse and right click on your project, then click on Maven and then in Update Project. A dialog window appears, make sure to have selected ‘clean projects’ and ‘update project configuration from pom.xml’ options.
That should erase all the errors in the project. :)
You do not really have to delete everything from .m2\repository directory. Just the directories for 'problematic libraries', in your example YOUR_MAVEN_REPO.m2\repository\org\apache\maven\plugins\maven-compiler-plugin and delete 2.3.2 folder.
Then right click on the project in Eclipse and Maven->Update Project. You will probably get a different error and you have to repeat the procedure. Do it 3-4 times and it should be fine...
Thank you all for you help and guidance. I got the error myself. I am in a proxy network and was required to set user id and password in settings.xml file of apache maven.
Sounds like you may need to add the sl4j dependency in your pom file. See here: Failed to load class "org.slf4j.impl.StaticLoggerBinder"
Here is the depenedency from the dependency finder in CQ5.5:
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.commons.log</artifactId>
<version>2.1.3-R1232904</version>
<scope>provided</scope>
</dependency>
Hope that helps and good luck.

Why is Maven Build prompting for multiple launch configurations when there is actually none?

In my project (inherited BTW, so some aspects of it are still unknown), under Eclipse/m2e I right-click pom.xml > 1 Maven Build and I get a dialog:
Select a launch configuration to run:
m2 myproj (1):
m2 myproj (2):
m2 myproj (3):
m2 myproj:
But looking at the project's Properties > Run/Debug Settings, there are no launch configurations at all. None whatsoever.
What does that mean?
Should I select one of the 4 configurations listed above? If so, which one and why?
UPDATE 1: Interestingly, when I right-click pom.xml and select Run As > Run Configurations..., I see those configurations defined:
I still don't know what this means, though. I don't recall ever defining them. How did they get there?
UPDATE 2:
Apparently those launch configurations were created inadvertently by clicking some close/cancel button or similar. So I deleted all except for one, then ran it:
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.093s
[INFO] Finished at: Wed Dec 05 16:44:24 EST 2012
[INFO] Final Memory: 1M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or
<plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>.
Available lifecycle phases are:
validate, initialize, generate-sources, process-sources, generate-resources,
process-resources, compile, process-classes, generate-test-sources, process-test-sources,
generate-test-resources, process-test-resources, test-compile, process-test-classes,
test, prepare-package, package, pre-integration-test, integration-test,
post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site,
site, post-site, site-deploy. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions,
please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoGoalSpecifiedException
Strange. I know that pom.xml has goals and builds fine when selecting Run As > Maven Install.