更改Maven项目的{user}

更改Maven项目的{user},maven,licensing,netbeans-7.3,Maven,Licensing,Netbeans 7.3,我补充说: <licenses> <license> <name>The Apache Software License, Version 2.0</name> <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url> <distribution>repo</distribution> <comment

我补充说:

<licenses>
  <license>
    <name>The Apache Software License, Version 2.0</name>
    <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    <distribution>repo</distribution>
    <comments>A business-friendly OSS license</comments>
  </license>
</licenses>
我希望是这样

/*
 * Copyright 2013 OldCurmudgeon <--- Note the new name.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
   ...
 */
更改Java模板(工具/模板/Java/Java类(以及您希望的任何其他类)/在编辑器中打开(按钮)):

更改:

 ...
 * @author ${user}
 ...

然后更改许可证文件(工具/模板/许可证/您选择的许可证/在编辑器中打开的许可证(按钮)):

然后将以下内容添加到pom文件:

<licenses>
  <license>
    <name>The Apache Software License, Version 2.0</name>
    <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    <distribution>repo</distribution>
    <comments>A business-friendly OSS license</comments>
  </license>
</licenses>
<properties>
  <!-- For the License -->
  <user>OldCurmudgeon</user>
</properties>

老古董
你完成了。遗憾的是,我不得不更改许可证文件。也许在以后的NetBeans版本中,这是不必要的。

User属性
  • 选择工具-->Templates,然后单击设置按钮

  • 编辑
    User.properties文件
    以建立
    User属性
    :例如,
    User=您的全名

  • 默认情况下,
    user.properties文件
    中的
    用户属性
    被注释掉
    。取消注释并编辑这一行,为模板处理器提供一个漂亮的字符串。请注意,可以将其他属性添加到此文件,然后在自定义模板中使用它们

    我希望这会有所帮助。

    用户属性
  • 选择工具-->Templates,然后单击设置按钮

  • 编辑
    User.properties文件
    以建立
    User属性
    :例如,
    User=您的全名

  • 默认情况下,
    user.properties文件
    中的
    用户属性
    被注释掉
    。取消注释并编辑这一行,为模板处理器提供一个漂亮的字符串。请注意,可以将其他属性添加到此文件,然后在自定义模板中使用它们


    我希望这可能会有所帮助。

    如果您希望采用特定于项目的方式(User.properties是全局的),则必须更改许可证标题模板。将值从${user}更改为${project.property.user},然后在每个project pom.xml文件中,在project/properties pom元素中声明一个“user”属性。请参见此

    如果您希望采用特定于项目的方式(User.properties是全局的),则必须更改许可证标题模板。将值从${user}更改为${project.property.user},然后在每个project pom.xml文件中,在project/properties pom元素中声明一个“user”属性。请看此

    谢谢-我可以补充一下,
    设置实际上是一个按钮。请随意编辑。这将帮助我们保持质量和改进。谢谢-我可以补充一下,
    设置实际上是一个按钮。请随意编辑。这将有助于我们保持质量和改进。
    
     ...
     * @author ${project.property.user}
     ...
    
    ...
    ${licensePrefix}Copyright ${date?date?string("yyyy")} ${project.organization!user}.
    ...
    
    ...
    ${licensePrefix}Copyright ${date?date?string("yyyy")} ${project.property.user}.
    ...
    
    <properties>
      <!-- For the License -->
      <user>OldCurmudgeon</user>
    </properties>