KARAF / karaf star
2022-12-16
Open
#2 pom.xml: karaf bundle uninstall & install star
2022-12-16 Open
Tasks
  • 이 방법을 사용하면 maven deploy시 karaf에 uninstall 및 install을 동시해 할 수 있어서 생산성에 도움이 됨
  • 헤더에 Authorization 부분은 user, password 부분을 적절하게 맞춰줘야 하고
  • karaf와 nexus간의 환경은 되어 있어야 함.

plugin#

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>exec-maven-plugin</artifactId>
    <version>1.6.0</version>
    <inherited>false</inherited>
    <executions>
    ...
    </executions>
</plugin>

karaf uninstall#

<execution>
    <id>bundle-uninstall</id>
    <phase>deploy</phase>
    <goals>
        <goal>exec</goal>
    </goals>
    <configuration>
        <executable>curl</executable>
        <arguments>
            <argument>-H</argument>
            <argument>Authorization: Basic a2FgYWY6d2xyqWFnbw==</argument>
            <argument>-H</argument>
            <argument>Content-Type: application/json</argument>
            <argument>-X</argument>
            <argument>POST</argument>
            <argument>-d</argument>
            <argument>[
                {
                "type" :"EXEC",
                "mbean": "org.apache.karaf:name=root,type=bundle",
                "operation" :"uninstall(java.lang.String)",
                "arguments" : ["${pom.artifactId}"]
                }
                ]
            </argument>
            <argument>
                http://localhost:8183/jolokia
            </argument>
        </arguments>
    </configuration>
</execution>

karaf install#

<execution>
    <id>bundle-install</id>
    <phase>deploy</phase>
    <goals>
        <goal>exec</goal>
    </goals>
    <configuration>
        <executable>curl</executable>
        <arguments>
            <argument>-H</argument>
            <argument>Authorization: Basic a2FgYWY6d2xyqWFnbw==</argument>
            <argument>-H</argument>
            <argument>Content-Type: application/json</argument>
            <argument>-X</argument>
            <argument>POST</argument>
            <argument>-d</argument>
            <argument>[
                {
                "type" :"EXEC",
                "mbean": "org.apache.karaf:name=root,type=bundle",
                "operation" :"install(java.lang.String, boolean)",
                "arguments" : ["mvn:${pom.groupId}/${pom.artifactId}/${pom.version}", "true"]
                }
                ]
            </argument>
            <argument>
                http://localhost:8183/jolokia
            </argument>
        </arguments>
    </configuration>
</execution> 
Issue Sharer
Comment 1

  • Added KKoZZi added
    maven
    label 2022-12-16
  • Closed KKoZZi closed this issue 2022-12-16
  • Open KKoZZi reopened this issue 2022-12-17
    • Markdown help
    • Header
    • Text Style
    • Link
    • List
    • Checklist
    • Image
    • Blockquote
    • Code
    • Table
    • Short Link
    • Markdown Input
      Markdown Output
      # This is an H1
      ## This is an H2
      ### This is an H3
      
      # This is an H1 ## This is an H2 ### This is an H3
    • Markdown Input
      Markdown Output
      *This is an italic*
      **This is an bold**
      ~~This is an strike~~
      
      *This is an italic* **This is an bold** ~~This is an strike~~
    • Markdown Input
      Markdown Output
      - Red
          1. White
          2. Blue
      - Green.
      
      - Red 1. White 2. Blue - Green
    • Markdown Input
      Markdown Output
      - [ ] Todos
          - [x] To do A
          - [ ] To do B
          - [ ] To do C
                          
      • Todos
        • To do A
        • To do B
        • To do C
    • Markdown Input
      Markdown Output
      ![title](https://repo.yona.io/assets/images/ico-like-small.png "Yobi")
      
      ![title](/assets/images/ico-like-small.png "Yobi")
    • Markdown Input
      Markdown Output
      > Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
      >
      > Aenean commodo ligula eget dolor.
      
      > Lorem ipsum dolor sit amet, consectetuer adipiscing elit. > > Aenean commodo ligula eget dolor.
    • Markdown Input
      Markdown Output
      `function test() {console.log("hello world");}`
      
      ```javascript
      function test() {
        console.log("hello world");
      }
      ```
      
      `function test() {console.log("hello world");}` ```javascript function test() { console.log("hello world"); } ```
    • Markdown Input
      Markdown Output
      | Default      | Align center | Align right |
      | ------------ | :----------: | ------: |
      | Carrot       | Red          | 1,000   |
      | Banana       | Yellow       | 32,000  |
      
      | Default | Align center | Align right | | ------------ | :----------: | ------: | | Carrot | Red | 1,000 | | Banana | Yellow | 32,000 | Also, you can copy & paste table from excel sheet
    Notification receivers
    Drag & Drop files here to upload.
    Tasks

    karaf maven 배포 실패시 Check 할 사항#

    settings.xml 확인

            <server>
              <id>MyComp-Nexus</id>
              <username>admin</username>
              <password>DPadmin1234s*</password>
            </server>
    
    Reply
  • Added KKoZZi added
    dev
    label 2022-12-17
  • KKoZZi added
    java
    label 2022-12-17
Add a comment