eclipse / microprofile-samples

Micro Profile Samples
Apache License 2.0
117 stars 63 forks source link

Create a websphere liberty profile #25

Open johnament opened 7 years ago

johnament commented 7 years ago

We should have a Websphere Liberty profile maven profile available, so that users can download and run automatically.

I'm not sure if we can reach out to someone at IBM? I know there's an arquillian container, would be great if it could be auto downloaded.

Emily-Jiang commented 6 years ago

@johnament sorry for taking so long to respond.. This issue somehow was overlooked. What do you mean by saying WebSphere liberty profile? Have you tried our Open Liberty maven plugin? See the following example.

<plugin>
                <groupId>net.wasdev.wlp.maven.plugins</groupId>
                <artifactId>liberty-maven-plugin</artifactId>
                <version>2.0</version>
                <configuration>
                    <assemblyArtifact>
                        <groupId>io.openliberty</groupId>
                        <artifactId>openliberty-runtime</artifactId>
                        <version>LATEST</version>
                        <type>zip</type>
                    </assemblyArtifact>
                    <configFile>src/main/liberty/config/server.xml</configFile>
                    <packageFile>${package.file}</packageFile>
                    <include>${packaging.type}</include>
                    <bootstrapProperties>
                        <default.http.port>${testServerHttpPort}</default.http.port>
                        <default.https.port>${testServerHttpsPort}</default.https.port>
                    </bootstrapProperties>
                </configuration>
                <executions>
                    <execution>
                        <id>install-liberty</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>install-server</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>install-app</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>install-apps</goal>
                        </goals>
                        <configuration>
                            <looseApplication>true</looseApplication>
                            <stripVersion>true</stripVersion>
                            <installAppPackages>project</installAppPackages>
                        </configuration>
                    </execution>
                    <execution>
                        <id>start-server</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>start-server</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>stop-server</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>stop-server</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>package-app</id>
                        <phase>package</phase>
                        <goals>
                            <goal>package-server</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>target/wlp-package</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
tevans78 commented 6 years ago

I think a little more work than that is needed to update the sample instructions on how to both test and run using Liberty

johnament commented 6 years ago

Right, if you look at https://github.com/eclipse/microprofile-samples/blob/master/pom.xml#L379 there's profiles per vendor. The idea would be to add liberty to this profile so that a user can come here and run it with liberty (ideally it should include all dependencies to run the app, without the user having installed liberty first, but really up to your requirements/limitations)

johnament commented 6 years ago

BTW, maven team recommends against the use of LATEST, and I believe they're actually removing support for it soon. I believe this is supported solution: https://stackoverflow.com/questions/30571/how-do-i-tell-maven-to-use-the-latest-version-of-a-dependency/1172805#1172805