{"action":"created","issue":{"url":"https://api.github.com/repos/WASdev/ci.maven/issues/374","repository_url":"https://api.github.com/repos/WASdev/ci.maven","labels_url":"https://api.github.com/repos/WASdev/ci.maven/issues/374/labels{/name}","comments_url":"https://api.github.com/repos/WASdev/ci.maven/issues/374/comments","events_url":"https://api.github.com/repos/WASdev/ci.maven/issues/374/events","html_url":"https://github.com/WASdev/ci.maven/issues/374","id":355197860,"node_id":"MDU6SXNzdWUzNTUxOTc4NjA=","number":374,"title":"InstallServerMojo fails with: Unable to find artifact version of foo:liberty in either project dependencies or in project dependencyManagement.","user":{"login":"stewartfrancis","id":3422268,"node_id":"MDQ6VXNlcjM0MjIyNjg=","avatar_url":"https://avatars2.githubusercontent.com/u/3422268?v=4","gravatar_id":"","url":"https://api.github.com/users/stewartfrancis","html_url":"https://github.com/stewartfrancis","followers_url":"https://api.github.com/users/stewartfrancis/followers","following_url":"https://api.github.com/users/stewartfrancis/following{/other_user}","gists_url":"https://api.github.com/users/stewartfrancis/gists{/gist_id}","starred_url":"https://api.github.com/users/stewartfrancis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stewartfrancis/subscriptions","organizations_url":"https://api.github.com/users/stewartfrancis/orgs","repos_url":"https://api.github.com/users/stewartfrancis/repos","events_url":"https://api.github.com/users/stewartfrancis/events{/privacy}","received_events_url":"https://api.github.com/users/stewartfrancis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-08-29T14:49:36Z","updated_at":"2018-08-29T14:53:53Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"We're using the install server mojo, to provision a development environment from a shared server that's assembled in an earlier part of our reactor build.  Binding the liberty maven plugin to the `generate-resources` phase of the build so it runs sufficiently early for us.\r\n\r\nWe've previously been taking advantage of the functionality which fills in the version of maven dependencies from the `<dependencies>` section of pom.xml as follows:\r\n\r\n```xml\r\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\r\n  <modelVersion>4.0.0</modelVersion>\r\n  <groupId>foo</groupId>\r\n  <artifactId>liberty-dev</artifactId>\r\n  <packaging>pom</packaging>\r\n\r\n  <properties>\r\n    <liberty.usr.dir>${project.build.directory}/wlp/usr</liberty.usr.dir>\r\n    <server.config.dir>${liberty.usr.dir}/servers/${wlpServerName}</server.config.dir>\r\n  </properties>\r\n\r\n  <dependencies>\r\n    <dependency>\r\n      <groupId>${project.groupId}</groupId>\r\n      <artifactId>liberty</artifactId>\r\n      <version>${project.version}</version>\r\n      <classifier>wlp</classifier>\r\n      <type>zip</type>\r\n    </dependency>\r\n  </dependencies>\r\n\r\n  <build>\r\n    <plugins>\r\n      <plugin>\r\n        <groupId>net.wasdev.wlp.maven.plugins</groupId>\r\n        <artifactId>liberty-maven-plugin</artifactId>\r\n        <configuration>\r\n          <assemblyArtifact>\r\n            <groupId>${project.groupId}</groupId>\r\n            <artifactId>liberty</artifactId>\r\n            <classifier>wlp</classifier>\r\n            <type>zip</type>\r\n          </assemblyArtifact>\r\n          <assemblyInstallDirectory>${project.build.directory}</assemblyInstallDirectory>\r\n        </configuration>\r\n        <executions>\r\n          <execution>\r\n            <id>install-server</id>\r\n            <phase>generate-resources</phase>\r\n            <goals>\r\n              <goal>install-server</goal>\r\n            </goals>\r\n          </execution>\r\n        </executions>\r\n      </plugin>\r\n\r\n    </plugins>\r\n  </build>\r\n</project>\r\n\r\n```\r\n\r\nHowever when I try running with `liberty-maven-plugin:2.5` it fails with the following error:\r\n\r\n```\r\n[ERROR] Failed to execute goal net.wasdev.wlp.maven.plugins:liberty-maven-plugin:2.5:install-server (install-server) on project liberty-dev: Unable to find artifact version of foo:liberty in either project dependencies or in project dependencyManagement. -> [Help 1]\r\norg.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal net.wasdev.wlp.maven.plugins:liberty-maven-plugin:2.5:install-server (install-server) on project liberty-dev: Unable to find artifact version of foo:liberty in either project dependencies or in project dependencyManagement.\r\n\tat org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)\r\n\tat org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)\r\n\tat org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)\r\n\tat org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)\r\n\tat org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)\r\n\tat org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)\r\n\tat org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)\r\n\tat org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)\r\n\tat org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)\r\n\tat org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)\r\n\tat org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)\r\n\tat org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)\r\n\tat org.apache.maven.cli.MavenCli.main(MavenCli.java:191)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:498)\r\n\tat org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)\r\n\tat org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)\r\n\tat org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)\r\n\tat org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)\r\nCaused by: org.apache.maven.plugin.MojoExecutionException: Unable to find artifact version of foo:liberty in either project dependencies or in project dependencyManagement.\r\n\tat net.wasdev.wlp.maven.plugins.AbstractLibertySupport.getArtifact(AbstractLibertySupport.java:177)\r\n\tat net.wasdev.wlp.maven.plugins.BasicSupport.init(BasicSupport.java:193)\r\n\tat org.codehaus.mojo.pluginsupport.MojoSupport.execute(MojoSupport.java:119)\r\n\tat org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)\r\n\tat org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)\r\n\t... 20 more\r\n```"},"comment":{"url":"https://api.github.com/repos/WASdev/ci.maven/issues/comments/416983587","html_url":"https://github.com/WASdev/ci.maven/issues/374#issuecomment-416983587","issue_url":"https://api.github.com/repos/WASdev/ci.maven/issues/374","id":416983587,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNjk4MzU4Nw==","user":{"login":"stewartfrancis","id":3422268,"node_id":"MDQ6VXNlcjM0MjIyNjg=","avatar_url":"https://avatars2.githubusercontent.com/u/3422268?v=4","gravatar_id":"","url":"https://api.github.com/users/stewartfrancis","html_url":"https://github.com/stewartfrancis","followers_url":"https://api.github.com/users/stewartfrancis/followers","following_url":"https://api.github.com/users/stewartfrancis/following{/other_user}","gists_url":"https://api.github.com/users/stewartfrancis/gists{/gist_id}","starred_url":"https://api.github.com/users/stewartfrancis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stewartfrancis/subscriptions","organizations_url":"https://api.github.com/users/stewartfrancis/orgs","repos_url":"https://api.github.com/users/stewartfrancis/repos","events_url":"https://api.github.com/users/stewartfrancis/events{/privacy}","received_events_url":"https://api.github.com/users/stewartfrancis/received_events","type":"User","site_admin":false},"created_at":"2018-08-29T14:53:53Z","updated_at":"2018-08-29T14:53:53Z","author_association":"CONTRIBUTOR","body":"I took a quick look at `AbstractLibertyMojo` and it looks like it was relatively recently updated to use the Maven 3 API, rather than using what was previously provided by `MojoSupport`\r\n\r\n`resolveFromProjectDependencies` is now using the Maven 3 API: `MavenProject.getArtifacts()`\r\n\r\nThe javadoc for this method says that the contents are lazily populated.  I also noted that unlike `InstallAppsMojo`, `InstallServerMojo` doesn't force dependency resolution.  Could be the fix is to add `requiresDependencyResolution = ResolutionScope.COMPILE_PLUS_RUNTIME` to the `InstallServerMojo`?"}}
{"actor":{"display_login":"stewartfrancis"}}