While creating a zk-maven project i am getting an error .
In the catalog section after selecting ZK archetype 6.5.2 and then inserting the group id , Artifact Id ,version, package etc, it should populate "properties available from archetype" automatically.
But, in my case it does not happen.
Could anyone help me in this concern .
I have attached the screenshot here.
ref: here is the tutorial
I was getting such error because Eclipse Maven plugin was trying to find the ZK webapp archetype from my local nexus repository.
ZK archetype remote catalog is located at
http://mavensync.zkoss.org/maven2/
Add this url to
C:\Users\.m2\settings.xml
.
Related
After reading lots of questions about same issue here on SO, I was unable to resolve it.
I am trying to do a quick basic restfull web app in eclipse (Oxygen 3A) using Jersey framework. However, I am unable to add the archetype for some reason and get this error
"Could not resolve archetype org.glassfish.jersey.archetypes:jersey-quickstart-webapp:2.30.1".
I went to Window > Properties > Maven > Archetypes and added remote archetype catalog like on image below
As you can see, it found about 37K archetypes, so next I create new maven project and filter for "jersey" and as you can see below, I select "jersey-quickstart-webapp":
Click Next and enter the groupId, artifact id, version, package for my project
Click Finish and I get this error
I tried also few older versions of this archetype but keep getting same error. Here is more detail about the error:
I am trying to create a Webapp using Maven Jersey archetype, but while I am searching it, it's not giving me any result.
Can you please if I need to set up anything for this or how do I get the search result for this?
Expected:
Actual:
You need to add the Jersey Maven Archetype to your Eclipse because your catalog is not the lastest version.
Go to Preferences -> Maven -> Archetypes ->Add Remote Catalog and add these parameters:
Catalog File: http://repo1.maven.org/maven2/archetype-catalog.xml
Description: maven catalog
Note: Probably It's necesary to restart your Eclipse.
The update one is :
Go to Preferences -> Maven -> Archetypes ->Add Remote Catalog and
add these parameters:
Catalog File:
https://repo.maven.apache.org/maven2/archetype-catalog.xml
Description: maven catalog
Click on verify to check the remote link.
Note: restart your Eclipse
Source:https://maven.apache.org/archetype/archetype-models/archetype-catalog/archetype-catalog.html
The Archetype Plugin knows by default its internal catalog. It also knows about the local and remote catalogs:
local represents the ~/.m2/archetype-catalog.xml catalog file,
remote represents the https://repo.maven.apache.org/maven2/archetype-catalog.xml catalog file.
I'm working on a JavaEE project, I already have the skeleton of an old project. All i have done is rename the project, packages and change the name in the project file (.project). But now when i'm trying to run, it returns error in the browser "The requested resource is not available". I've checked the web.xml and added a new jsp in vain it doesn't work. In the browser's address, it gives me the old name of the project(http://localhost:8061/smsgate/). I've tried a lot to fix the problem. what can i do? Is there any other file that i have to update and write in the new name? Please give me your ideas (knowing that i have to use that old project)
Do Project -> Clean in your workspace by selecting your current project. Also if using maven then right click your project and do maven -> clean.
Manually go to your target directory of your ear module and shift-delete everything inside your target and then rebuild your project to form new ear.
if you have configured the web.xml properly then strike your app url. Also ctrl+shift+delete your browser history and then check.
Why not create a new project using a maven archetype, just type in the console:
mvn archetype:generate
It will show you a list of available archetypes from the web, just choose one of them, for JEE6/JEE7 you could choose among:
1019: remote -> org.codehaus.mojo.archetypes:webapp-javaee6 (Archetype for a web application using Java EE 6.)
1020: remote -> org.codehaus.mojo.archetypes:webapp-javaee7 (Archetype for a web application using Java EE 7.)
If you agree with me, just type:
1019 or 1020 according to your needs and answer the questions like:
projectId:your-project-name
groupdId:com.yourdomain.reverse
version:1.0
Using Eclipse Java EE IDE for Web Developers. Version: Kepler Service Release 2
Build id: 20140224-0627.
When I select File -> new -> Maven Project -> Use Default Workspace Location. I get the following Dialog. Local Default Catalog is empty:
I click Configure button, and then click on Maven Architecture Catalogs. The page says:
Location of catalog files
The Archetype Plugin knows by default about its internal catalog. It
also knows about the local and remote catalogs.
local represents the ~/.m2/archetype-catalog.xml catalog file.
remote represents the
http://repo.maven.apache.org/maven2/archetype-catalog.xml catalog
file.
The Archetype Plugin can also read catalogs from filesystem/HTTP by
providing the path/URL of a catalog file or of a directory containing
an archetype-catalog.xml file.
If Execute the following on the command line (I have everyhing under tools directory, Eclipse, Maven, WildFly, etc.)
C:\Tools>dir archetype-catalog.xml /s
It doesn't find any file.
So default local catalog doen't exist! Why is that?
I have downloaded http://repo.maven.apache.org/maven2/archetype-catalog.xml, but I don't know where to put it to become the default local catalog, because I don't know what ~/.m2/archetype-catalog.xml file path is. I tried with C:\Tools\eclipse\.m2\archetype-catalog.xml and several other locations without luck. Sorry, I'm new to Java eco-system and Eclipse IDE.
I have the latest M2Eclipse found here: http://download.eclipse.org/technology/m2e/releases
EDIT: I figured out what ~ means on ~/.m2/archetype-catalog.xml. I have put archetype-catalog.xml into c:\users\my.user.name\.m2\ and voilĂ default local catalog is now full of archetypes. But still. Why it didn't exist in the first place? This is very annoying.
The archetype catalogs used by eclipse can be found in Window -> Preferences, then in the section Maven -> Archetypes. If no catalog is listed there, you can add the official maven remote catalog: http://repo.maven.apache.org/maven2/archetype-catalog.xml
No need to configure local archetypes unless you have created your own archetype. In this case, when you install it on your machine, the maven will create the archetype-catalog.xml file on the ~/.m2/repository path. In another case, to retrieve any artifact the only things that you need to do is configure the remote catalog, for example, to configure Spring Catalog, you need the following
If you see the following screen, you can observe that I don't have anything in my Default Local Catalog similar to you while in All Catalogs, I have the archetypes from other repositories.
Finally is important to know the difference between archetypes and dependencies. The archetypes let us create a project from it, the others are the libraries to own the project.
I am using Eclipse (Kepler Service Release 1). I tried to create a New Maven Project and in Filter tried to locate the camel archetype. Since it was not there I clicked on Add Archetype and tried to add the camel-archetype-java and used the following values,
groupId:org.apache.camel.archetypes
artifactId:camel-archetype-java
version:2.12.1
URL:http://mvnrepository.com/artifact
After using the above values and clicking ok, I am getting the below exception
Can't resolve Archetype org.apache.camel.archetypes:camel-archetype-java:2.12.1
org.eclipse.core.runtime.CoreException: Could not resolve artifact
Request help.
Your Maven repository URL is wrong. Use the Remote Maven Default repository at http://repo1.maven.org/maven2/archetype-catalog.xml. You can add or change repositories in the "Select an Archetype" dialogues. Choose "Configure..." and edit an existing catalog or add a new one with the URL given above.
Best way i found it is to add a new remote catalog.
Open Eclipse ->Window -> Preferences -> Maven -> Archetypes.
Add a new remote catalog using the file : http://repo1.maven.org/maven2/archetype-catalog.xml
This will add to you IDE all the updated catalogs including the one you need them for Camel.