Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Could not find resource for template Info.plist #9

Open
ryanthara opened this issue Feb 1, 2015 · 7 comments
Open

Error: Could not find resource for template Info.plist #9

ryanthara opened this issue Feb 1, 2015 · 7 comments

Comments

@ryanthara
Copy link

Hello!

We want to use your appbundler-plugin to create jars and later on dmg-files on OS X Yosemite for RyCON and Routeconverter. I downloaded the files and follow the instructions in the readme.md file.

I use this part in the pom.xml:

<plugin>
                <groupId>io.github.appbundler</groupId>
                <artifactId>appbundle-maven-plugin</artifactId>
                <version>1.0-SNAPSHOT</version>
                <configuration>
                    <dictionaryFile>Info.plist</dictionaryFile>
                    <mainClass>de.ryanthara.ja.rycon.gui.MainApplication</mainClass>
                    <iconFile>RyCON.icns</iconFile>
                    <jvmVersion>1.7+</jvmVersion>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>bundle</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

When I try to execute the maven goal with "mvn clean install" I run into the following error messages:

[ERROR] Failed to execute goal io.github.appbundler:appbundle-maven-plugin:1.0-SNAPSHOT:bundle (default) on project RyCON_MacOSX64: Could not find resource for template Info.plist: Unable to find resource 'Info.plist' -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal io.github.appbundler:appbundle-maven-plugin:1.0-SNAPSHOT:bundle (default) on project RyCON_MacOSX64: Could not find resource for template Info.plist
    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:116)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
    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:216)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    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)
    at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
Caused by: org.apache.maven.plugin.MojoExecutionException: Could not find resource for template Info.plist
    at io.github.appbundler.CreateApplicationBundleMojo.writeInfoPlist(CreateApplicationBundleMojo.java:458)
    at io.github.appbundler.CreateApplicationBundleMojo.execute(CreateApplicationBundleMojo.java:260)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    ... 25 more
Caused by: org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource 'Info.plist'
    at org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(ResourceManagerImpl.java:452)
    at org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(ResourceManagerImpl.java:335)
    at org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:1102)
    at org.apache.velocity.app.VelocityEngine.mergeTemplate(VelocityEngine.java:498)
    at io.github.appbundler.CreateApplicationBundleMojo.writeInfoPlist(CreateApplicationBundleMojo.java:446)
    ... 28 more
[ERROR] 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :RyCON_MacOSX64

Process finished with exit code 1```

So what is missing or going wrong?

There is a little error in `Use Custom Info.plist and Icon` paragraph in the readme.md.
@federkasten
Copy link
Owner

This error caused by the fact that the plugin could not find your custom Info.plist file.

Please put Info.plist file into src/main/resources or your project resource directories and build again.

Thanks.

@ryanthara
Copy link
Author

Good Morning. Thanks for your help.

The Info.plist-file is there. This is the way it looks in finder.

This is the view of IntelliJ. As you can see, it is marked as resource directory.

And it is filled up by me with the following values.

CFBundleDevelopmentRegion de-DE CFBundleDisplayName RyCON CFBundleExecutable JavaApplicationStub CFBundleIconFile RyCON.icns CFBundleIdentifier de.ryanthara.ja.rycon.RyCON CFBundleInfoDictionaryVersion 6.0 CFBundleName RyCON CFBundlePackageType APPL CFBundleShortVersionString ${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion} CFBundleSignature rycn CFBundleVersion ${project.version}-${maven.build.number} ${maven.build.timestamp.clone} NSHumanReadableCopyright © 2015, by Sebastian Aust - http://code.ryanthara.de/ Java JVMVersion 1.7+ MainClass de.ryanthara.ja.gui.MainApplication Properties apple.laf.useScreenMenuBar true VMOptions -XstartOnFirstThread -d64 -Xmx1024m -Dapple.laf.useScreenMenuBar=true ClassPath $JAVAROOT/RyCON_MacOSX64.jar NSHighResolutionCapable

Am 02.02.2015 um 02:57 schrieb Takashi AOKI [email protected]:

This error caused by the fact that the plugin could not find your custom Info.plist file.

Please put Info.plist file into src/main/resources or your project resource directories and build again.

Thanks.


Reply to this email directly or view it on GitHub #9 (comment).

@federkasten
Copy link
Owner

Please run mvn clean && mvn compile and check if your Info.plist file exists in target/classes. If not exists, your project configuration is something wrong.

I'm not familiar to IntelliJ, so I can not advice about it. Sorry. 🙇

@ryanthara
Copy link
Author

I built the latest version a couple of minutes ago. My Info.plist exists after mvn clean && mvn compile in target/classes.

Maybe you are right, and some other things are missing, or wrong in my project configuration. I'm a maven-beginner and stand downside a hill with "at-the-moment-bigger-problems-as-my-tiny-solutions-can-solve". At the moment I'm not able to solve this problems with my own skills and it takes so much time to learn, test, and fail.

Thank you, appreciate your work.

@ryanthara ryanthara reopened this Feb 2, 2015
@ryanthara
Copy link
Author

This morning I give a new try.

[ERROR] Failed to execute goal io.github.appbundler:appbundle-maven-plugin:1.0-SNAPSHOT:bundle (default) on project RyCON_MacOSX64: Execution default of goal io.github.appbundler:appbundle-maven-plugin:1.0-SNAPSHOT:bundle failed. NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal io.github.appbundler:appbundle-maven-plugin:1.0-SNAPSHOT:bundle (default) on project RyCON_MacOSX64: Execution default of goal io.github.appbundler:appbundle-maven-plugin:1.0-SNAPSHOT:bundle failed.
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224)
    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:116)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
    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:216)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    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)
    at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default of goal io.github.appbundler:appbundle-maven-plugin:1.0-SNAPSHOT:bundle failed.
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:143)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    ... 25 more
Caused by: java.lang.NullPointerException
    at io.github.appbundler.CreateApplicationBundleMojo.execute(CreateApplicationBundleMojo.java:201)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
    ... 26 more
[ERROR] 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :RyCON_MacOSX64

Process finished with exit code 1```

@federkasten
Copy link
Owner

I have browse source codes of your project RyCON.

Probably the cause is a sub-moduled maven project. I have not checked on such projects. And it is possibly same with the issue mentioned in #1 that cpesch says.

I think it will work if project configuration is correct. But I could not advise immediately.

@ryanthara
Copy link
Author

Thank you for browsing the sources. RyCON is my first program with the attempt to deliver the it for different platforms.

The goal can be reached by a different solutions. Because of my interests in Route-Converter from cpesch and some other reasons, I followed the maven way. The sub-module structure is inspired and supported by him. As I wrote, I'm a beginner and try to solve the maven problems, what is not as easy for me as I thought.

At the moment we try to find out what is wrong in the project structure or configurations. Therefore I put this messy pom.xml statements. Later on they will gone and I con focus on developing RyCON.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants