Currently maven Snapshots are created whenever a new build is ran. I was hoping if there is syntax that only stamps them when there is SCM change in that build or code in a particular jar has changed.
Your ideas and thoughts would be appreciated.
Please and thank you.
Well, only your SCM knows if there's been a change. So the logic would have to check the SCM whether there's been a change, and only build if there has been
Related
I've run into a big issue, and it's stalling my project that is due this weekend. Here are the details.
IDE: Eclipse/Maven
API: JAXB, an xml reader/writer API
Issue: Maven is hanging when building the dependency in pom.xml.
More Information: I copy and pasted the jar into a project folder "lib". Then moved the project over to the resource folder. After that, I used maven from eclipse (I think that's the embedded Maven), to add the dependency to the pom.xml. It's been over 4 hours now. I also stopped eclipse through Windows Task Manager. When eclipse started after that, it is continuing with the Maven dependency build, and will not finish.
It is step 5, in this stackoverflow thread. How do I add a Maven dependency in Eclipse?
Any help would be greatly appreciated. This has sucked a whole day out of actual coding; and turned into a configuration issue.
Thanks!
I'm posting this as an answer, not that I think it will give you a complete answer, but as a way to try to get more useful information about your situation.
It would help if you provided more details about exactly what you're doing, and what exactly is happening.
Maven does not "build" dependencies, it downloads dependency artifacts from an artifact repository.
When you say that something is "hanging", that means that an operation starts and doesn't complete, as opposed to failing with an error message. If what you're doing is truly "hanging", then it's important to be exactly clear on exactly what operation and point in the process it is hanging.
You then say that you copied the jar into a folder named "lib" and then "moved the project over to the resource folder".
By "the jar", do you mean the Maven artifact that you're trying to download, which you said was "hanging"? What is the significance of this "lib" folder? Is your build somehow referencing jars in that folder as additional dependencies, subverting the typical maven dependency process? If so, how exactly are you doing this?
Next, what do you mean by "moved the project over to the resource folder"?
Consider all of this from an external perspective. You have to give us enough information to understand exactly what problem you're having, and what you've done that isn't working. So far, you haven't done that.
This is getting tedious. I created a test project, simple java hello, to test a problem I have in another project. Having created the project, I could run it and build it to a jar.
Then I added some ivy stuff and tried a build which did not work. The ivy stuff consisted of ivy.xml ivysettings.xml and 2 tasks added to the otherwise default netbeans build.xml.
So then I removed the ivy files and the ivy sections from build.xml. I then did a diff on that and the previous unedited build.xml file and they are identical.
So now why after a clean build do I get this error?
/home/tester/WORKSPACE/NetBeans/Foo/nbproject/build-impl.xml:63: Source resource does not exist: /home/tester/WORKSPACE/NetBeans/Foo/lib/nblibraries.properties
Correct that file does not exist and it does not exist in any other project I have access to whether they use ivy or not.
I have reset everything I did yet Netbeans cannot continue. I have tried to work out how the hell nb actually builds a project but got lost. Just don't know what to say.
I guess nb and myself differ on what clean actually means and also on whether a task should be able to produce exact same results everytime given the same input, something that nb does not seem to be able to do. That or it cannot recover from the real world or their documentation just hides the useful information like how to reset a project.
I'm assuming there is some nb state that needs to be cleaned up manually but have no idea where to start. Any ideas please?
#Tim Biegeleisen, your comment got me thinking.
I shut down/restarted netbeans then tried the build again and it worked. So it seems that ivy is still running inside netbeans and has some form of state for my project that it will not release. I'll have to dig around to see if there is a way to reset ivy state without restarting nb but this whole process is turning in to a very tedious onerous task. I seem to be spending more time on the dev tools than I am on solving my coding tasks.
So the solution/workaround to my problem seems to be to restart netbeans to clear ivy state.
I'm working with project in intellij IDEA IDE based in maven. I can perform all maven goals but IntelliJ is showing a lot of errors in the source code like bellow:
Everything worked fine a few hours ago. I don't understand why the IDE continue
showing errors. When I rebuild or compile the entire project (CTRL + F9) or a single
scala class I always receive a success message like that:
I already had configured scala plugin before, so I don't know what is happen.
thanks for your help
Sometimes the IntelliJ cache gets corrupted. You can fix this by the following:
File > "Invalidate Caches / Restart"
After choosing "Invalidate and Restart" when prompted, IntelliJ will restart and rebuild its cache.
If IDEA has lost track of obviously correct types such as Database or DateTime it probably means the configuration of the project is wrong or corrupted. Most commonly it does not have the required 3rd part dependencies such as Joda Time.
If you're not already doing so, define your project solely in SBT and use the sbt-idea plug-in to produce your IDEA project definition. Then whenever you change the project dependencies, re-run gen-idea to regenerate your IDEA project files. No muss, no fuss.
There are many bugs raised in jetbrains's bug tracker for this. I suggest you raise some bugs or vote for existing ones.
It loos like the problem you have is with the type aware highlighting which is worse than useless.
thanks for your responses.
I solved this problem importing the project again.
i am looking to make our deployments here not suck and i need some help, if you can help me with these few things i owe you beer
right now whenever i make a change thats not to the jsps i need to clean-including-tomcat otherwise my change doesnt take. this is really annoying.
any clues as to what i can change to make it work?
my current build is really simple, just the regular old, javac, war, deploy
one thing that isnt done is that there is no build dir, the project itself contains a web-inf and the javac is done in place, then the war excludes all the .java resources and wars the project.
edit:
I am looking to fix this problem with least amount of effort - so while switching to maven and learning how to use it might solve this problem, but it will create another problem ;)
You've already identified some of the weaknesses, in your current build.
The easiest way that I can suggest to clean it up would be to start with the directory structure.
I highly recommend using the maven directory structure, I would go further to suggest using maven as a build tool instead of ant, however for some folk that remains open for debate.
The maven directory structure has been well thought out, I really like working on projects that use the maven directory structure, because they follow a convention that allows me to save a lot of time, by knowing from previous experience where to find the application components
java source
unit test source
resources etc.
Also by following the convention, the maven plugins work with less configuration required.
Another useful advantage that I get from working on maven based projects is good code metrics, to measure the health of the application. There are various report available as maven plugins, which will give you new insight into your codebase, including:
checkstyle
pmd
findbugs
and more.
Created a build directory where everything got copied before build
Added some flags to not copy over things that rarely change, like images (also to not remove them on clean)
Started using ant-reload task after deploying code
Now i don't need to restart tomcat on every build, and build takes much less time.
I get stuck with m2eclipse and maven. After adding some dependency (hibernate 3.4, but I guess that doesn't really matter) eclipse got stuck with a message like in the title. Removing the dependency from pom file didn't help either. Restarting eclipse, checking out this as a clean project from repo neither. Alwyas gets stuck on refreshing. :/
What can get (m2)eclipse stuck on refreshing the project? All ideas welcome.
Workspace resolution can really slow the dependency resolution down. Maven needs to partially calculate each project to determine the dependency hierarchy, the time taken to do this increases rapidly as the number of related projects increases. To limit this, close projects you're not working on or uncheck the option to resolve workspace projects (so Maven will resolve the dependencies from the local repository, this means you need to install the projects after each update though).
If that doesn't help, try one of these:
Are your Maven settings correct? It may be that the preferences are not pointing to your platform install so Maven is downloading the dependencies to your user home in the background - this can take ages. If so tweak those settings. Select Window->Preferences->Maven and check if it is using the embedded Maven or not.
If you are behind a proxy you will need to set the proxy settings in your preferences, though if the problem is intermittent it won't be that.
Sometimes the persisted container isn't updated, I've never been able to isolate exactly why. I've found that closing the project and reopening can prod the container back into life.