【问题标题】:Where do I set the atlassian-plugin-sdk 'allowGoogleTracking' option to false?我在哪里将 atlassian-plugin-sdk 'allowGoogleTracking' 选项设置为 false?
【发布时间】:2014-10-11 05:09:32
【问题描述】:

我已经安装/设置了 atlassian-plugin-sdk,因此我可以研究 JIRA 插件开发。

但是,当我运行“atlas-run-standalone --product jira”命令并启动 JIRA 实例时,它会尝试连接到谷歌分析并被拒绝连接(它被我们的代理阻止)。

它说我可以关闭此跟踪选项:

you may disable tracking by adding <allowGoogleTracking>false</allowGoogleTracking> to the amps plugin configuration in your pom.xml

我的问题是,我在哪里可以找到这个“allowGoogleTracking”选项?在哪个 pom.xml 中,我似乎无法在“atlassian-plugin-sdk”目录中找到一个。

我试过谷歌搜索和四处寻找,但我似乎找不到任何地方他们告诉我应该编辑哪个 pom.xml 文件。

【问题讨论】:

    标签: atlassian-plugin-sdk


    【解决方案1】:

    来自文档:

    默认情况下,AMPS 会将基本使用事件发送到 Google 分析。要禁用跟踪,可以:

    1. &lt;allow.google.tracking&gt;false&lt;/allow.google.tracking&gt; 添加到您的.m2/settings.xml 文件的&lt;properties&gt; 部分
    2. 在您的pom.xml 的amps 插件配置中包含&lt;allowGoogleTracking&gt;false&lt;/allowGoogleTracking&gt;
    3. 或在命令行传递-Dallow.google.tracking=false

    最简单的方法是在您的~/.m2/settings.xml 文件中的默认配置文件中设置它。你不妨同时设置skipAllPrompts

    <settings>
      ...
      <profiles>
        <profile>
          <id>defaultProfile</id>
          <activation>
            <activeByDefault>true</activeByDefault>
          </activation>
          ...
          <properties>
            <allow.google.tracking>false</allow.google.tracking>
            <skipAllPrompts>true</skipAllPrompts>
         </properties>
        </profile>
       </profiles>
    </settings>
    

    【讨论】:

    • 谢谢,我编辑了 atlassian-plugin-sdk\apache-maven-3.2.1\conf 目录中的 settings.xml,它对我有用。
    • 也可以设置 ATLAS_OPTS 环境变量(-Dallow.google.tracking=false)
    【解决方案2】:

    我在 pom 文件中添加了以下内容:

      <build>
        <plugins>
          <!-- other plugins ... -->
          <plugin>
            <groupId>com.atlassian.maven.plugins</groupId>
            <artifactId>maven-amps-plugin</artifactId>
            <version>5.1.11</version>
            <configuration>
              <allowGoogleTracking>false</allowGoogleTracking>
            </configuration>
          </plugin>
        </plugins>
        <!-- other stuff -->
      </build>
    

    不幸的是,它不起作用......我不想在 maven settings.xml 中添加一个属性。 我添加到 pom 中的 sn-p 有问题吗?有人有“解决方案”吗?

    【讨论】:

    • 如果它不起作用,那么您应该将其作为评论发布,因为它本身不是答案。但是,在这种情况下,我尝试了您的代码,它实际上对我有用。我建议您删除最后一段并使其实际上成为“答案”而不是问题。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-06-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-11-19
    相关资源
    最近更新 更多