Win a copy of Java Persistence with Spring Data and Hibernate this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

Executable jar file dumped by maven after the pom execution

 
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I have made an executable jar file through maven .Please tell me how to execute it
I tried as follows:-

mvn exec:java -D target/executablefile-name.jar

but no results
Thanks
As
C.R.M.k


 
Comal Rajagopalaratnam Muthukumar
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Comal Rajagopalaratnam Muthukumar wrote:Hi
I have made an executable jar file through maven .Please tell me how to execute it
I tried as follows:-

mvn exec:java -D target/executablefile-name.jar

but no results
Thanks
As
C.R.M.k
Hi




The output obtained is as folllows


Is there any other method to run it.
Thanks
As
CRMK











 
Saloon Keeper
Posts: 14792
333
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you read the error message? It says exactly what's wrong.
 
Comal Rajagopalaratnam Muthukumar
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:Did you read the error message? It says exactly what's wrong.



Hi
The very purpose of indicatiing in the POM as the mainClassmanifest  attribute is totally lost if maven is finding some excuse to avoid a good output.
and if this is a real error then  ,i request you to do the correction.this is besides  having called the http:\\ibiblio.org.com in the pom as addtional <url> to help during emergeny times  if  my local repository fails.
Hope you are now convinceed of my request

Thanks
As
CRMK
 
Stephan van Hulst
Saloon Keeper
Posts: 14792
333
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you show us your POM and Manifest?
 
Comal Rajagopalaratnam Muthukumar
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:Can you show us your POM and Manifest?


Hi
The manifest file exists as manifest.txt with values as ;-Main-Class: spring.SpringBOxLayoutPanel
my POM  in which the mainClassmanist is attribute is included as follows:


Shall be pleased if you tell me how to make this atribute entry available in the codus.org.com as shown in the error message.since my pom does show a standalone application viz SpringBoxLayoutPanel.java whose classes are in dirfolder spring
Thanks
As
CRMK
 
Stephan van Hulst
Saloon Keeper
Posts: 14792
333
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why are you trying to run a WAR from the command line? A WAR is a web application, not a console application.

Your configuration looks wrong. Why do you have a <configuration> element inside a <configuration> element? Where did you get <mainClassmanifest> from? It isn't documented on the maven-war-plugin page.
 
Comal Rajagopalaratnam Muthukumar
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:Why are you trying to run a WAR from the command line? A WAR is a web application, not a console application.

Your configuration looks wrong. Why do you have a <configuration> element inside a <configuration> element? Where did you get <mainClassmanifest> from? It isn't documented on the maven-war-plugin page.




Hi
       
        Many thanks for your valuable criticism .I have to mention this because your remarks are indirectly,helped me to know where i go wrong.
        Especially so for  war usage that need not be invoked through console a very impacted primitive correction .
        In this way other things also were very useful.
       
        But maven on his side plays his own role of error finding without any corrective measure whatsoever as you often do
        Please be surprised to go through this POM and its amazing yet same  resultswith no help rendered making me to rely on you
        Can you do something on this to stop repeaated finding faults by our esteemed guru viz Maven
       
       
       
        Thanks again
        As
        CRMK
       
       
       
               
               
       
 
Stephan van Hulst
Saloon Keeper
Posts: 14792
333
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What are you trying to achieve? What are you expecting to see when the command runs successfully?
 
Comal Rajagopalaratnam Muthukumar
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:What are you trying to achieve? What are you expecting to see when the command runs successfully?


Hi
I just wanted to see executable jarfile  created by maven run successfully giving the output .But unfortunately
this is not happening in-spite of various inclusions details like MANIFEST.MF etc
May i request the correction.

as for example
in my pom in the plugin place i included the MANIFEST.MF but still invain in result


As
CRMK
 
Stephan van Hulst
Saloon Keeper
Posts: 14792
333
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You say executable JAR, but in your original pom you are creating a WAR. Which is it, do you want an executable jar or a web application? And if you want a web application, why are you trying to execute it from the command line, that's not what WARs are for. We explained this to you in this thread: https://coderanch.com/t/661326/tools/Maven-sharing-Jar

If you want an executable JAR, do you already know how to make one without Maven? If you do, then start out by making the simplest POM you can that can create an executable JAR that runs a Hello World program. It shouldn't contain any dependencies, and no plugins other than the ones you need to create the JAR. After that, show us what you've done. Show us the complete POM, and the complete source code of your Hello World class.
 
Comal Rajagopalaratnam Muthukumar
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:You say executable JAR, but in your original pom you are creating a WAR. Which is it, do you want an executable jar or a web application? And if you want a web application, why are you trying to execute it from the command line, that's not what WARs are for. We explained this to you in this thread: https://coderanch.com/t/661326/tools/Maven-sharing-Jar

If you want an executable JAR, do you already know how to make one without Maven? If you do, then start out by making the simplest POM you can that can create an executable JAR that runs a Hello World program. It shouldn't contain any dependencies, and no plugins other than the ones you need to create the JAR. After that, show us what you've done. Show us the complete POM, and the complete source code of your Hello World class.



Hi
I  made the pom without any dependencies not even -junit-test and accordingly
a jar was created as usual,a jar  whoso starting letter is with pk(this refers to package )
This type of jar even though called executable jar is  it invariably does not run successfully .

The follwing is the pom for your ref


In the ordinary place an executable jar is created using the command
jar -cvmf manifest.txt  Huns.jar  humsi/*

manifest.txt :-> Main-Class: hello.HellowWorld

This is is the jist of your assignment that i request you to furthee eloborate or make it run ok
For Knowing source details
Please run
mvn package
you will get he details in the dumped target.
But it is of no use since this jar is unable to show results
Withstanding all these still  my thanks a lot for theinitiative & tutorship
Thanks




As
CRMK
 
Stephan van Hulst
Saloon Keeper
Posts: 14792
333
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, with this POM the jar won't run, because it doesn't add a Main-Class entry to the manifest file. To do that, you need to configure the maven-jar-plugin. The applicable goal is jar:jar.

On this page, you can find the configuration options for the jar:jar goal. Use it to update your POM, so that it runs the HellowWorld class. After you're done, or when you're stuck, post your entire POM here.
 
Comal Rajagopalaratnam Muthukumar
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:Yes, with this POM the jar won't run, because it doesn't add a Main-Class entry to the manifest file. To do that, you need to configure the maven-jar-plugin. The applicable goal is jar:jar.

On this page, you can find the configuration options for the jar:jar goal. Use it to update your POM, so that it runs the HellowWorld class. After you're done, or when you're stuck, post your entire POM here.



Hi
thanks for your suggestion.but the same failure exists.
Please use your goodoffices to nullify errors(Failure is the stepping stone for success -DaleCarnegi)
Thanks
As
CRMK










 
Stephan van Hulst
Saloon Keeper
Posts: 14792
333
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why did you add all those children to the <archive> and <manifest> elements? Do you need them? Why are you specifying both a manifest configuration and a manifest file? Why are you running unit tests?

Get rid of the manifest file and the unit tests. This assignment is about doing the bare minimal to create an executable jar with just a POM and a hello world class.

Don't add any elements to the POM unless you need them for this assignment.
 
Comal Rajagopalaratnam Muthukumar
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:Why did you add all those children to the <archive> and <manifest> elements? Do you need them? Why are you specifying both a manifest configuration and a manifest file? Why are you running unit tests?

Get rid of the manifest file and the unit tests. This assignment is about doing the bare minimal to create an executable jar with just a POM and a hello world class.

Don't add any elements to the POM unless you need them for this assignment.



Hi

the assignment you are referring is already completedin the last  with the failure since
if i remove the minimal dependencies viz junittest,iam unable to compile and no jar hence is
created.On the other hand with the inclusion of junit test(minimal)
everything is possible but executing the  jar is as usual toughest of the highest order
( I tried all means}.CAN YOU NOT A CONCRETELY EXTRACT ANY BODY from THIS FORUM WHO WAS ABLE TO not only build
jar but execut as well.Incidentally i am  sure thatif maven creates a jar
only without other ejb,ear, web etc ,then he uses only one artifactId .If this inference can be
useful to you  &  able to activate further then please  elaborate to get the needful done viz execution of jar.

Please respond to this with a yes or no since everthing was tried but the same repeatedly  resulted nil.
The follwing pom.xml file is supposed to be the one that might inspire to explore especially from your
suggeted jar-plugin inclusion for your perusal Also sometimes manually plugged items do not extract the wholething frutfullyHence
the Gotchagoal might help you to help
me


[code]

<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">
 <modelVersion>4.0.0</modelVersion>

 <groupId>Cocacola</groupId>
 <artifactId>spring.SpringBoxLayoutPanel</artifactId>
 <version>4.0</version>
 <packaging>jar</packaging>

 <name>spring.SpringBoxLayoutPanel</name>
 <url>http://maven.apache.org</url>;

 <properties>
   <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
   <Gotchagoal>unjar:jar -xvf jarname.jar</Gotchagoal>
   
   </properties>

 <dependencies>
   <dependency>
     <groupId>junit</groupId>
     <artifactId>junit</artifactId>
     <version>3.8.1</version>
     <scope>test</scope>
   </dependency>
 </dependencies>
   
     
       <build>
         <plugins>
           <plugin>
           
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-jar-plugin</artifactId>
             
             <version>3.0.2</version>
             <configuration>
             <executable>
             <execute>org.codehaus.mojo:exec-maven-plugin:1.5.0:exec (default-cli)</execute>
             <goal>jar:jar
                 <MANIFEST.MF>${project.build.outputDirectory}/MANIFEST.MF</MANIFEST.MF>
                 </goal>
                 </executable>
                 </configuration>
                    </plugin>
         </plugins>
     </build>
</project>
[code]
Thanks
As
CRMK

 
Stephan van Hulst
Saloon Keeper
Posts: 14792
333
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Comal Rajagopalaratnam Muthukumar wrote:the assignment you are referring is already completedin the last  with the failure since
if i remove the minimal dependencies viz junittest,iam unable to compile and no jar hence is
created.


No, you didn't complete it, because it failed.

On the other hand with the inclusion of junit test(minimal)
everything is possible but executing the  jar is as usual toughest of the highest order


That means that junit is NOT part of getting it to execute. I'm teaching you how to create an executable jar. junit is not necessary to achieve that, and right now we're doing the very minimal necessary to create an executable jar with Maven that will output Hello World!

( I tried all means}.CAN YOU NOT A CONCRETELY EXTRACT ANY BODY from THIS FORUM WHO WAS ABLE TO not only build
jar but execut as well.Incidentally i am  sure thatif maven creates a jar
only without other ejb,ear, web etc ,then he uses only one artifactId .If this inference can be
useful to you  &  able to activate further then please  elaborate to get the needful done viz execution of jar.


I'm able to create an executable jar, and I'm teaching you now how to do it. The artifact ID has nothing to do with it. You already know how to build an artifact using Maven, and we're now going to tell Maven what to do to make it executable as well.

Please respond to this with a yes or no since everthing was tried but the same repeatedly  resulted nil.
The follwing pom.xml file is supposed to be the one that might inspire to explore especially from your
suggeted jar-plugin inclusion for your perusal Also sometimes manually plugged items do not extract the wholething frutfullyHence
the Gotchagoal might help you to help
me


I don't understand what you've written here. The POM you've posted also includes way too much information. Why is your artifact called spring.SpringBoxLayoutPanel? A Hello World application has nothing to do with Spring or with layouts. What is Gotchagoal? It is unnecessary. junit is unnecessary. The exec-maven-plugin is unnecessary.

Here's the basics you need:
 
Comal Rajagopalaratnam Muthukumar
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
please indicate the exact coomand to execute the maven created jar file viz hello-world-1.0.jar

Thanks
As

CRMK
 
Stephan van Hulst
Saloon Keeper
Posts: 14792
333
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why don't you show me first how you completed the POM?
 
Comal Rajagopalaratnam Muthukumar
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:Why don't you show me first how you completed the POM?



Hi
please note that without using the junit test i created
the jar file and was not able to execute it either
i used  the following two types of command

mvn exec:exec -D exec.executable="java"
mvn exec:java   -D target/hellwworld-1.0.jar

It is rather difficult to execute it

please tell me if the configuration
is ok or not if not ok
indicate the same as to execute the to get the output
Thanks

As
CRMK


 
Stephan van Hulst
Saloon Keeper
Posts: 14792
333
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why are you using maven-exec-plugin to run the jar? You don't need it. Run the jar like you normally would, using the java command.

Why did you add <CreatedBy>, <MainClass>, <ManifestVersion> and <Class-Path>? Are you just guessing? Did you read the jar:jar goal documentation I linked to?
 
Comal Rajagopalaratnam Muthukumar
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:Why are you using maven-exec-plugin to run the jar? You don't need it. Run the jar like you normally would, using the java command.

Why did you add <CreatedBy>, <MainClass>, <ManifestVersion> and <Class-Path>? Are you just guessing? Did you read the jar:jar goal documentation I linked to?



Hi

Plese see how the error is shown
The latest revised pom is also shown

Maven is not kindenough to read the pom since the same type of snag is givgen plethora times repeated though every attribute is
indicated in pom

This for your needful action
Thanks
As
CRMK





 
Comal Rajagopalaratnam Muthukumar
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
If i execute in the odrdinary way also it never gives output
For example:
jar -xvf HellowWorld-1.0.jar
java -jar HellowWorlrd-1.0.jar
Resuts is :- No main class in the jar
Please note the differece between the two jars
HellWorld.jar ---HelloWorld-1.0.jar
 
Stephan van Hulst
Saloon Keeper
Posts: 14792
333
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'll repeat my questions: Are you just guessing what elements to add to the configuration, or did you read the documentation I linked to?
 
Comal Rajagopalaratnam Muthukumar
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:I'll repeat my questions: Are you just guessing what elements to add to the configuration, or did you read the documentation I linked to?


Hi

The whole lot of the program is again revised starting from scratch
and the following output  is fetched by using commands
mvn clean
mvn jar:jar

This successfully rendered a jar file --> HelloWorld-1.0.jar , though failed to  get installed

Also  on double clicking the same jar or in the tradional way  using the java -jar HellowWorld-1.0.jar do not not give  any output
*******
I included many details in the configuration tag so as to get the jar built as standalone jar that ececutes on double clicking.
But you wanted all these dependencies to get rid off.I am not particular about it since in the distribution proces of my standalone application (which is the bearminimum)
the jar execution may not be that important according to you probably

But on the other hand the same maven created jar file(HelloWorld-1.0.jar on opening with winrare -archiver(zip-type)
the follwing results are fetched  with POM created (same pom only) But this shold be sent to m2.repositry on install coomand but invain.
under


MANIFEST.MF:->

Manifest-Version: 1.0
Built-By: admin
Created-By: Apache Maven 3.3.9
Build-Jdk: 1.8.0_101

******************************
In lieu of these , please tell me what next .
give suggestion or command or supply me pom that works well for its totality for
all the functions used for opensource system etc


Hope this suffices
Thamks
As
CRMK
***********************************






 
Comal Rajagopalaratnam Muthukumar
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-jar-plugin:3.0.2:j
ar (target-jar) on project HelloWorld: You have to use a classifier to attach supplemental artifacts to the project instead of replacing them. -> [Help 1]

Here the suggestionr is for using a classifier .I do not know what it is
Thanks
As
CRMK
 
Stephan van Hulst
Saloon Keeper
Posts: 14792
333
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That error happened because you changed the <id> value of the <execution>. Do you have a reason you changed this?

In order to get an executable JAR, the manifest needs to contain a Main-Class entry with the qualified name of the class that serves as the entry point of your application. We need to configure the maven-jar-plugin to add this entry. If we look at the available configuration parameters on the documentation page, the only one that relates to the manifest or the archive containing the manifest file, is the <archive> parameter. How to configure the archive is then documented in the page that the <archive> parameter links to: http://maven.apache.org/shared/maven-archiver/index.html

Looking at the documentation there, there are three parameters we can use to configure the manifest entries: <manifest>, <manifestEntries> and <manifestFile>. We want to specify the entry point directly in the POM, so we won't be using <manifestFile>. We could use <manifestEntries> as a generic approach, but lets first look at the <manifest> structure.

Under the <manifest> description there are many interesting parameters, but the only one that we need right now is the <mainClass> parameter, which explicitly states it relates to the Main-Class manifest entry.

This means you can configure your entry point in archive/manifest/mainClass. You need 4 lines to open and close the <archive> and <manifest> elements, and 1 line to set the value of the <mainClass> element.

Since jar:jar binds to the package phase by default, you can create the JAR by running mvn package. You can then unzip it to verify that the generated manifest file contains the appropriate Main-Class entry.
 
Comal Rajagopalaratnam Muthukumar
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

Indeed our efforts never got wasted since
the results under your substantial tutotrialship
is so magnanimous and delightful that
i need not scratch HelowWorld-1.0.jar execution on double-click right now
,,Probably if
you may do amother session for classifier usage as per last message &
make this long episode a jackpot.( Now is it clear why i used the id as
executable-jar whih says about classifier)please note i have used the default
value for addClasspath as false after giving
the fully qualified path that was why installing was possible

Thanks
Cheers
As
CRMK

 THe winrar opening rendered the follewing
********************************
#Created by Apache Maven 3.3.9
version=1.0
groupId=com.example
artifactId=HelloWorld

************************

Manifest-Version: 1.0
Package: com.example
Built-By: admin
Created-By: Apache Maven 3.3.9
Build-Jdk: 1.8.0_101
Main-Class: com.exeample.Application

*****************************


 
Stephan van Hulst
Saloon Keeper
Posts: 14792
333
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From your post, I don't understand whether you got the JAR to execute, but there are still issues with your POM.

  • The <addClassPath> element is unnecessary. You should only use it if your JAR has dependencies on other libraries.
  • The <packageName> element is unnecessary. I'm not sure what the Package manifest entry does, but it's not necessary to create an executable JAR.
  • The <useUniqueVersions> element is unnecessary. The default value is already true, so you don't need to specify it.
  • Your indentation is incorrect. The </goals> closing tag should be on the same column as the <goals> opening tag. Your <archive>, <manifest> and <mainClass> entries should be indented in accordance with their nested level.
  • Your <mainClass> value contains a typo. Please be precise.

  • Taken together, this is how the <execution> should look:

    The reason that the <id> element has the default-jar value is because the POM already inherits this execution from its parent POM, and specifying an ID other than default-jar will create a new execution with the same plugin, which then requires a classifier. To see how the parent pom influences your current POM, you should run 'mvn help:effective-pom'. If we use a minimal POM, it will yield roughly the following result.

    Original POM in C:\Code\HelloWorld\pom.xml:

    Effective POM:

    In this POM, you can see that it already contains a maven-jar-plugin declaration with an execution:
     
    Comal Rajagopalaratnam Muthukumar
    Ranch Hand
    Posts: 401
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Hi
    Was eager to know further in making the executable file render output ok.Also
    the site deployment in this  was also rather unsportive .The error messgae
    tells pinpointedly the deficiency viz wagon-protocol for deploy the site
    please give example
    Shall be glad if you make the this errorless  by inclussion of the same
    Please note this venture is for a another application viz SimplexTool.
    on the same lines as that of
    The Hellow World( Of yours)is used as an example
    pom;-->



    But for  these two(executivejar not working) & site deploy is only partial)
    other thinngs or ok.

    Thanks and cheers
    As
    CRMK
     
    Stephan van Hulst
    Saloon Keeper
    Posts: 14792
    333
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Please don't post the effective POM. I can generate it myself. Post your original POM.

    Did you see that the error message tells you exactly what's wrong?
     
    Comal Rajagopalaratnam Muthukumar
    Ranch Hand
    Posts: 401
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Why the executable jar created is alwasys  non executable Plesse forward your concurrence on this else how to execute it (using maven)
    Thanks
    As
    CRMK
     
    Stephan van Hulst
    Saloon Keeper
    Posts: 14792
    333
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    You didn't show me your POM, how you executed it, or what the output was.
     
    Comal Rajagopalaratnam Muthukumar
    Ranch Hand
    Posts: 401
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Hi
    The output as well as pom remain same as already mentioned
    I just wanted the executabble jar created to get executed at the maven base directory.this is invain.

    Also in jdk../bi not working

    Please tell me why

    My java-home is set to jre directory as below
    mvn -v --->
    *************

    java-Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T22:11:47+05:30)
    Maven home: C:\Program Files\java\bin\apache-maven-3.3.9-bin\bin\..
    Java version: 1.8.0_101, vendor: Oracle Corporation
    Java home: C:\Program Files\java\jdk1.8.0_101\jre
    Default locale: en_IN, platform encoding: Cp1252
    OS name: "windows 7", version: "6.1", arch: "x86", family: "dos"


    Thanks
    As
    CRMK
     
    Stephan van Hulst
    Saloon Keeper
    Posts: 14792
    333
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Again, I don't know what POM you used, what you did to execute it, or what error message you are getting. The last POM you posted is your effective POM, which is useless to me.

    Please post your POM, what command you used, and what happened afterwards.
     
    Comal Rajagopalaratnam Muthukumar
    Ranch Hand
    Posts: 401
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Hi


    It has taken a lot of timein trail and error method to atlast get the output that you wanted me to get
    Yes the following  dialog is more than self explanatory
    .You must now help me to get the same out put without
    me manually updating the maven created Application-1.0-jar
    which i hope you remenber sometime back i called to make use of(Gotcha for non-extraction of details)
    ie;unjarring the jar.
    The same is done by a mere  updating here which is not 100% ok  inlieu of its tradional method otherwise
    the application(POM) rendered success for  the following

    phases
    *******
    compile
    package
    install
    tomcat:deploy
    post-site


    winrar.zip has given as follws
    *****************
    Manifest-Version: 1.0
    Implementation-Title: Application
    Implementation-Version: 1.0
    Archiver-Version: Plexus Archiver
    Built-By: admin
    Implementation-Vendor-Id: com.example
    Created-By: Apache Maven 3.3.9
    Build-Jdk: 1.8.0_101
    Main-Class: com.example.Application
    *************************

    SITE: a porton only shown below
    *****************************
    Dependency ConvergenceStatistics:  Number of dependencies (NOD): 1
    Number of unique artifacts (NOA): 1
    Number of version-conflicting artifacts (NOC): 0
    Number of SNAPSHOT artifacts (NOS): 0
    Convergence (NOD/NOA):  100 %
    Ready for release (100% convergence and no SNAPSHOTS):  Success

    ************************************

     It is here the rework job of making to execute on the maven created jar(Application-1.0-shaded.jar)
     
    please ref below and suggestfurthe if possible

    Thanks
    and cheers
    As
    CRMK


    [code]
    C:\Program Files\java\bin>jar -tf Application-1.0-shaded.jar
    META-INF/MANIFEST.MF
    META-INF/
    META-INF/maven/
    META-INF/maven/com.example/
    META-INF/maven/com.example/Application/
    META-INF/maven/com.example/Application/pom.xml
    META-INF/maven/com.example/Application/pom.properties

    C:\Program Files\java\bin>jar -uvf  Application-1.0-shaded.jar com/example/*
    adding: com/example/Application.class(in = 440) (out= 303)(deflated 31%)
    adding: com/example/Application.java(in = 189) (out= 143)(deflated 24%)

    C:\Program Files\java\bin>jar -tf  Application-1.0-shaded.jar
    META-INF/MANIFEST.MF
    META-INF/
    META-INF/maven/
    META-INF/maven/com.example/
    META-INF/maven/com.example/Application/
    META-INF/maven/com.example/Application/pom.xml
    META-INF/maven/com.example/Application/pom.properties
    *****************************************************************
    com/example/Application.class
    com/example/Application.java
    ***************************************************
    C:\Program Files\java\bin>java -jar  Application-1.0-shaded.jar

    ************""""""""""""""""""""""""""""""""""""""""
    Hello World!

    ****************************************
    [\code]
     
    Comal Rajagopalaratnam Muthukumar
    Ranch Hand
    Posts: 401
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Hi
     Hope the festival Diwali went off with Cheers.Now will you be able to focus on my new method that needs your concurrence
    Thanks
    As
    CRMK
     
    Comal Rajagopalaratnam Muthukumar
    Ranch Hand
    Posts: 401
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Hi
    On another venture for creatiing a jar with site deployment for an application java prg
    the following snags were give by maven.
    As these errors are very simple,please tell me a way to get id of the same

    ********************************
    Reason: java.net.UnknownHostException: http -> [Help 1]

    ***************************
    Will it be alright if i try to run the pom keeping internet -connected.otherwise what alternative you would recommend.


    The solution for this does nor neceesrily require pom details.the correction can be only from downloaded
    apache-maven -site deployment for adding the scp throgh wagon
    as also all phase are clearly succesful
    mvn->
    clean
    compile
    prepare-package
    package
    install
    pre-site
    site
    post-site
    site:deploy------>requires connection or so


    Thanks
    As
    CRMK
     
    Comal Rajagopalaratnam Muthukumar
    Ranch Hand
    Posts: 401
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Hi

    now for me that a jar creation is more easy than a site creation,i wolud like to be good at the only knowledge attained My thanks are due for you
    As
    CRMK
     
    The overall mission is to change the world. When you've done that, then you can read this tiny ad:
    The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
    https://www.kickstarter.com/projects/paulwheaton/low-tech
    reply
      Bookmark Topic Watch Topic
    • New Topic