0

I have read number of articles on adding OpenLiberty plugin or dependency to Spring Boot app. For example https://www.baeldung.com/java-open-liberty

I tried all the suggestions but without success.

What I did so far?

I added plugin to the section of my pom.xml file:

        <plugin>
            <groupId>io.openliberty.tools</groupId>
            <artifactId>liberty-maven-plugin</artifactId>
            <version>3.5.1</version>
        </plugin>

I also tried couple of different versions but all I get is

Cannot resolve plugin io.openliberty.tools:liberty-maven-plugin:3.5.1

Instead of adding the plugin, I also tried adding the dependency:

    <dependency>
        <groupId>io.openliberty.tools</groupId>
        <artifactId>liberty-maven-plugin</artifactId>
        <version>3.4</version>
    </dependency>

But in this case, all I get is

Unresolved dependency: 'io.openliberty.tools:liberty-maven-plugin:jar:3.4'

As with the plugin, I also tried couple of other versions for dependency as well but all produced same issue.

pixel
  • 9,653
  • 16
  • 82
  • 149
  • That's odd. Can you even run a fully-qualified goal like 'help', e.g. `mvn io.openliberty.tools:liberty-maven-plugin:3.7.1:help -Ddetail=true -Dgoal=create` ? Assume you don't have some settings.xml entry causing you to avoid using release artifacts from Maven Central. Could you have some kind of local repo corruption? (If so possibly just delete ~/.m2/repository/io/openliberty/tools/*) ?? – Scott Kurz Jan 09 '23 at 14:34

1 Answers1

0

I'm using this config and it works fine for me (it additionally uses specific configuration section as I needed specific version, but you can omit it to get the latest):

<!-- Enable liberty-maven-plugin -->
            <plugin>
                <groupId>io.openliberty.tools</groupId>
                <artifactId>liberty-maven-plugin</artifactId>
                <version>3.6.1</version>
                <!-- Specify configuration, executions for liberty-maven-plugin -->
                <configuration>
                    <runtimeArtifact>
                        <groupId>com.ibm.websphere.appserver.runtime</groupId>
                        <artifactId>wlp-webProfile8</artifactId>
                        <version>22.0.0.3</version>
                        <type>zip</type>
                    </runtimeArtifact>
                </configuration>
            </plugin>

In addition here is maven version I'm using (check that also as some old maven versions may not work correctly):

mvn --version
Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d)
Maven home: C:\tools\apache-maven-3.8.1\bin\..
Java version: 11.0.6, vendor: Eclipse OpenJ9

Specifically for Springboot, I'd suggest to checkout this guide - Containerizing, packaging, and running a Spring Boot application - which might be a good start for you.

Gas
  • 17,601
  • 4
  • 46
  • 93