2

Ultimately we are trying to figure out a build/deploy process at my company. As the developer, I need to provide my source code to an audit group. They review the software for security deviations. If the source passes the audit, then the code goes to the Software Configuration Group. Their job is to archive and compile my app to a WAR. The WAR file is then provided to the IT department who will put the WAR on the server. I think the process would be easy if I had one self contained project.

But in Eclipse I have two Maven projects, where one depends on the other. One project core provides core functionality. I separated it because these core functionalites will be used by all my other (internal) web app projects.

 Logging
 filters
 common models (phonebook, employee, etc)
 common utilities (Emailing employess, String utils, etc..)

In the other projects, say project1, I add a dependency to core in the POM. Not sure if I need to do this but I also edited the Eclipse project properties and added a reference to the core project. With some finagling (new to Maven) I was able to get Project1 deployed to my local install of JBoss. I opened the WAR and in WEB-INF/lib folder I could see that core-0.0.1-SNAPSHOT.jar was automatically included.

But how do I give SCM my source for project1 which also needs the source for core without manually copying cores source into porject1s source.

I could copy core-0.0.1-SNAPSHOT.jar into Project1 but they should also be reviewing cores source every time I deploy a new app because I may have added or tweaked some core functionality.

jeff
  • 3,618
  • 9
  • 48
  • 101

2 Answers2

1

You should learn more about maven SNAPSHOT and release repositories. Then install Nexus server as destination for produced jars, wars, javadocs and sources (called artifacts).

After that maybe you will be interested in commercial Nexus version with staged deployment option. http://www.sonatype.com/people/2009/06/using-staging-repositories-for-deployment-in-nexus/

Paul Verest
  • 60,022
  • 51
  • 208
  • 332
  • I advice you to learn more about maven. For example, having SNAPSHOT version in released package is bad style. Your relases should not be SNAPSHOT, but have incremented versions. – Paul Verest Feb 07 '13 at 08:52
  • http://stackoverflow.com/questions/5901378/what-exactly-is-a-maven-snapshot-and-why-do-we-need-it – Paul Verest Feb 07 '13 at 09:01
  • 1
    I agree I need to learn more about Maven. I agree about SNAPSHOT, But what I am missing is the mechanics of coordinating with 2 other people who take control of my source code. If I had 1 standalone module, I could zip that folder. But in Eclipse I have two separate projects that need to get built into 1 WAR by someone else, not me. I have been learning about Multi-Module. I also just did the sonatype book example where the maven assemply plugin was used. – jeff Feb 07 '13 at 14:47
  • Why not let them get code via SCM (version control)? Just have 2 project under 1 folder for ease of updates, commits. – Paul Verest Feb 12 '13 at 08:03
1

To solve packaging problem you can use Maven Assembly Plugin. You can have all sources and dependencies in one file.

Maybe there are even more suitable for your needs maven plugins.

Paul Verest
  • 60,022
  • 51
  • 208
  • 332