网站开发群,怎样查看网站的权重,wordpress设置固定链接和伪静态,数据百度做网站好用吗许多人都知道Maven源代码和Javadoc工件#xff0c;但是不知道为什么要创建它们。 我肯定在这个阵营中–我可以理解为什么人们想要此信息#xff0c;但是由于要手动导航Maven存储库#xff0c;因此获取信息似乎相对效率较低。 然后我被线索棒击中。 这些工件由IDE而非人员使… 许多人都知道Maven源代码和Javadoc工件但是不知道为什么要创建它们。 我肯定在这个阵营中–我可以理解为什么人们想要此信息但是由于要手动导航Maven存储库因此获取信息似乎相对效率较低。 然后我被线索棒击中。 这些工件由IDE而非人员使用。 如果您使用的是Maven依赖项那么IDE足够聪明可以知道如何查找这些工件。 当您单步调试器中的代码时将使用源工件-您不再需要将源代码显式绑定到IDE中的库。 javadoc工件用于编辑器中的自动完成和上下文相关帮助。 这些都不是必需的-多年以来我一直很高兴使用vi-但是当您大多数都知道自己需要什么但不确定细节时它肯定会提高您的生产率。 源工件 源工件最容易创建。 添加一个将作为标准构建的一部分自动运行的插件您已完成。 构建花费的时间稍长一些但您只需要创建几个目录的归档文件就不必担心了。 project xmlnshttp://maven.apache.org/POM/4.0.0 xmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexsi:schemaLocationhttp://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsdbuildplugins!-- create source jar --plugingroupIdorg.apache.maven.plugins/groupIdartifactIdmaven-source-plugin/artifactIdversion2.1.1/versionexecutionsexecutionidattach-sources/idphaseverify/phasegoals!-- produce source artifact for project main sources --goaljar-no-fork/goal!-- produce test source artifact for project test sources --goaltest-jar-no-fork/goal/goals/execution/executions/plugin/plugins/build
/projectJavadoc工件 Javadoc工件要复杂一些因为您可能希望同时创建一个对人类友好的网站。 根据我的经验最大的问题是外部类是不透明的因为它花费了大量的精力来创建必要的链接。 现在maven插件会为我们解决这个问题 构建该工件需要花费大量时间因此您可能不想每次都这样做。 有两种方法–明确指定Maven目标或将其绑定到自定义配置文件例如javadoc。 以下配置使用自定义配置文件。 project xmlnshttp://maven.apache.org/POM/4.0.0 xmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexsi:schemaLocationhttp://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsdprofiles!-- create javadoc --profileidjavadoc/idbuildpluginsplugingroupIdorg.apache.maven.plugins/groupIdartifactIdmaven-javadoc-plugin/artifactIdversion2.9.1/versionconfigurationdetectLinks /includeDependencySourcestrue/includeDependencySourcesdependencySourceIncludesdependencySourceIncludecom.invariantproperties.project.student:*/dependencySourceInclude/dependencySourceIncludes!-- heavily used dependencies --linkslinkhttp://docs.oracle.com/javase/7/docs/api//linklinkhttp://docs.oracle.com/javaee/6/api/linklinkhttp://docs.spring.io/spring/docs/current/javadoc-api//linklinkhttp://docs.spring.io/spring-data/commons/docs/1.6.2.RELEASE/api//linklinkhttp://docs.spring.io/spring-data/jpa/docs/1.4.3.RELEASE/api//linklinkhttp://docs.spring.io/spring-data/data-jpa/docs/1.4.3.RELEASE/api//linklinkhttps://jersey.java.net/apidocs/1.17/jersey//linklinkhttp://hamcrest.org/JavaHamcrest/javadoc/1.3//linklinkhttp://eclipse.org/aspectj/doc/released/runtime-api//linklinkhttp://eclipse.org/aspectj/doc/released/weaver-api/linklinkhttp://tapestry.apache.org/5.3.7/apidocs//link/links/configurationexecutionsexecutionidaggregate/id!-- phasesite/phase --phasepackage/phasegoalsgoalaggregate/goalgoaljar/goal/goals/execution/executions/plugin/plugins/buildreportingpluginsplugingroupIdorg.apache.maven.plugins/groupIdartifactIdmaven-javadoc-plugin/artifactIdversion2.9.1/versionconfiguration!-- Default configuration for all reports --/configurationreportSetsreportSetidnon-aggregate/idconfiguration!-- Specific configuration for the non aggregate report --/configurationreportsreportjavadoc/report/reports/reportSetreportSetidaggregate/idconfiguration!-- Specific configuration for the aggregate report --/configurationreportsreportaggregate/report/reports/reportSet/reportSets/plugin/plugins/reporting/profile/profiles
/project包信息.java 最后每个软件包都应该具有package-info.java文件。 这将替换旧的package-info.html文件但由于它允许使用类注释因此是一个改进。 由于它是无效的类名因此不会被编译。 我发现包括指向资源的链接非常有帮助这些链接可以帮助我理解类的外观。 例如“学生”项目中的元数据包包含指向我的博客文章我认为有用的其他博客文章甚至适当的Oracle教程的链接。 在公司中这些可能是指向Wiki页面的链接。 /** * Classes that support JPA Criteria Queries for persistent entities.* * see a hrefhttp://invariantproperties.com/2013/12/19/project-student-persistence-with-spring-data/Project Student: Persistence with Spring Data/a* see a hrefhttp://invariantproperties.com/2013/12/29/project-student-jpa-criteria-queries/Project Student: JPA Criteria Queries/a* see a hrefhttp://www.petrikainulainen.net/programming/spring-framework/spring-data-jpa-tutorial-part-four-jpa-criteria-queries/Spring Data JPA Tutorial Part Four: JPA Criteria Queries/a [www.petrikainulainen.net]* see a hrefhttp://docs.oracle.com/javaee/6/tutorial/doc/gjitv.htmlJEE Tutorial/a * * author Bear Giles bgilescoyotesong.com*/
package com.invariantproperties.project.student.metamodel;源代码 源代码位于https://github.com/beargiles/project-student [github]和http://beargiles.github.io/project-student/ [github页面]。 参考 Invariant Properties博客上的JCG合作伙伴 Bear Giles 创建Maven源代码和Javadoc工件 。 翻译自: https://www.javacodegeeks.com/2014/02/creating-maven-source-and-javadoc-artifacts.html