Posts tagged framework
At the end of day I had working solution, that didn’t break anything – it was quite simple (if I look on it now 😉 ) – I just implemented the whole download logic in separated Struts action, not connected with the internal framework – that allowed me to skip the problems!
The last thing to do is write a unit test to confirm that!
I spent the whole day working with Apache Struts 2 Maven archetypes – it’s an open source project hosted at struts.apache.org – basically Action Base Java Web framework.
During that I discovered strange Maven behaviour – when I lunched it with -o option (work in offline mode) it wasn’t be able to find installed archetypes. To clarify – I prepared a script that will build up the archetype from source code, install it in my local Maven repository, then create basic application base on that archetype and lunch them, the source is below:download movie Collateral Beauty
#!/bin/sh if [ -e demo ] ; then rm -R demo fi cd $1 mvn clean install cd .. mvn -o archetype:generate -DgroupId=org.demo -DartifactId=demo -Dversion=1.0-SNAPSHOT -DpackageName=org.demo -DarchetypeArtifactId=$1 -DarchetypeGroupId=org.apache.struts -DarchetypeVersion=2.1.8 -DinteractiveMode=false cd demo mvn jetty:run cd ..
$1 – it’s a command line parameter specifying archetype folder which is also archetype name
So it shouldn’t be needed to access remote archetype repository to download archetype – it’s already in local repository! I tried that with different Maven versions – the latest 2.2.1 and with 2.0.10 – with both was the same.
After some time and many experiments I found the solution – do not use -o option used -B instead! And that I was able to test one archetype – another 3 are waiting!
The day was short, as I spent 5 hours in train coming back to city where I work (it’s a bit complicated to explain that in short 😉 ) so for work left not so much time 😀streaming movie Your Name.
Anyway I integrated an application with corporate CMS system, I had to make some dirty hacks to achieve expected functionality and learned be past experience I wrote unit tests to cover all strange cases I could imagine 😉 At the end of day I integrated that simple solution with the rest of the application and discovered that our internal web flow framework doesn’t support file download functionality! I’ve tried to use different approaches, but without luck 🙁
The worst thing, I will have to look into to find some solution, the current approach is breaking the application and it became useless 😛
I left that behind and went for gym – to chill out myself!