Raptor399 wrote:The packaging differs per OS:
- Linux uses
assembly-linux.xml- OS X uses
assembly-osx.xml- Windows uses
setup.nsiThe first two are invoked by the maven-assembly-plugin, the latter by the nsis-maven-plugin from the pom.xml.
Hope that helps.
Thanks a lot for the explanation!
I didn't realize that there's a difference between the development build (mvn package) and the release build (using the assembly plugin). But I still can't figure out how a release build is done for Linux.
1. Invoking "mvn" (without parameters) does execute
<defaultGoal>assembly:assembly</defaultGoal>. Sounds good.
-> "mvn clean; mvn;"
- Code: Select all
[INFO] Building jar: /stuff/Entwicklung/pms_builds/ps3mediaserver/target/pms-1.50.1-SNAPSHOT.jar
[INFO] [assembly:assembly {execution: default-cli}]
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error reading assemblies: No assembly descriptors found.
I can see both *SNAPSHOT.jars in ./target after this error. So the java build is fine, just packaging using the assembly plugin fails.
2. So mvn needs an assembly descriptor (for me: assembly-linux.xml). Maybe I've to use the
linux profile defined in pom.xml. If doing this, maven should use assembly-linux.xml because for the linux profile the <maven-assembly-plugin> is configured to use "assembly-linux.xml".
-> "mvn clean; mvn -P linux;"
- Code: Select all
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] An Ant BuildException has occured: Warning: Could not find file /stuff/Entwicklung/pms_builds/ps3mediaserver/target/pms-1.50.1-SNAPSHOT-jar-with-dependencies.jar to copy.
around Ant part ...<move file="/stuff/Entwicklung/pms_builds/ps3mediaserver/target/pms-1.50.1-SNAPSHOT-jar-with-dependencies.jar" overwrite="true" tofile="/stuff/Entwicklung/pms_builds/ps3mediaserver/target/pms.jar"/>... @ 4:201 in /stuff/Entwicklung/pms_builds/ps3mediaserver/target/antrun/build-main.xml
There are no jars in the target folder. Seems that this target only works if building the jars has been already done.
3. So maybe I have to force a "dev" build before?
-> "mvn clean; mvn package; mvn -P linux;"
- Code: Select all
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building PS3 Media Server
[INFO] task-segment: [clean]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean {execution: default-clean}]
[INFO] Deleting file set: /stuff/Entwicklung/pms_builds/ps3mediaserver/target (included: [**], excluded: [])
[INFO] [external-dependency:clean-external {execution: clean-external-dependencies}]
[INFO] starting to clean external dependency staged files
[INFO] finished cleaning external dependency staged files
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 second
[INFO] Finished at: Sun Jan 22 13:00:27 CET 2012
[INFO] Final Memory: 14M/227M
[INFO] ------------------------------------------------------------------------
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building PS3 Media Server
[INFO] task-segment: [package]
[INFO] ------------------------------------------------------------------------
[INFO] [git-commit-id:revision {execution: default}]
[INFO] [GitCommitIdMojo] Running on '/stuff/Entwicklung/pms_builds/ps3mediaserver/.git' repository...
[INFO] [GitCommitIdMojo] Initializing properties...
[INFO] [GitCommitIdMojo] Using maven project properties...
[INFO] [GitCommitIdMojo] Loading data from git repository...
[INFO] [GitCommitIdMojo] ------------------git properties loaded------------------
[INFO] [GitCommitIdMojo] git.build.user.email = git@xxx.xxx
[INFO] [GitCommitIdMojo] git.commit.user.email = patrick.atoon@gmail.com
[INFO] [GitCommitIdMojo] git.commit.time = 2012-01-21
[INFO] [GitCommitIdMojo] git.commit.message.full = Reporting unit tests as skipped instead of skipping silently.
[INFO] [GitCommitIdMojo] git.commit.message.short = Reporting unit tests as skipped instead of skipping silently.
[INFO] [GitCommitIdMojo] git.commit.id.abbrev = dd74c3b
[INFO] [GitCommitIdMojo] git.branch = master
[INFO] [GitCommitIdMojo] git.build.user.name = smo
[INFO] [GitCommitIdMojo] git.commit.id = dd74c3be7f81fec844f2c1557e0fe898933e98b7
[INFO] [GitCommitIdMojo] git.build.time = 2012-01-22
[INFO] [GitCommitIdMojo] git.commit.user.name = Patrick Atoon
[INFO] [GitCommitIdMojo] ---------------------------------------------------------
[INFO] [GitCommitIdMojo] Finished running.
[INFO] [resources:resources {execution: default-resources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 91 resources to resources
[INFO] Copying 1 resource to resources
[INFO] Copying 25 resources
[INFO] Copying 1 resource to ..
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Compiling 193 source files to /stuff/Entwicklung/pms_builds/ps3mediaserver/target/classes
[INFO] [resources:testResources {execution: default-testResources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource to resources
[INFO] [compiler:testCompile {execution: default-testCompile}]
[INFO] Compiling 5 source files to /stuff/Entwicklung/pms_builds/ps3mediaserver/target/test-classes
[INFO] [surefire:test {execution: default-test}]
[INFO] Surefire report directory: /stuff/Entwicklung/pms_builds/ps3mediaserver/target/surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running net.pms.test.formats.FormatTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.12 sec
Running net.pms.test.formats.FormatRecognitionTest
Tests run: 8, Failures: 0, Errors: 0, Skipped: 8, Time elapsed: 0.376 sec
Running net.pms.test.TaskRunnerTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.009 sec
Running net.pms.test.RendererConfigurationTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.042 sec
Results :
Tests run: 13, Failures: 0, Errors: 0, Skipped: 8
[INFO] [assembly:single {execution: make-jar-with-dependencies}]
[INFO] Reading assembly descriptor: /stuff/Entwicklung/pms_builds/ps3mediaserver/src/main/assembly/jar-with-dependencies.xml
[INFO] META-INF/ already added, skipping
[...]
[INFO] META-INF/MANIFEST.MF already added, skipping
[INFO] Building jar: /stuff/Entwicklung/pms_builds/ps3mediaserver/target/pms-1.50.1-SNAPSHOT-jar-with-dependencies.jar
[INFO] META-INF/ already added, skipping
[...]
[INFO] META-INF/MANIFEST.MF already added, skipping
[INFO] [jar:jar {execution: default-jar}]
[INFO] Building jar: /stuff/Entwicklung/pms_builds/ps3mediaserver/target/pms-1.50.1-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14 seconds
[INFO] Finished at: Sun Jan 22 13:00:42 CET 2012
[INFO] Final Memory: 60M/731M
[INFO] ------------------------------------------------------------------------
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building PS3 Media Server
[INFO] task-segment: [assembly:assembly] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] Preparing assembly:assembly
[INFO] ------------------------------------------------------------------------
[INFO] Building PS3 Media Server
[INFO] ------------------------------------------------------------------------
[INFO] [git-commit-id:revision {execution: default}]
[INFO] [GitCommitIdMojo] Running on '/stuff/Entwicklung/pms_builds/ps3mediaserver/.git' repository...
[INFO] [GitCommitIdMojo] Initializing properties...
[INFO] [GitCommitIdMojo] Using maven project properties...
[INFO] [GitCommitIdMojo] Loading data from git repository...
[INFO] [GitCommitIdMojo] ------------------git properties loaded------------------
[INFO] [GitCommitIdMojo] git.build.user.email = git@xxx.xxx
[INFO] [GitCommitIdMojo] git.commit.user.email = patrick.atoon@gmail.com
[INFO] [GitCommitIdMojo] git.commit.time = 2012-01-21
[INFO] [GitCommitIdMojo] git.commit.message.full = Reporting unit tests as skipped instead of skipping silently.
[INFO] [GitCommitIdMojo] git.commit.message.short = Reporting unit tests as skipped instead of skipping silently.
[INFO] [GitCommitIdMojo] git.commit.id.abbrev = dd74c3b
[INFO] [GitCommitIdMojo] git.branch = master
[INFO] [GitCommitIdMojo] git.build.user.name = smo
[INFO] [GitCommitIdMojo] git.commit.id = dd74c3be7f81fec844f2c1557e0fe898933e98b7
[INFO] [GitCommitIdMojo] git.build.time = 2012-01-22
[INFO] [GitCommitIdMojo] git.commit.user.name = Patrick Atoon
[INFO] [GitCommitIdMojo] ---------------------------------------------------------
[INFO] [GitCommitIdMojo] Finished running.
[INFO] [resources:resources {execution: default-resources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 91 resources to resources
[INFO] Copying 1 resource to resources
[INFO] Copying 25 resources
[INFO] Copying 1 resource to ..
[WARNING] DEPRECATED [tasks]: Use target instead
[INFO] [antrun:run {execution: process-resources}]
[WARNING] Parameter tasks is deprecated, use target instead
[INFO] Executing tasks
main:
[mkdir] Created dir: /stuff/Entwicklung/pms_builds/ps3mediaserver/target/bin
[get] Getting: http://ps3mediaserver.googlecode.com/svn/trunk/ps3mediaserver/linux/tsMuxeR
[get] To: /stuff/Entwicklung/pms_builds/ps3mediaserver/target/bin/tsMuxeR
[INFO] Executed tasks
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Nothing to compile - all classes are up to date
[INFO] [resources:testResources {execution: default-testResources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource to resources
[INFO] [compiler:testCompile {execution: default-testCompile}]
[INFO] Nothing to compile - all classes are up to date
[INFO] [surefire:test {execution: default-test}]
[INFO] Surefire report directory: /stuff/Entwicklung/pms_builds/ps3mediaserver/target/surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running net.pms.test.formats.FormatTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.12 sec
Running net.pms.test.formats.FormatRecognitionTest
Tests run: 8, Failures: 0, Errors: 0, Skipped: 8, Time elapsed: 0.375 sec
Running net.pms.test.TaskRunnerTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.008 sec
Running net.pms.test.RendererConfigurationTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.042 sec
Results :
Tests run: 13, Failures: 0, Errors: 0, Skipped: 8
[WARNING] DEPRECATED [tasks]: Use target instead
[INFO] [antrun:run {execution: prepare-package}]
[WARNING] Parameter tasks is deprecated, use target instead
[INFO] Executing tasks
main:
[move] Moving 1 file to /stuff/Entwicklung/pms_builds/ps3mediaserver/target
[INFO] Executed tasks
[INFO] [assembly:single {execution: make-jar-with-dependencies}]
[INFO] Reading assembly descriptor: /stuff/Entwicklung/pms_builds/ps3mediaserver/src/main/assembly/jar-with-dependencies.xml
[INFO] META-INF/ already added, skipping
[...]
[INFO] META-INF/MANIFEST.MF already added, skipping
[INFO] Building jar: /stuff/Entwicklung/pms_builds/ps3mediaserver/target/pms-1.50.1-SNAPSHOT-jar-with-dependencies.jar
[INFO] META-INF/ already added, skipping
[...]
[INFO] META-INF/MANIFEST.MF already added, skipping
[INFO] [jar:jar {execution: default-jar}]
[INFO] Building jar: /stuff/Entwicklung/pms_builds/ps3mediaserver/target/pms-1.50.1-SNAPSHOT.jar
[INFO] [assembly:single {execution: build-pms}]
[INFO] Reading assembly descriptor: /stuff/Entwicklung/pms_builds/ps3mediaserver/src/main/assembly/assembly-linux.xml
[INFO] Building tar : /stuff/Entwicklung/pms_builds/ps3mediaserver/target/pms-1.50.1-SNAPSHOT-distribution.tar.gz
[INFO] [assembly:assembly {execution: default-cli}]
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error reading assemblies: No assembly descriptors found.
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12 seconds
[INFO] Finished at: Sun Jan 22 13:00:56 CET 2012
[INFO] Final Memory: 49M/745M
[INFO] ------------------------------------------------------------------------
Despite the build error the file ./target/pms-1.50.1-SNAPSHOT-distribution.tar.gz is generated and contains a working pms snapshot for Linux. But I guess the error tells me I'm still doing it wrong.

Could you explain how a release build is done? Is the behavior I've described above intended?
My guess for the correct build order:
- 1. validate, compile, test..
- 2. pre-package: Generating OS independent jars using: assembly/jar-with-dependencies.xml
- 3. package: Generating OS dependent tgz/exe/dmg using: assembly/* depending on the profile used when executing mvn. By default the profile should be chosen automatically depending on the OS the user is using(?).
Thanks
smo