mvn archetype:generate BUILD FAILURE - maven-2

I am following the tutorial: http://persistentdesigns.com/wp/jersey-spring-and-jpa/
Here it says, run the command
mvn archetype:generate -DarchetypeCatalog=http://download.java.net/maven/2
After that give the groupId, ArtifactId, etc. I ran the above command. But before asking for groupId, it asked for:
Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains):
Since, this number is not given in the tutorial, I went through the given options in the command line and chose 3. After that it asked for the groupId and other. I gave all the options and then pressed enter. But I got a build failure saying Error reading POM.
Here's the output:
Choose archetype:
1: http://download.java.net/maven/2 -> com.sun.jersey.archetypes:jersey-quickstart-
grizzly (Archetype for creating a RESTful web application with Jersey and Grizzly)
2: http://download.java.net/maven/2 -> com.sun.jersey.archetypes:jersey-quickstart-grizzly2 (Archetype for creating a RESTful web application with Jersey and Grizzly 2.x)
3: http://download.java.net/maven/2 -> com.sun.jersey.archetypes:jersey-quickstart-webapp (Archetype for creating a Jersey based RESTful web application with WAR packaging)
4: http://download.java.net/maven/2 -> com.sun.jersey.archetypes:jersey-quickstart-ejb (Archetype for creating a Jersey based RESTful EJB application with WAR packaging)
5: http://download.java.net/maven/2 -> com.sun.faces:simple-jsf (Archetype for creating a simple JSF project)
6: http://download.java.net/maven/2 -> com.sun.faces.regression:i_jsf_XXXX-archetype (Archetype for mojarra JSF regression tests)
Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): : 3
Define value for property 'groupId': : com.persistent
Define value for property 'artifactId': : jerseySpringJPA
Define value for property 'version': 1.0-SNAPSHOT: : <CR>
Define value for property 'package': com.persistent: : com.persistent.rest
Confirm properties configuration:
groupId: com.persistent
artifactId: jerseySpringJPA
version: <CR>
package: com.persistent.rest
Y: : Y
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Old (1.x) Archetype: jersey-quickstart-webapp:1.8
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: com.persistent
[INFO] Parameter: packageName, Value: com.persistent.rest
[INFO] Parameter: package, Value: com.persistent.rest
[INFO] Parameter: artifactId, Value: jerseySpringJPA
[INFO] Parameter: basedir, Value: /mwallet
[INFO] Parameter: version, Value: <CR>
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:32.278s
[INFO] Finished at: Fri Aug 02 00:55:41 GMT+05:30 2013
[INFO] Final Memory: 7M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.2:generate (default-cli) on project standalone-pom: Error reading POM -> [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/MojoFailureException
I have no idea why it is not reading the POM. Am I missing anything here? Please help!
Thanks in advance!

I solved the issue!
For
Define value for property 'version': 1.0-SNAPSHOT: :
I was initially entering < CR > as mentioned in the tutorial. Now, I am leaving it blank, which is actually making the version as 1.0-SNAPSHOT.
This solved the issue. Now the build is successful! Here's the output:
5: http://download.java.net/maven/2 -> com.sun.faces:simple-jsf (Archetype for creating a simple JSF project)
6: http://download.java.net/maven/2 -> com.sun.faces.regression:i_jsf_XXXX-archetype (Archetype for mojarra JSF regression tests)
Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): : 3
Define value for property 'groupId': : com.persistent
Define value for property 'artifactId': : jerseySpringJPA
Define value for property 'version': 1.0-SNAPSHOT: :
Define value for property 'package': com.persistent: : com.persistent.rest
Confirm properties configuration:
groupId: com.persistent
artifactId: jerseySpringJPA
version: 1.0-SNAPSHOT
package: com.persistent.rest
Y: : Y
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Old (1.x) Archetype: jersey-quickstart-webapp:1.8
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: com.persistent
[INFO] Parameter: packageName, Value: com.persistent.rest
[INFO] Parameter: package, Value: com.persistent.rest
[INFO] Parameter: artifactId, Value: jerseySpringJPA
[INFO] Parameter: basedir, Value: /mwallet
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] project created from Old (1.x) Archetype in dir: /mwallet/jerseySpringJPA
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:04.013s
[INFO] Finished at: Fri Aug 02 01:49:42 GMT+05:30 2013
[INFO] Final Memory: 7M/81M
[INFO] ------------------------------------------------------------------------

I am able to create a module without any problem.
Please see the attached screenshot.
It seems like the version number you passed is not correct.
Thanks

Related

License in Opensource Apache Guacamole

I cloned the source code from this github repository : git://github.com/glyptodon/guacamole-client.git
I am able to build successfully and use it.
I read the License agreement of this project : https://github.com/glyptodon/guacamole-client/tree/master/guacamole/src/licenses
It is mentioned as
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
But when I add a class in it and build, It is throwing a license error :
[INFO] Scanning for projects...
[INFO]
[INFO] -------------------< org.apache.guacamole:guacamole >-------------------
[INFO] Building guacamole 1.0.0
[INFO] --------------------------------[ war ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # guacamole ---
[INFO] Deleting /guacamole-client/guacamole/target
[INFO]
[INFO] --- apache-rat-plugin:0.12:check (validate) # guacamole ---
[INFO] Enabled default license matchers.
[INFO] Will parse SCM ignores for exclusions...
[INFO] Parsing exclusions from /guacamole-client/guacamole/.gitignore
[INFO] Finished adding exclusions from SCM ignore files.
[INFO] 67 implicit excludes (use -debug for more details).
[INFO] Exclude: src/main/webapp/app/*/templates/*.html
[INFO] Exclude: **/*.json
[INFO] Exclude: src/licenses/**/*
[INFO] 485 resources included (use -debug for more details)
[INFO] Rat check: Summary over all files. Unapproved: 1, unknown: 1, generated: 0, approved: 419 licenses.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.115 s
[INFO] Finished at: 2018-11-18T21:45:16+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.rat:apache-rat-plugin:0.12:check (validate) on project guacamole: Too many files with unapproved license: 1 See RAT report in: /guacamole/target/rat.txt -> [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/MojoFailureException
Attached the rat.txt for reference : https://codeshare.io/adNYMZ
Could someone help me why I am not able to override this opensource project?
Thanks,
Harry
You are missing the license header in the file
src/main/java/org/apache/guacamole/rest/auth/TutorialAuthenticationProvider.java
The Guacamole pom.xml is configured to use RAT, which checks all files for the presence of the license text. If the license is not included, the build will fail.
You can also disable RAT with option -Drat.skip=true or add your file to the exclusion list in pom.xml (this is useful for some resource files that do not need a license).

Apache Isis build failure migrating from v1.12.2. Unknown repositories ApplicationUser,

I am migrating an Apache Isis application from version 1.12.2 and currently using the legacy addons Security, Audit, and SessionLogger. I plan on updating to the latest Isis version and using the latest Incode addons here.
When changing the Isis version to 1.13.0 it fails the build. I did not see anything in the migration notes that will fix this. The build error is unkown repository for ApplicationRole, ApplicationTenancy, ApplicationUser. The bootstrap class lists the addon modules and there are no errors using Isis 1.12.2.
(update)
I thought it possible that Isis and the Incode addons should upgrade together at some point and someone would mention it, but I wasn't sure. Then looking more into this, I noticed the Apache Isis isis-app-todoapp uses an Isis version one major release higher, as well as the Incode addons, which are also one major release higher than what I have. Any idea about this? I would like to get to the latest Isis and Incode versions.
[ERROR]
[ERROR] #DomainObject annotation on org.isisaddons.module.security.dom.role.ApplicationRole specifies unknown repository 'org.isisaddons.module.security.dom.role.ApplicationRoleRepository'
[ERROR] #DomainObject annotation on org.isisaddons.module.security.dom.tenancy.ApplicationTenancy specifies unknown repository 'org.isisaddons.module.security.dom.tenancy.ApplicationTenancyRepository'
[ERROR] #DomainObject annotation on org.isisaddons.module.security.dom.user.ApplicationUser specifies unknown repository 'org.isisaddons.module.security.dom.user.ApplicationUserRepository'
[ERROR]
[ERROR]
[INFO] calling #PreDestroy on all domain services
[INFO] shutting down
org.apache.isis.core.metamodel.specloader.SpecificationLoader#1e2fe282
[INFO] ---------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] App ................................. SUCCESS [ 0.652s]
[INFO] App DOM ............................. FAILURE [ 37.945s]
[INFO] App Fixtures ........................ SKIPPED
[INFO] App App ............................. SKIPPED
[INFO] App Webapp .......................... SKIPPED
[INFO] ---------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 40.974 s
[INFO] Finished at: 2018-05-25T09:47:05-04:00
[INFO] Final Memory: 84M/692M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.isis.tool:isis-maven-plugin:1.13.2:validate (default) on project App-dom: 3 meta-model problems found. -> [Help 1]
[ERROR]
Solved by removing a maven build-profile slash validation step, after reading similar SO question, and updating the Incode addon modules with each major Isis release. I successfully went through Apache Isis release 1.13.0, 1.14.0, 1.15.0, 1.16.2.

Why does building Spark sources give "object sbt is not a member of package com.typesafe"?

I tried to compile the https://github.com/apache/spark project using IntelliJ IDEA with the sbt plugin on Windows.
I'm facing an error about sbt. Since I'm not familiar with sbt, I don't know how to fix it.
The error messages are as follows:
[info] Loading project definition from F:\codeReading\sbtt\spark-master\project
[info] Compiling 3 Scala sources to F:\codeReading\sbtt\spark-master\project\target\scala-2.10\sbt-0.13\classes...
[error] F:\codeReading\sbtt\spark-master\project\SparkBuild.scala:26: object sbt is not a member of package com.typesafe
[error] import com.typesafe.sbt.pom.{PomBuild, SbtPomKeys}
[error] ^
[error] F:\codeReading\sbtt\spark-master\project\SparkBuild.scala:51: not found: type PomBuild
[error] object SparkBuild extends PomBuild {
[error] ^
[error] F:\codeReading\sbtt\spark-master\project\SparkBuild.scala:118: not found: value SbtPomKeys
[error] otherResolvers <<= SbtPomKeys.mvnLocalRepository(dotM2 => Seq(Resolver.file("dotM2", dotM2))),
[error] ^
[error] F:\codeReading\sbtt\spark-master\project\SparkBuild.scala:178: value projectDefinitions is not a member of AnyRef
[error] super.projectDefinitions(baseDirectory).map { x =>
[error] ^
[error] four errors found
[error] (plugins/compile:compile) Compilation failed
Spark is built with Maven. The SBT build is only a convenience. You will have far better results importing it as a Maven project.
It looks like IDEA doesn't like project references to git projects that the Spark build definition uses for sbt-pom-reader.
It's showed up when I ran sbt within the cloned project:
➜ spark git:(master) ✗ xsbt
[info] Loading global plugins from /Users/jacek/.sbt/0.13/plugins
[info] Loading project definition from /Users/jacek/oss/spark/project/project
[info] Loading project definition from /Users/jacek/.sbt/0.13/staging/ec3aa8f39111944cc5f2/sbt-pom-reader/project
[warn] Multiple resolvers having different access mechanism configured with same name 'sbt-plugin-releases'. To avoid conflict, Remove duplicate project resolvers (`resolvers`) or rename publishing resolver (`publishTo`).
[info] Loading project definition from /Users/jacek/oss/spark/project
[info] Set current project to spark-parent (in build file:/Users/jacek/oss/spark/)
>
You can see the project reference to the git project of sbt-pom-reader when accessing the plugins project for which the reference is defined:
> reload plugins
[info] Loading global plugins from /Users/jacek/.sbt/0.13/plugins
[info] Loading project definition from /Users/jacek/oss/spark/project/project
[info] Updating {file:/Users/jacek/oss/spark/project/project/}project-build...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
[info] Loading project definition from /Users/jacek/.sbt/0.13/staging/ec3aa8f39111944cc5f2/sbt-pom-reader/project
[warn] Multiple resolvers having different access mechanism configured with same name 'sbt-plugin-releases'. To avoid conflict, Remove duplicate project resolvers (`resolvers`) or rename publishing resolver (`publishTo`).
[info] Updating {file:/Users/jacek/.sbt/0.13/staging/ec3aa8f39111944cc5f2/sbt-pom-reader/project/}sbt-pom-reader-build...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
[info] Loading project definition from /Users/jacek/oss/spark/project
> projects
[info] In file:/Users/jacek/oss/spark/project/
[info] * plugins
[info] spark-style
[info] In https://github.com/ScrapCodes/sbt-pom-reader.git
[info] sbt-pom-reader
A solution could be executing sbt gen-idea to generate the project files for IDEA. It's just a guess, though.

Does Anyone know if there is any incompatibility between COMETD and JERSEY 9? Last version of Jetty is incompatible I think

After trying to configure maven to work with the last Jetty version (embedded JETTY 9) , I tried to use cometd (last version is 2.5.1) and I figured out that is not possible to make it work.
As you can see below , it seems there is compilation failure is due to type 9.0.0.v20130308 plus version 2.5.1 of artifactID cometd-websocket-jetty.
Honestly I can't get how possible is that the new Jetty version,which improved websocket, doesn't work, I guess I've been doing something wrong so if someone either knows how or have done it please let me know how I can fix it.
By the way I use jdk 1.7.0_09.
`[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory
...\apps\business-app\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) # SOKO-business ---
[INFO] Compiling 79 source files to
...\apps\business-app\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] ...\apps\business-app\src\main\java\com\igz\soko\business\Main.java:[38,12] **error: cannot access ContainerLifeCycle**
[ERROR] ...\apps\business-app\src\main\java\com\igz\soko\business\Main.java:[59,14] **error: method start in class Server cannot be applied to given types;**
[INFO] 2 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.936s
[INFO] Finished at: Thu Apr 04 16:12:19 CEST 2013
[INFO] Final Memory: 14M/177M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler- plugin:2.3.2:compile (default-compile) on project SOKO-business: Compilation failure: Compilation failure:
[ERROR] ...\bbv97\apps\business-app\src\main\java\com\igz\soko\business\Main.java: [38,12] error: cannot access ContainerLifeCycle
[ERROR] ...\bbv97\apps\business-app\src\main\java\com\igz\soko\business\Main.java: [59,14] error: method start in class Server cannot be applied to given types;`
cheers!
D
CometD 2.x is incompatible with Jetty 9.
You can run CometD 2.x on Jetty 7 and Jetty 8, with JDK 5 or greater.
CometD 3 is compatible with Jetty 9, and there will be a CometD 3 preview release soon.

Maven : How to use Maven for generating Spring and CXF Support Application

I need to create a Simple web Application with Spring and CXF Setup
I am using apache-maven-3.0.3 Support for this.
Please tell me what me what number to enter in mvn command prompt , to generate those required artifacts for this.
I tried this way , it only generated the Java Interface and Implementation class
HelloWorld 2. HelloWorldImpl
and two xml files inside WEB-INF
beans 2. web
But i don't know why no jar files have been got created.
I tried this way
Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): 135: 116
Define value for property 'groupId': : com
Define value for property 'artifactId': : MyAPP
Define value for property 'version': 1.0-SNAPSHOT: :
Define value for property 'package': com: :
Confirm properties configuration:
groupId: com
artifactId: MyAPP
version: 1.0-SNAPSHOT
package: com
Y: : y
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Old (1.x) Archetype: cxf-jaxws-javafirst:2.1.4
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: com
[INFO] Parameter: packageName, Value: com
[INFO] Parameter: package, Value: com
[INFO] Parameter: artifactId, Value: MyAPP
[INFO] Parameter: basedir, Value: C:\myapp
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] project created from Old (1.x) Archetype in dir: C:\myapp\MyAPP
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:49.062s
[INFO] Finished at: Sun Sep 25 16:47:29 IST 2011
[INFO] Final Memory: 6M/15M
[INFO] ------------------------------------------------------------------------
Archetypes are convenient, but I don't think they are going to be helpful to you for this case. This tutorial is a nice, basic example that outputs a running webapp using Spring and Maven. I would suggest you download the code, have a play around and figure out how it works, then start layering in your CXF functionality.
Go forth and build something awesome!