question on javascript-maven-plugin usage for simple js file concatenation

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

question on javascript-maven-plugin usage for simple js file concatenation

Hubert Przybysz
Hi,
I've tried to use javascript-maven-plugin to produce an artifact of js packaging type that is to be a simple concatenation of a number of js files. I have an html file with script tags pointing at the js files without using js-import's ${file.js} properties . Webminifier finds the files, concatenates and minifies to 1.js and 1-min.js, but the install plugin reports an error "The packaging for this project did not assign a file to the build artifact".
Any ideas what the problem is and how to fix it?
Regards,
Hubert.
Reply | Threaded
Open this post in threaded view
|

Re: question on javascript-maven-plugin usage for simple js file concatenation

Christopher Hunt-2
Hi Hubert,

Did you use the JS RIA archetype to generate the project? That should act as a good template.

Kind regards,
Christopher
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: question on javascript-maven-plugin usage for simple js file concatenation

Hubert Przybysz
Yes, I did. My js files, however, do not have module definitions as in the archetype. I played with very similar setup as in the archetype but failed to get the files imported. I'm guessing that was due to that almond seems to accept only well defined modules. Therefore I have decided to circumvent the js-import part of the javascript plugin functionality by not using js-import properties. In such setup, the webminifier kicks in on the script tags in my html, correctly produces 1.js and 1-min.js but the javascript plugin fails to define an artifact for the install plugin to install. Perhaps this is not how the javascript plugin is meant to be used?
Reply | Threaded
Open this post in threaded view
|

Re: question on javascript-maven-plugin usage for simple js file concatenation

Christopher Hunt-2
Webminifier and js-import are unrelated, but my advice would be to use AMD modules and wrap those js files that are not using AMD with AMD define statements.

However, back to your problem... can you please send me the last 50 lines of mvn console output. I have a feeling that some things are being installed, but that the message may be throwing you...


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: question on javascript-maven-plugin usage for simple js file concatenation

Hubert Przybysz
Thanks for looking into this. Perhaps this trace will be useful:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.3.1:install (default-install) on project x-js: The packaging for this project did not assign a file to the build artifact -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.3.1:install (default-install) on project x-js: The packaging for this project did not assign a file to the build artifact
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
        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:84)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:534)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: The packaging for this project did not assign a file to the build artifact
        at org.apache.maven.plugin.install.InstallMojo.execute(InstallMojo.java:124)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:107)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
        ... 19 more
[ERROR]
Reply | Threaded
Open this post in threaded view
|

Re: question on javascript-maven-plugin usage for simple js file concatenation

Christopher Hunt-2
Thanks Hubert. Unfortunately that doesn't really help me. Would you mind sending me the normal mvn output; or are you stating that this is the normal output?


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: question on javascript-maven-plugin usage for simple js file concatenation

Tomas Alabes
I have the same problem, and I my output isn't really different... Hubert, did you find any solution? Or Christopher...


Christopher Hunt-2 wrote
Thanks Hubert. Unfortunately that doesn't really help me. Would you mind sending me the normal mvn output; or are you stating that this is the normal output?


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: question on javascript-maven-plugin usage for simple js file concatenation

Christopher Hunt-2
Hi there,

If you can provide me with a reproducible test case then I can take a look.

Kind regards,.
Christopher

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: question on javascript-maven-plugin usage for simple js file concatenation

Tomas Alabes

This is my output after concatenation:

[INFO] 1-min.js minified from 504502 to 211110 bytes (41% of original size)
[INFO]
[INFO] --- maven-install-plugin:2.3.1:install (default-install) @
composer.ba.js ---
[DEBUG] Configuring mojo
org.apache.maven.plugins:maven-install-plugin:2.3.1:install from plugin
realm ClassRealm[plugin>org.apache.maven.plugins:maven-install-plugin:2.3.1,
parent: sun.misc.Launcher$AppClassLoader@43be2d65]
[DEBUG] Configuring mojo
'org.apache.maven.plugins:maven-install-plugin:2.3.1:install' with basic
configurator -->
[DEBUG]   (f) artifact = company:composer.ba.js:js:12.1.1.0.0
[DEBUG]   (f) attachedArtifacts = []
[DEBUG]   (f) createChecksum = false
[DEBUG]   (f) localRepository =        id: local
      url: file:///Users/talabes/.local_soa_repository/repository/
   layout: none

[DEBUG]   (f) packaging = js
[DEBUG]   (f) pomFile = moduleDir/composer/ba/js/pom.xml
[DEBUG]   (f) updateReleaseInfo = false
[DEBUG] -- end configuration --

[...]

[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-install-plugin:2.3.1:install
(default-install) on project composer.ba.js: The packaging for this project
did not assign a file to the build artifact -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute
goal org.apache.maven.plugins:maven-install-plugin:2.3.1:install
(default-install) on project composer.ba.js: The packaging for this project
did not assign a file to the build artifact
        at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
        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:84)
        at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
        at
org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
        at
org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:463)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:185)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:139)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at
org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
        at
org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
        at
org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
        at
org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: The packaging for
this project did not assign a file to the build artifact
        at
org.apache.maven.plugin.install.InstallMojo.execute(InstallMojo.java:124)
        at
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:107)
        at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
        ... 19 more
[ERROR]


That is the most significant part of the output, I'm also not using the AMD
part of the plugin, I didn't use require.js, can this be a problem?

Thanks!


Christopher Hunt-2 wrote:

>
> Hi there,
>
> If you can provide me with a reproducible test case then I can take a
> look.
>
> Kind regards,.
> Christopher
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>
>
>

--
View this message in context: http://old.nabble.com/question-on-javascript-maven-plugin-usage-for-simple-js-file-concatenation-tp33660574p34537104.html
Sent from the mojo - user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email