where should i put installer resources (wxs file,dmg-script,icon) and how to configure maven antrun when deploying self contained app

后端 未结 1 1918
执念已碎
执念已碎 2020-12-05 17:02

Where should i drop my custom configured WIX installer configuration file and how to configured javafx packger tool in maven based java fx project using antrun plugin? I suc

1条回答
  •  无人及你
    2020-12-05 17:12

    After so many tries finally i have resolved my issue and for helping others i am posting here the solution.

    Project Structure should be like this

    enter image description here

    and pom.xml should b like this

    
    4.0.0
    
    com.client
    JavaClient
    5.2.0-SNAPSHOT
    jar
    JavaClient
    
    
        com.client.MainApp
        2.2.67
        ${java.home}/lib/jfxrt.jar
        ${java.home}/../lib/ant-javafx.jar
        ${project.basedir}/lib/javafx-dialogs-0.0.1.jar
        1.7
        1.7
        UTF-8
        ${project.build.directory}/diploy
        ${project.basedir}
    
    
    
        
            org.oracle
            javafx
            ${javafx.version}
            ${fx.home}
            system
        
    
        
            junit
            junit
            4.11
            test
        
    
        
            xmlpull
            xmlpull
            1.1.3.1
        
    
        
            xpp3
            xpp3_min
            1.1.4c
        
    
        
            com.thoughtworks.xstream
            xstream
            1.4.7
        
    
        
            com.oracle
            javafx-dialogs
            0.0.1
            system
            ${javafx-dialogs.jar}
        
    
        
            org.apache.logging.log4j
            log4j-core
            2.0.2
        
    
    
    
        
            
                org.apache.maven.plugins
                maven-compiler-plugin
                3.1
                
                    ${maven.compiler.source}
                    ${maven.compiler.target}
                
            
            
                maven-surefire-plugin
                2.9
                
                    
                        **/*Test.class
                    
                
            
            
                maven-antrun-plugin
                1.6
                
                    
                        create-temp-jar
                        prepare-package
                        
                            run
                        
                        
                            
                                
    
                                
                                    
                                    
                                    
                                        
                                        
                                        
                                    
                                
                                
                            
                        
                    
                    
                        create-deployment-bundle
                        install
                        
                            run
                        
                        
                            
    
                                
    
                                
    
                                    
                                    
                                        
                                    
                                    
    
                                    
                                
                            
                        
                    
                
            
            
                maven-assembly-plugin
                2.2.1
                
                    
                        make-assembly
                        package
                        
                            single
                        
                    
                
                
                    
                        src/main/assembly/jar-with-dependencies.xml
                    
                    ${project.build.finalName}
                    false
                    
                        
                            ${javafx.version}
                            ${exec.mainClass}
                            com/javafx/main/Main
                        
                    
                
            
        
    
    
    

    Now I will explain you my mistake. closely look the build part of Question. in ant-run plugin when we go in fx:deploy task here you find that i have entry of class-path. i messed up this part which was so simple. look now in my Pom here. class path now updated. first i mention the base dir then ant-fx-plugin path then jfxrt.jar path. jfxrt may be not necessary. after this i have removed dependencies section of plugin. this is critical. if i do not remove this section then my antrun plugin alwasy look into maven provided dependencies but not in ant-classpath. in ant-classpath order is very very important. your basedir must always come before ant-run.jar . thats it

    Hope This will helpful for the persons who will face this issue.

    0 讨论(0)
提交回复
热议问题