duomu / maven-archetype-practice Goto Github PK
View Code? Open in Web Editor NEW创建maven骨架项目,并使用自定义的maven骨架项目生成新项目
创建maven骨架项目,并使用自定义的maven骨架项目生成新项目
骨架项目生成和使用步骤: 1.对项目demo执行mvn archetype:create-from-project,生成该项目的骨架项目archetype(在target/generated-sources/目录下) 2.对骨架项目archetype进行打包:mvn clean install,打包到本地仓库 3.用idea新建项目,选择新生成的archetype,仓库设为本地仓库,继续设置新项目的maven坐标,完成相关操作 4.执行完以上步骤,耐心等待即可生成和demo一样组织结构的maven普通项目 ps新创建的maven普通项目src/main/resources目录下遗留了骨架项目中的两个配置文件,后续研究如何避免生成这俩文件: demo-resources/pom.xml META-INF/maven/demo-metadata.xml 2017-09-08更新: 1.解决生成多余文件的问题 对项目demo执行mvn archetype:create-from-project,生成该项目的骨架项目archetype后,需要修改一下archetype的配置: 将src/main/resources/META-INF/maven/archetype-metadata.xml修改如下,指定要包含的文件路径 <fileSet filtered="true" encoding="UTF-8"> <directory>src/main/resources</directory> <includes> <!--此处改写,避免生成不必要的文件--> <include>mybatis/**/*.*</include> <include>spring/**/*.*</include> <include>*.*</include> <!--<include>**/*.txt</include> <include>**/*.xml</include> <include>**/*.properties</include>--> </includes> </fileSet> PS:修改原生项目、骨架项目后,不会生成多余文件,不再需要修改archetype的配置 2.使用骨架项目创建的项目,.java文件出现红色图标J,这是由于项目未把该文件路径指定为源码路径,在project Structure的Modules中将该文件路径指定为源码路径即可,下面是idea的官方资料https://www.jetbrains.com/help/idea/configuring-content-roots.html
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.