Creating new projects with maven Archetypes
已回答
A growing frustration with me is this feature of "creating new Intellij projects with maven Archetypes".
I'm purposely quoting this since inevitably the selected archetype from the generated list will fail with "The desired archetype does not exist" errors...
If it doesn't exist, why is it being presented? I could give more details on which of the archetypes are failing, but ideally the entire list should be visited regularly to weed out and edit accordingly. Frankly not worth my time to report each and every archetype failure, but would seem like a basic bookkeeping chore from jet brains that can/should be automated.
请先登录再写评论。
Sorry for the issue. Could be the https://youtrack.jetbrains.com/issue/IDEA-110617 If version is not found IDE uses RELEASE by default. What archetypeVersion is set when IDE generates the project? Could you specify the full command line (it is printed in the very first line in Run tool window). Thank you.
Not sure if this is what you were after, but...
wouldn't think I should have to augment my local mvn settings for this?
Thank you. IDE takes archetypes information from Maven repository archtype catalog. IDE loads archetypes from these Maven indexes including their repository URLs and versions. if version is omitted the RELEASE value is used. See https://maven.apache.org/archetype/maven-archetype-plugin/specification/archetype-catalog.html
Probably the IDE experience could be improved if there is outdated or invalid information in Maven index. Not sure at the moment though how would be better proceed here.
There is a IntelliJ Plugin:
https://plugins.jetbrains.com/plugin/7965-maven-archetype-catalogs
to enable IntelliJ IDEA to fetch external Maven Archetype Catalog files.
Let's quote from the Plugin site:
IntelliJ IDEA is not able to fetch external Maven Archetype Catalog files (archetype-catalog.xml).
To use custom Maven Archetypes, you had to add external Maven Archetypes manually.
This plugin for IntelliJ IDEA allows you to define a list of external Maven Archetype Catalog files.
Those files are fetched and the containing Maven Archetypes are made available in IntelliJ IDEA when creating new Maven projects.
Usage
It adds a new entry Maven Archetype Catalogs to the Settings menu at
Here you can
If you need to authenticate to the reposistory, use an URL like 'http://[username]:[password]@[url]'.
After adding those Catalog files the Archetypes present in these files will be available
when creating new Maven projects or Maven modules based on Archetypes.
I am the author of the Maven Archetype Catalogs plugin. If you have questions about it just tell me.