-
Notifications
You must be signed in to change notification settings - Fork 71
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
Simple maven packaging #13
Open
acr31
wants to merge
3
commits into
amidos2006:master
Choose a base branch
from
acr31:maven
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<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/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>com.github.amidos2006</groupId> | ||
<artifactId>mario-ai-framework</artifactId> | ||
<packaging>jar</packaging> | ||
<version>1.0.0-SNAPSHOT</version> | ||
|
||
<name>Mario-AI-Framework</name> | ||
<description>The Mario AI framework is a framework for using AI methods with a version of Super Mario Bros. | ||
</description> | ||
<url>https://github.com/amidos2006/Mario-AI-Framework</url> | ||
|
||
<licenses> | ||
<license> | ||
<name>Mario-AI-Framework License</name> | ||
<url>https://github.com/amidos2006/Mario-AI-Framework#copyrights</url> | ||
<distribution>repo</distribution> | ||
</license> | ||
</licenses> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
|
||
<developers> | ||
<developer> | ||
<id>amidos2006</id> | ||
<name>Ahmed Khalifa</name> | ||
<email>ahmed@akhalifa.com</email> | ||
<url>http://www.akhalifa.com</url> | ||
</developer> | ||
</developers> | ||
|
||
<scm> | ||
<url>https://github.com/amidos2006/Mario-AI-Framework</url> | ||
<developerConnection>scm:git:git@github.com:amidos2006/Mario-AI-Framework.git</developerConnection> | ||
<tag>HEAD</tag> | ||
</scm> | ||
|
||
<build> | ||
<sourceDirectory>src</sourceDirectory> | ||
<resources> | ||
<resource> | ||
<directory>levels</directory> | ||
</resource> | ||
<resource> | ||
<directory>img</directory> | ||
</resource> | ||
</resources> | ||
|
||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.8.1</version> | ||
<configuration> | ||
<source>8</source> | ||
<target>8</target> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wondering what this change is for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previous version of the code tried to read level files from file paths. This means that you could only use it if you were running the Java code from a particular working directory in the source tree. If you tried to run it somewhere else, or packaged the code in a jar file then it can't load the level. Instead, what this does is load it as a resource - what you do is tell the system which is compiling your code that the levels folder is a resource folder (the maven config does this) and then when the code is built these are copied into the right place and packaged appropriately so that whenever the code is run (either directly or in a jar file) it can find the resources.
(Obviously the previous approach works find for you already so there's no imperative to accept this - but if you want the maven packaging then you should also do this too)