未经授权的Mulesoft Maven部署到RTF 401

如何解决未经授权的Mulesoft Maven部署到RTF 401

我正在尝试使用Maven从BitBucket管道部署到Mulesoft。部署目标是为入站流量配置的RTF实例。我正在使用以下bitbucket-pipelines.yml:

image: maven:3.6.1

pipelines:
  branches:
    develop:
      - step:
          caches:
            - maven
          name: Deploy to test
          deployment: test
          script:
            - mvn clean package deploy -e -DskipMunitTests -DmuleDeploy -Dapp.name=$env.APPLICATION_NAME -Dgroup.id=$env.MULESOFT_GROUP_ID -Dapp.id=$env.MULESOFT_CONNECTED_APP_ID_DEV -Dapp.secret=$env.MULESOFT_CONNECTED_APP_DEV_SECRET -Drtf.name=$env.RUNTIME_FABRIC_NAME -Drtf.environment=$env.ANYPOINT_ENVIRONMENT -Dbusiness.group=$env.MULESOFT_BUSINESS_GROUP

这是我的pom.xml:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>GROUP GUID</groupId>
    <artifactId>APP NAME</artifactId>
    <version>1.0.0</version>
    <packaging>mule-application</packaging>

    <name>APP NAME</name>

    <description>APP DESCRIPTION</description>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <app.runtime>4.3.0</app.runtime>
        <mule.maven.plugin.version>3.4.1</mule.maven.plugin.version>
        <app.name>${env.APP_NAME}</app.name>
        <group.id>${env.GROUP_ID}</group.id>
        <app.id>${env.APP_ID}</app.id>
        <app.secret>${env.APP_SECRET}</app.secret>
        <rtf.name>${env.RTF_NAME}</rtf.name>
        <rtf.environment>${env.RTF_ENVIRONMENT}</rtf.environment>
        <business.group>${env.BUSINESS_GROUP}</business.group>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-clean-plugin</artifactId>
                <version>3.1.0</version>
            </plugin>
            <plugin>
                <groupId>org.mule.tools.maven</groupId>
                <artifactId>mule-maven-plugin</artifactId>
                <version>3.4.1</version>
                <extensions>true</extensions>
                <configuration>
                    <runtimeFabricDeployment>
                        <muleVersion>${app.runtime}</muleVersion>
                        <connectedAppClientId>${app.id}</connectedAppClientId>
                        <connectedAppClientSecret>${app.secret}</connectedAppClientSecret>
                        <connectedAppGrantType>client_credentials</connectedAppGrantType>
                        <applicationName>${app.name}</applicationName>
                        <target>${rtf.name}</target>
                        <environment>${rtf.environment}</environment>
                        <businessGroup>${business.group}</businessGroup>
                        <provider>MC</provider>
                    </runtimeFabricDeployment>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>org.mule.connectors</groupId>
            <artifactId>mule-http-connector</artifactId>
            <version>1.5.19</version>
            <classifier>mule-plugin</classifier>
        </dependency>
        <dependency>
            <groupId>org.mule.connectors</groupId>
            <artifactId>mule-sockets-connector</artifactId>
            <version>1.2.0</version>
            <classifier>mule-plugin</classifier>
        </dependency>
        <dependency>
            <groupId>org.mule.modules</groupId>
            <artifactId>mule-apikit-module</artifactId>
            <version>1.3.13</version>
            <classifier>mule-plugin</classifier>
        </dependency>
    </dependencies>

    <repositories>
          <repository>
            <id>anypoint-exchange-v2</id>
            <name>Anypoint Exchange</name>
            <url>https://maven.anypoint.mulesoft.com/api/v2/maven</url>
            <layout>default</layout>
        </repository>
        <repository>
            <id>mulesoft-releases</id>
            <name>MuleSoft Releases Repository</name>
            <url>https://repository.mulesoft.org/releases/</url>
            <layout>default</layout>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>mulesoft-releases</id>
            <name>mulesoft release repository</name>
            <layout>default</layout>
            <url>https://repository.mulesoft.org/releases/</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
        <pluginRepository>
            <id>mule-public</id>
            <url>https://repository.mulesoft.org/nexus/content/repositories/releases</url>
        </pluginRepository>
    </pluginRepositories>

</project>

我现在从管道中收到以下错误:

[INFO] --- mule-maven-plugin:3.4.1:deploy (default-deploy) @ APP NAME ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  02:00 min
[INFO] Finished at: 2020-09-11T15:24:36Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.mule.tools.maven:mule-maven-plugin:3.4.1:deploy (default-deploy) on project APP NAME: Execution default-deploy of goal org.mule.tools.maven:mule-maven-plugin:3.4.1:deploy failed: 401 Unauthorized: Unauthorized -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.mule.tools.maven:mule-maven-plugin:3.4.1:deploy (default-deploy) on project APP NAME: Execution default-deploy of goal org.mule.tools.maven:mule-maven-plugin:3.4.1:deploy failed: 401 Unauthorized: Unauthorized
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-deploy of goal org.mule.tools.maven:mule-maven-plugin:3.4.1:deploy failed: 401 Unauthorized: Unauthorized
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:148)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.mule.tools.client.core.exception.ClientException: 401 Unauthorized: Unauthorized
    at org.mule.tools.client.core.AbstractClient.checkResponseStatus (AbstractClient.java:175)
    at org.mule.tools.client.authentication.AuthenticationServiceClient.loginWithConnectedApp (AuthenticationServiceClient.java:152)
    at org.mule.tools.client.authentication.AuthenticationServiceClient.getBearerTokenForConnectedApp (AuthenticationServiceClient.java:91)
    at org.mule.tools.client.AbstractMuleClient.getBearerToken (AbstractMuleClient.java:347)
    at org.mule.tools.client.AbstractMuleClient.init (AbstractMuleClient.java:102)
    at org.mule.tools.client.core.AbstractClient.initialize (AbstractClient.java:123)
    at org.mule.tools.client.core.AbstractClient.get (AbstractClient.java:93)
    at org.mule.tools.client.fabric.RuntimeFabricClient.getDeployments (RuntimeFabricClient.java:55)
    at org.mule.tools.verification.fabric.RuntimeFabricDeploymentVerification$RuntimeFabricDeploymentVerificationStrategy.<init> (RuntimeFabricDeploymentVerification.java:51)
    at org.mule.tools.verification.fabric.RuntimeFabricDeploymentVerification$RuntimeFabricDeploymentVerificationStrategy.<init> (RuntimeFabricDeploymentVerification.java:45)
    at org.mule.tools.verification.fabric.RuntimeFabricDeploymentVerification.<init> (RuntimeFabricDeploymentVerification.java:37)
    at org.mule.tools.deployment.fabric.RuntimeFabricArtifactDeployer.<init> (RuntimeFabricArtifactDeployer.java:50)
    at org.mule.tools.deployment.fabric.RuntimeFabricArtifactDeployer.<init> (RuntimeFabricArtifactDeployer.java:41)
    at org.mule.tools.deployment.fabric.RuntimeFabricApplicationDeployer.<init> (RuntimeFabricApplicationDeployer.java:25)
    at org.mule.tools.deployment.AbstractDeployerFactory$RuntimeFabricDeployerFactory.createArtifactDeployer (AbstractDeployerFactory.java:170)
    at org.mule.tools.deployment.DefaultDeployer.<init> (DefaultDeployer.java:36)

我已经确保从以下文档中为连接的应用提供权限: https://help.mulesoft.com/s/article/The-Minimum-Permission-to-Deploy-an-Application-with-Anypoint-Console-or-Maven-in-RTF

我的组织是子组织,连接的应用程序是否需要对主组织的许可?我是否缺少未看到的权限项目?我对BitBucket管道也不是很熟悉,是否需要在YAML中添加任何内容?感谢您的提前帮助。

解决方法

问题已解决。有几个问题。首先,我的Bitbucket管道使用以下格式来注入存储库变量:$env.VAR_NAME。不需要使用env.前缀。这些都被更改为$VAR_NAME

接下来,我的解决方案属于一个Sub-Org,全名中包含空格。我将其更改为使用businessGroupId,并为子组织使用了GUID。这些共同使maven部署能够正常工作。

注意:我还发现在调试开关打开的情况下不能使用BitBucket管道。下载所有依赖项时超时。

,

您似乎没有在<runtimeFabricDeployment>的mule maven插件配置的pom.xml配置中提供任何点平台的用户名或密码。因此,它无法进行身份验证以进行部署。

配置参考为here

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


依赖报错 idea导入项目后依赖报错,解决方案:https://blog.csdn.net/weixin_42420249/article/details/81191861 依赖版本报错:更换其他版本 无法下载依赖可参考:https://blog.csdn.net/weixin_42628809/a
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下 2021-12-03 13:33:33.927 ERROR 7228 [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPL
错误1:gradle项目控制台输出为乱码 # 解决方案:https://blog.csdn.net/weixin_43501566/article/details/112482302 # 在gradle-wrapper.properties 添加以下内容 org.gradle.jvmargs=-Df
错误还原:在查询的过程中,传入的workType为0时,该条件不起作用 &lt;select id=&quot;xxx&quot;&gt; SELECT di.id, di.name, di.work_type, di.updated... &lt;where&gt; &lt;if test=&qu
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct redisServer’没有名为‘server_cpulist’的成员 redisSetCpuAffinity(server.server_cpulist); ^ server.c: 在函数‘hasActiveC
解决方案1 1、改项目中.idea/workspace.xml配置文件,增加dynamic.classpath参数 2、搜索PropertiesComponent,添加如下 &lt;property name=&quot;dynamic.classpath&quot; value=&quot;tru
删除根组件app.vue中的默认代码后报错:Module Error (from ./node_modules/eslint-loader/index.js): 解决方案:关闭ESlint代码检测,在项目根目录创建vue.config.js,在文件中添加 module.exports = { lin
查看spark默认的python版本 [root@master day27]# pyspark /home/software/spark-2.3.4-bin-hadoop2.7/conf/spark-env.sh: line 2: /usr/local/hadoop/bin/hadoop: No s
使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams[&#39;font.sans-serif&#39;] = [&#39;SimHei&#39;] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -&gt; systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping(&quot;/hires&quot;) public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate&lt;String
使用vite构建项目报错 C:\Users\ychen\work&gt;npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-