GithubHelp home page GithubHelp logo

openliberty / ci.maven Goto Github PK

View Code? Open in Web Editor NEW
124.0 124.0 88.0 5.1 MB

Maven plugins for managing Liberty profile servers #devops

License: Apache License 2.0

Java 99.30% HTML 0.28% Dockerfile 0.42% Batchfile 0.01%
build-tool-integration

ci.maven's People

Contributors

anjumfatima90 avatar awisniew90 avatar bmarwell avatar cherylking avatar chyt avatar cthigh avatar dblitz avatar dependabot[bot] avatar dnwarnock avatar dshimo avatar ericglau avatar evie-lau avatar gcharters avatar hughesj avatar jgawor avatar jjiwoolim avatar jjvilleg avatar katheris avatar kathrynkodama avatar m-schutte-ohra-nl avatar mattbsox avatar mcmorab avatar misaelsalcido avatar nottycode avatar patricktiu avatar scottkurz avatar stewartfrancis avatar trevcraw avatar turkeylurkey avatar wasdevb1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ci.maven's Issues

Timeouts are inconsistent

Some timeouts are specified in milliseconds and some are specified in seconds. The timeout units should be consistent in the plugin.
Change the timeouts in deploy/undeploy goals to be specified in seconds.

Enable execution of integration tests in Travis

It would be nice if the integration tests could be performed in the travis build. And also, add support to execute the integration tests by downloading a wlp automatically by just providing the version and the license code.

Change install to be a goal rather than a configuration setting

Currently installation of Liberty happens depending on what configuration properties you set. This means that you have to write a lot more code if you want the user to be able to choose per build whether they supply their own Liberty.

It would be better if we could supply one property e.g. installDir and then if we run the install goal Liberty is installed into installDir and if we don't then the plugin assumes that installDir points to our existing install.

The current way I am getting around this problem is creating profiles for each type of install which is a lot of code and added complexity that I would rather not force upon the user.

Cache installed features

We cache Liberty archive jars that come from the Liberty repository into ~/.m2/repository/wlp-cache so we don't have to download them on every build. This is consistent with how maven downloads and stores dependencies locally in the local repository. But we don't cache additional Liberty features a pom installs. So every subsequent time a build runs, the additional features are downloaded from the Liberty repository. We should be consistent with the feature downloads and put them in some place in the wlp-cache.

The best way to do this would be with the installUtility command. e.g.
installUtility download --location=${settings.localRepository}/wlp-cache/features-<version> <featureName>
where <version> is the product version from the productInfo version command. It's important to put the version in the directory name because 8.5.5.6 feature binaries won't run on 8.5.5.7.
Then doing:
installUtility install --from=${settings.localRepository}/wlp-cache/features
The installUtility download will take care of not re-downloading features.

serverEnv setting fails

net.wasdev.wlp.maven.plugins.server.StartDebugMojoSupport fails when setting serverEnv as both setTodir() and setTofile() are called. Please remove setTodir() call.

Add ability to deploy application to WAS Liberty server.xml file

Add ability to liberty-maven-plugin:deploy goal to allow application deployment to WAS Liberty server.xml file in addition to the dropins directory. Additionally this will allow usage of the shared library feature of Liberty and specify the context root to use.

So example of the resulting deploy plugin execution

                    <execution>
                        <id>deploy-war</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>deploy</goal>
                        </goals>
                        <configuration>
                            <contextRoot>some/path</contextRoot>
                            <useGlobalLib>true</useGlobalLib>
                            <appArtifact>
                                <groupId>com.mycompany</groupId>
                                <artifactId>my-war</artifactId>
                                <type>war</type>
                            </appArtifact>
                        </configuration>
                    </execution>

would config server.xml like:

    <application location="C:\.m2\repository\com\mycompany\1.0\my-war-1.0.war" context-root="some/path">        
        <classloader commonLibraryRef="global"/>
    </application>

install from repository failing with ClassNotFoundException com.ibm.websphere.ssl.protocol.SSLSocketFactory

[ERROR] Failed to execute goal net.wasdev.wlp.maven.plugins:liberty-maven-plugin:1.1-SNAPSHOT:create-server (default) on project com.my.company.liberty.server: java.net.SocketException: java.lang.ClassNotFoundException: Cannot find the specified class com.ibm.websphere.ssl.protocol.SSLSocketFactory -> [Help 1]

when using IBM JRE 1.7. but works when using IBM JRE 1.8
java version "1.7.0"
Java(TM) SE Runtime Environment (build pwa6470_27sr1ifix-20140713_01(SR1+IX90150
+IX90144+IV60711+IV60971+IV61564+IV62037+IV62044))
IBM J9 VM (build 2.7, JRE 1.7.0 Windows 7 amd64-64 Compressed References 2014070
9_205990 (JIT enabled, AOT enabled)
J9VM - R27_Java727_SR1_20140709_1757_B205990
JIT - tr.r13.java_20140410_61421.08
GC - R27_Java727_SR1_20140709_1757_B205990_CMPRSS
J9CL - 20140709_205990)
JCL - 20140409_01 based on Oracle 7u55-b13

sample pom:

net.wasdev.wlp.maven.plugins
liberty-maven-plugin
1.1-SNAPSHOT


                        <install> 
                            <licenseCode>L-JTHS-95XRL8</licenseCode>                                                                                      
                        </install>
                        <!-- installDirectory>${basedir}/stage</installDirectory-->                                  
                    </configuration>        

                <goals>
                    <goal>create-server</goal>
                </goals>
                <phase>install</phase>
                </execution>
            </executions>                            
        </plugin>

full stacktrace:

[ERROR] Failed to execute goal net.wasdev.wlp.maven.plugins:liberty-maven-plugin:1.1-SNAPSHOT:create-server (default) on project com.my.company.liberty.server: java.net.SocketException: java.lang.ClassNotFoundException: Cannot find the specified class com.ibm.websphere.ssl.protocol.SSLSocketFactory -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal net.wasdev.wlp.maven.plugins:liberty-maven-plugin:1.1-SNAPSHOT:create-server (default) on project com.my.company.liberty.server: java.net.SocketException: java.lang.ClassNotFoundException: Cannot find the specified class com.ibm.websphere.ssl.protocol.SSLSocketFactory
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:94)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
at java.lang.reflect.Method.invoke(Method.java:619)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: java.net.SocketException: java.lang.ClassNotFoundException: Cannot find the specified class com.ibm.websphere.ssl.protocol.SSLSocketFactory
at org.codehaus.mojo.pluginsupport.MojoSupport.execute(MojoSupport.java:137)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
Caused by: java.net.SocketException: java.lang.ClassNotFoundException: Cannot find the specified class com.ibm.websphere.ssl.protocol.SSLSocketFactory
at net.wasdev.wlp.ant.install.InstallLibertyTask.execute(InstallLibertyTask.java:50)
at net.wasdev.wlp.maven.plugins.BasicSupport.installFromArchive(BasicSupport.java:372)
at net.wasdev.wlp.maven.plugins.BasicSupport.installServerAssembly(BasicSupport.java:282)
at net.wasdev.wlp.maven.plugins.server.CreateServerMojo.doExecute(CreateServerMojo.java:46)
at org.codehaus.mojo.pluginsupport.MojoSupport.execute(MojoSupport.java:122)
... 21 more
Caused by: java.net.SocketException: java.lang.ClassNotFoundException: Cannot find the specified class com.ibm.websphere.ssl.protocol.SSLSocketFactory
at javax.net.ssl.DefaultSSLSocketFactory.a(SSLSocketFactory.java:2)
at javax.net.ssl.DefaultSSLSocketFactory.createSocket(SSLSocketFactory.java:9)
at com.ibm.net.ssl.www2.protocol.https.c.createSocket(c.java:168)
at sun.net.NetworkClient.doConnect(NetworkClient.java:174)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:461)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:556)
at com.ibm.net.ssl.www2.protocol.https.c.(c.java:51)
at com.ibm.net.ssl.www2.protocol.https.c.a(c.java:50)
at com.ibm.net.ssl.www2.protocol.https.d.getNewHttpClient(d.java:12)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:944)
at com.ibm.net.ssl.www2.protocol.https.d.connect(d.java:42)
at com.ibm.net.ssl.www2.protocol.https.b.connect(b.java:41)
at org.apache.tools.ant.taskdefs.Get$GetThread.openConnection(Get.java:660)
at org.apache.tools.ant.taskdefs.Get$GetThread.get(Get.java:579)
at org.apache.tools.ant.taskdefs.Get$GetThread.run(Get.java:569)
Caused by: java.lang.ClassNotFoundException: Cannot find the specified class com.ibm.websphere.ssl.protocol.SSLSocketFactory
at javax.net.ssl.SSLJsseUtil.b(SSLJsseUtil.java:147)
at javax.net.ssl.SSLSocketFactory.getDefault(SSLSocketFactory.java:8)
at javax.net.ssl.HttpsURLConnection.getDefaultSSLSocketFactory(HttpsURLConnection.java:3)
at javax.net.ssl.HttpsURLConnection.(HttpsURLConnection.java:19)
at com.ibm.net.ssl.www2.protocol.https.b.(b.java:53)
at com.ibm.net.ssl.www2.protocol.https.Handler.openConnection(Handler.java:2)
at com.ibm.net.ssl.www2.protocol.https.Handler.openConnection(Handler.java:10)
at java.net.URL.openConnection(URL.java:983)
at org.apache.tools.ant.taskdefs.Get$GetThread.openConnection(Get.java:633)
... 2 more

Fix install-feature goal so you it fails if you didn't set the accept license property, or set it to false

When running the install-feature goal with the acceptLicense parameter not set, or set to false, you get a message printed out in the console to say that you need to accept the license, but it does not give you a mechanism to do so:
install-feature-snippet

If you run the command manually, rather than through the plugin, it works fine giving you the option to select 1 for agree or 2 for not agreeing.
install-feature-snippet2

Since the acceptLicense parameter is specified as not required this behaviour is incorrect.

Test the 1.1 release candidate

Once @jgawor has posted the release candidate, we should test with our existing sample repo's that use v1.0 today, to check they work with v1.1. The 12 factor app and the new securems samples would be good. For securems, there is no reactor pom yet, so you need to run mvn install on the apikey* projects inside that repo, in alphabetical order.
@jgawor - please post the snapshot repo site when you're ready. Thanks.

clean goal

There is no option to remove applications added with install-apps. A clean goal could be created to remove alle deployed apps

Add support for <skip>

None of the liberty-maven-plugin Mojos support
Even with skip all goals still run

            <plugin>
                <groupId>net.wasdev.wlp.maven.plugins</groupId>
                <artifactId>liberty-maven-plugin</artifactId>
                <configuration>
                    <skip>true</skip>
                </configuration>

Liberty plug-in improvements

  1. Add include parameter for package goal.
  2. Change default for cleanStart to false.
  3. Improve server-status goal to use Ant status operation.
  4. Remove old and unnecessary code.
  5. Add support for dump and javadump goals.
  6. Add support for setting userDirectory (WLP_USER_DIR).
  7. Stop server if application failed to start in alloted time in start-server.
  8. Ensure timeouts are consistent and can be set independently.
  9. Add support for setting outputDirectory (WLP_OUTPUT_DIR).
  10. Remove old & unused debug mode code.
  11. Improve install-apps goal to 1) allow version stripping, and 2) specifying a custom application directory.

web app sometimes takes too long to start when calling start-server goal

I use maven and the 1.1 liberty-maven-plugin to run integration tests. But sometimes the tests fail because after starting, the liberty server sometimes waits up to 60 seconds to actually deploy the web app. The tests fail because the build gives up waiting for the web app to be deployed.

Even when the tests succeed, sometimes there is a gap of over 10 seconds between the server starting and the web app starting:

[13/11/15 15:41:18:609 EST] 0000001f com.ibm.ws.tcpchannel.internal.TCPChannel                    I CWWKO0219I: TCP Channel defaultHttpEndpoint has been started and is now listening for requests on host *  (IPv6) port 53839.
[13/11/15 15:41:48:849 EST] 0000001a com.ibm.ws.kernel.feature.internal.FeatureManager            A CWWKF0012I: The server installed the following features: [jaxws-2.2, localConnector-1.0, json-1.0, jsp-2.2, servlet-3.0, jaxrs-1.1, jaxb-2.2].
[13/11/15 15:41:48:850 EST] 0000001a com.ibm.ws.kernel.feature.internal.FeatureManager            I CWWKF0008I: Feature update completed in 31.616 seconds.
[13/11/15 15:41:48:850 EST] 0000001a com.ibm.ws.kernel.feature.internal.FeatureManager            A CWWKF0011I: The server defaultServer is ready to run a smarter planet.
[13/11/15 15:41:58:257 EST] 00000024 com.ibm.ws.app.manager.AppMessageHelper                      I CWWKZ0018I: Starting application xyz.

Here is my configuration:

            <plugin>
                <groupId>net.wasdev.wlp.maven.plugins</groupId>
                <artifactId>liberty-maven-plugin</artifactId>
                <version>1.1</version>
                <configuration>
                    <install>
                        <licenseCode>...</licenseCode>
                        <version>8.5.+</version>
                    </install>
                    <installDirectory>/path/apps/wlp</installDirectory>
                </configuration>
                <executions>
                    <execution>
                        <id>start-server</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>start-server</goal>
                        </goals>
                        <configuration>
                            <applications>xyz</applications>
                            <bootstrapProperties>
                                <httpPort>${dynamicPort}</httpPort>
                                <appLocation>C:/path/to/xyz-0.0.1-SNAPSHOT.war</appLocation>
                            </bootstrapProperties>
                            <jvmOptions>
                                <param>-Xmx768m</param>
                            </jvmOptions>
                        </configuration>
                    </execution>
                    <execution>
                        <id>stop-server</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>stop-server</goal>
                        </goals>
                        <configuration>
                            <serverStopTimeout>30</serverStopTimeout>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

Whenever I deploy the same webapp using the eclipse websphere tools, the webapp is always deployed right away.

Is there some kind of processing or other step that happens before the webapp is deployed?

Add installUtility functionality to install all features for a server

Using the install-feature goal you have to specifically list all of the features you want to install. On a Liberty server you can use installUtility install ExampleServer to install all of the features required for the ExampleServer server.xml. This would be a really useful enhancement to have in the liberty-maven plugin so that if you update your server.xml file you don't have to manually update the build file.

1.0 release?

What is the plan for 1.0 release. Is it coming out soon,?

Improve application deployment/undeployment

Right now applications are deployed/undeployed using the dropins directory. However, it is more preferable to deploy/undeploy the applications by updating the server.xml and adding/removing the element.

Install feature fails if already installed, no matter the whenFileExists value

Even if I set <whenFileExists>ignore</whenFileExists>, mvn liberty:install-feature fails with rc=22.

It may not be an error from de plugin: calling

>.\featureManager.bat install --acceptLicense --when-file-exists=xxx --to=usr jaxrs-1.1

with ignore, replace or fail always results in error code 22

This is with 1.1-SNAPSHOT and installing from https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/downloads/wlp/8.5.5.5/wlp-runtime-8.5.5.5.jar

Rename serverHome parameter to installDirectory

serverHome parameter name is not consistent with other names such as userDirectory or outputDirectory. To make it consistent, it will be renamed to installDirectory. The code will still check for serverHome parameter to maintain backwards compability.

Inline bootstrap properties, jvm options

Right now the bootstrap properties and jvm options can be specified in the Liberty plug-in as files. It would be also good to support a way to inline within plugin configuration in pom.xml these settings as well.

Refresh archetype

Specifically:

  • Switch to require Java 7
  • Switch to use webProfile7 runtime - so that it won't require prior installation of Liberty.

Support multiple applications in deploy/undeploy

Hi. Looks like the v1.1 of the plugin does not support several

I have put several applications ( a natural thing to to.. IMHO) in the configuration, but the deploy/undeploy seems to only 'see' the first one.

Is this as designed or a bug ?

If it's designed, I would like to add this as a request....

liberty-maven-plugin should work offline

Liberty Maven Plugin should work offline.

Prerequisite:

  • Make sure that you have successfully executed liberty-maven-plugin before so that you have a local copy in the wlp-cache folder in your local Maven repository.

Step by Step:

  • Switch off your network connection (e.g. switch off wifi, remove your network cable, etc)
  • Execute mvn liberty:create-server -o (-o is Maven's offline mode )

Expected result:
The liberty-maven-plugin should successfully use the files stored in the local cache without any network calls.

Actual result:
[ERROR] Failed to execute goal net.wasdev.wlp.maven.plugins:liberty-maven-plugin:1.1-SNAPSHOT:create-server (create-server) on project test-project: java.net.UnknownHostException: public.dhe.ibm.com: Unknown host public.dhe.ibm.com -> [Help 1]

Comment:
The other goals of the liberty-maven-plugin should also work offline if a local copy exists.

Version used: 1.1-SNAPSHOT

assemblyArtifact does not exist

The following assemblyArtifact mentioned in the documentation does not exist:

                    <assemblyArtifact>
                        <groupId>net.wasdev.wlp.test</groupId>
                        <artifactId>liberty-test-server</artifactId>
                        <version>1.0</version>
                        <type>zip</type>
                    </assemblyArtifact>

Add ability to deploy to a remote full WAS server

We do dev testing against a local Liberty server.

However, sometimes we want to deploy to our pre-production server which has the full WebSphere 8.5.5 edition.

It but it would be nice enhancement if we could deploy to a remote WAS server (full edition) using the liberty maven plguin

mvn liberty:start-server fails with "Only one of tofile and todir may be set."

Here's my configuration that leads to the error mentioned in the title:

                    <plugin>
                        <groupId>com.ibm.websphere.wlp.maven.plugins</groupId>
                        <artifactId>liberty-maven-plugin</artifactId>
                        <version>1.1</version>
                        <configuration>
                            <serverHome>/Srdev/wlp-8.5.5.7/wlp</serverHome>
                            <serverName>cih</serverName>
                            <appArtifact>
                                <groupId>com.swissre.cih</groupId>
                                <artifactId>sr-cih-wls</artifactId>
                                <version>${project.version}</version>
                                <type>war</type>
                            </appArtifact>
                            <configFile>${basedir}/src/test/resources/server.xml</configFile>
                        </configuration>
                    </plugin>

Packaging server resources

I want to package a resources directory for a server using a property in the same way that the server.xml, bootstrap.properties etc. can be specified. i.e.

Non-zero return codes from underlying start/stop server commands cause Maven build failures

Consider the following case:
In a pre-clean phase, I want to ensure my Liberty server (residing in the target directory) is stopped. In post-clean, I configure and start my server (again residing in the target directory).

In this instance, on the first run, the pre-clean goal uses the stop-server goal which returns a non-zero return code because the server is not running yet. This causes the mvn build to fail.

Install features as Maven dependencies

Extend install-apps goal (or provide a separate one) to install features expressed as Maven dependencies. Something like:

<dependency>
    <groupId>myGroup</groupId>
    <artifactId>myFeature</artifactId>
    <version>1.0</version>
    <type>esa</type>
</dependency>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.