用maven-deploy-plugin替换nexus staging maven插件

时间:2018-05-24 12:32:58

标签: maven nexus

我们的项目从我们无法控制的父pom继承了nexus staging maven插件。我在我的root pom中有这个配置来禁用nexus staging maven插件,这个配置似乎禁用了默认部署执行。

<plugin>
          <groupId>org.sonatype.plugins</groupId>
          <artifactId>nexus-staging-maven-plugin</artifactId>
          <executions>
            <execution>
              <id>default-deploy</id>
              <phase>none</phase>
            </execution>
          </executions>
          <configuration>
            <serverId>nexus</serverId>
            <nexusUrl>url</nexusUrl>
            <skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo>
          </configuration>
        </plugin>

我在我的root pom中定义了maven deploy插件,但maven-deploy插件似乎没有开始

<plugin>
        <artifactId>maven-deploy-plugin</artifactId>
        <version>2.7</version>
        <executions>
          <execution>
            <id>default-deploy</id>
            <phase>deploy</phase>
            <goals>
              <goal>deploy</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

我无法弄清楚如何用maven deploy插件替换继承的nexus staging maven插件。非常感谢任何帮助

1 个答案:

答案 0 :(得分:1)

您可以通过插件/** * @param Request $request * @throws Firebase\Exception\FirebaseException * @throws Firebase\Exception\MessagingException */ public function fcmSendMessageToAll(Request $request) { $firebaseInstance = new FirebaseInstance(); //$title,$body,$imageUrl if ($request->input('title')==null || $request->input('body')==null){ throw new InvalidArgumentException("Le champ titre ou texte est vide"); } $firebaseUserRepository = new FirebaseUserRepo(); try { $allUsers = $firebaseUserRepository->getAll(); }catch (\Exception $exception){ dd('erreur : '.$exception->getMessage()); } $arrayTokens = array(); foreach ($allUsers as $key => $firebaseUser) { if($firebaseUser->getToken() != null){ echo 'token : '.$firebaseUser->getToken().PHP_EOL; $arrayTokens[] = $firebaseUser->getToken(); } } //dd($arrayTokens);//test if (count($arrayTokens)>0){ //$messaging = (new Firebase\Factory())->createMessaging(); $messaging = $firebaseInstance->factory->createMessaging(); $message = CloudMessage::new(); $notification = Notification::fromArray([ 'title' => $request->input('title'), 'body' => $request->input('body'), 'image' => $request->input('imageurl'), ]); $message->withNotification($notification); try { $report = $messaging->sendMulticast($message, $arrayTokens); echo 'Successful sends: '.$report->successes()->count().PHP_EOL; }catch(Firebase\Exception\MessagingException $messagingException){ echo 'Failed sends: '.$report->failures()->count().PHP_EOL; dd('erreur : '.$messagingException->getMessage()); } if ($report->hasFailures()) { foreach ($report->failures()->getItems() as $failure) { echo $failure->error()->getMessage().PHP_EOL; } } } } 限定目标:

groupID:artefactID