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

trouble with mvn exec:exec@deploy-app #177

Open
CodingFun-Tai opened this issue Sep 8, 2019 · 2 comments
Open

trouble with mvn exec:exec@deploy-app #177

CodingFun-Tai opened this issue Sep 8, 2019 · 2 comments

Comments

@CodingFun-Tai
Copy link


4.0.0
UpdateApp
UpdateApp
1.0.0-SNAPSHOT

<dependencies>
	<dependency>
		<groupId>no.tornado</groupId>
		<artifactId>fxlauncher</artifactId>
		<version>1.0.20</version>
	</dependency>
</dependencies>

<properties>
	<!-- Installer Filename without suffix -->
	<app.filename>MyApp</app.filename>

	<!-- The JavaFX Application class name -->
	<app.mainClass>club.taicooks.Main</app.mainClass>

	<!-- The Application vendor used by javapackager -->
	<app.vendor>My Comapny</app.vendor>

	<!-- The Application version used by javapackager -->
	<app.version>1.0</app.version>

	<!-- Base URL where you will host the application artifacts -->
	<app.url>https://sublife.co/diet/</app.url>


	<!-- The app and launcher will be assembled in this folder -->
	<app.dir>${project.build.directory}/app</app.dir>

	<!-- Native installers will be built in this folder -->
	<app.installerdir>${project.build.directory}/installer</app.installerdir>

	<!-- Should the client downgrade if the server version is older than the 
		local version? -->
	<app.acceptDowngrade>false</app.acceptDowngrade>

	<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<build>
	<plugins>
		<plugin>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-jar-plugin</artifactId>
			<version>2.6</version>
			<configuration>
				<outputDirectory>${app.dir}</outputDirectory>
			</configuration>
		</plugin>
		<!-- Copy dependencies to appdir -->
		<plugin>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-dependency-plugin</artifactId>
			<configuration>
				<excludeScope>provided</excludeScope>
				<outputDirectory>${app.dir}</outputDirectory>
				<stripVersion>true</stripVersion>
			</configuration>
			<executions>
				<execution>
					<phase>package</phase>
					<goals>
						<goal>copy-dependencies</goal>
					</goals>
				</execution>
			</executions>
		</plugin>
		<plugin>
			<groupId>org.codehaus.mojo</groupId>
			<artifactId>exec-maven-plugin</artifactId>
			<version>1.4.0</version>
			<!-- Generate app.xml manifest -->
			<executions>
				<execution>
					<id>create-manifest</id>
					<phase>package</phase>
					<goals>
						<goal>java</goal>
					</goals>
					<configuration>
						<mainClass>fxlauncher.CreateManifest</mainClass>
						<arguments>
							<argument>${app.url}</argument>
							<argument>${app.mainClass}</argument>
							<argument>${app.dir}</argument>
							<argument>--cache-dir=${app.cacheDir}</argument>
							<argument>--accept-downgrade=${app.acceptDowngrade}</argument>
							<argument>--include-extensions=jpg</argument>
							<argument>${app.parameters}</argument>
						</arguments>
					</configuration>
				</execution>
				<!-- Embed app.xml inside fxlauncher.xml so we don't need to reference 
					app.xml to start the app -->
				<execution>
					<id>embed-manifest-in-launcher</id>
					<phase>package</phase>
					<goals>
						<goal>exec</goal>
					</goals>
					<configuration>
						<executable>jar</executable>
						<workingDirectory>${app.dir}</workingDirectory>
						<arguments>
							<argument>uf</argument>
							<argument>fxlauncher.jar</argument>
							<argument>app.xml</argument>
						</arguments>
					</configuration>
				</execution>
				<!-- Optional step to include custom UI, see https://github.com/edvin/fxlauncher-custom-ui -->
				<!--<execution> -->
				<!--<id>embed-custom-ui-in-launcher</id> -->
				<!--<phase>package</phase> -->
				<!--<goals> -->
				<!--<goal>exec</goal> -->
				<!--</goals> -->
				<!--<configuration> -->
				<!--<executable>jar</executable> -->
				<!--<workingDirectory>${app.dir}</workingDirectory> -->
				<!--<arguments> -->
				<!--<argument>uf</argument> -->
				<!--<argument>fxlauncher.jar</argument> -->
				<!--<argument>-C</argument> -->
				<!--<argument>${project.basedir}/../fxlauncher-custom-ui/target/classes</argument> -->
				<!--<argument>.</argument> -->
				<!--</arguments> -->
				<!--</configuration> -->
				<!--</execution> -->
				<!-- Create native installer. Feel free to add more arguments as needed. 
					https://docs.oracle.com/javase/8/docs/technotes/tools/windows/javapackager.html -->
				<execution>
					<id>installer</id>
					<phase>install</phase>
					<goals>
						<goal>exec</goal>
					</goals>
					<configuration>
						<executable>javapackager</executable>

						<arguments>
							<argument>-deploy</argument>
							<argument>-native</argument>
							<argument>-outdir</argument>
							<argument>${app.installerdir}</argument>
							<argument>-outfile</argument>
							<argument>${app.filename}</argument>
							<argument>-srcdir</argument>
							<argument>${app.dir}</argument>
							<argument>-srcfiles</argument>
							<argument>fxlauncher.jar</argument>
							<argument>-appclass</argument>
							<argument>fxlauncher.Launcher</argument>
							<argument>-name</argument>
							<argument>${project.name}</argument>
							<argument>-title</argument>
							<argument>${project.name}</argument>
							<argument>-vendor</argument>
							<argument>${app.vendor}</argument>
							<argument>-BappVersion=${app.version}</argument>
							<argument>-Bidentifier=${project.groupId}.${project.artifactId}</argument>
						</arguments>
					</configuration>
				</execution>
				<!-- Copy application artifacts to remote site using scp (optional) -->
				<execution>
					<id>deploy-app</id>
					<goals>
						<goal>exec</goal>
					</goals>
					<configuration>
						<executable>scp</executable>
						<arguments>
							<argument>-r</argument>
							<argument>target/app/.</argument>
							<argument>${app.deploy.target}</argument>
						</arguments>
					</configuration>
				</execution>
			</executions>
		</plugin>
		<plugin>
			<artifactId>maven-compiler-plugin</artifactId>
			<version>3.8.0</version>
			<configuration>
				<source>1.8</source>
				<target>1.8</target>
			</configuration>
		</plugin>
	</plugins>
</build>
@edvin
Copy link
Owner

edvin commented Sep 9, 2019

Do you expect us to be able to help you in any meaningful way after describing the issue with a single word, "trouble"? :) What's the issue you're having, what error message do you get when running the command?

@wcrozeta
Copy link

The same "trouble" happened to me. So I updated maven version from 3.2.2 to 3.6.3 and the "trouble" gone.

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

3 participants