Maven create JAR

2010-12-10 Thread madeOfStarStuff

Hi, I'm sure this will be simple one...

My pom.xml is configured to create a jar; which is does. However, I've added
some config to inlude and exclude certain files etc.  When I do this, none
of the class files are added (i.e. package folders).

pom.xml (snippets):
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;
modelVersion4.0.0/modelVersion
groupIdcom.mypackage.me/groupId
artifactIdmyapp/artifactId
packagingjar/packaging
version1.0-SNAPSHOT/version
namemyapp/name
urlhttp://maven.apache.org/url
dependencies
dependency
..

build
pluginManagement
plugins
plugin

artifactIdmaven-compiler-plugin/artifactId
configuration
source1.5/source
target1.5/target
/configuration
/plugin
plugin

groupIdorg.apache.maven.plugins/groupId

artifactIdmaven-jar-plugin/artifactId
configuration
archive
manifest
mainClass

com.mypackage.me.ClassWithMainMethod
/mainClass
/manifest
/archive  

includes

includespring-context.xml/include
/includes
excludes

exclude/*.properties/exclude
/excludes 

/configuration
/plugin
/plugins
/pluginManagement



using mvn clean install 

myapp-1.0-SNAPSHOT.jar
   - META-INF
   - spring-context.xml
   - NO package folders?

Any advice?
Many thanks..


-- 
View this message in context: 
http://maven.40175.n5.nabble.com/Maven-create-JAR-tp3300215p3300215.html
Sent from the Maven - Users mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Maven create JAR

2010-12-10 Thread Anders Hammar
Well, you're only including spring-context.xml with that config so Maven
does what you're telling it to. :-)
I think you would get what you want if you just remove the includes snippet
(and keep the excludes).

/Anders
On Fri, Dec 10, 2010 at 13:18, madeOfStarStuff solksjae...@hotmail.comwrote:


 Hi, I'm sure this will be simple one...

 My pom.xml is configured to create a jar; which is does. However, I've
 added
 some config to inlude and exclude certain files etc.  When I do this, none
 of the class files are added (i.e. package folders).

 pom.xml (snippets):
 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;
modelVersion4.0.0/modelVersion
groupIdcom.mypackage.me/groupId
artifactIdmyapp/artifactId
packagingjar/packaging
version1.0-SNAPSHOT/version
namemyapp/name
urlhttp://maven.apache.org/url
dependencies
dependency
 ..

build
pluginManagement
plugins
plugin

  artifactIdmaven-compiler-plugin/artifactId
configuration
source1.5/source
target1.5/target
/configuration
/plugin
plugin

  groupIdorg.apache.maven.plugins/groupId

  artifactIdmaven-jar-plugin/artifactId
configuration
archive
manifest
mainClass

  com.mypackage.me.ClassWithMainMethod
/mainClass
/manifest
/archive
includes

  includespring-context.xml/include
/includes
excludes

  exclude/*.properties/exclude
/excludes
/configuration
/plugin
/plugins
/pluginManagement

 

 using mvn clean install

 myapp-1.0-SNAPSHOT.jar
   - META-INF
   - spring-context.xml
   - NO package folders?

 Any advice?
 Many thanks..


 --
 View this message in context:
 http://maven.40175.n5.nabble.com/Maven-create-JAR-tp3300215p3300215.html
 Sent from the Maven - Users mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
 For additional commands, e-mail: users-h...@maven.apache.org




Re: Maven create JAR

2010-12-10 Thread madeOfStarStuff

Thanks for the reply.  The problem is that NO .class files are being included
in the .jar file.
-- 
View this message in context: 
http://maven.40175.n5.nabble.com/Maven-create-JAR-tp3300215p3300312.html
Sent from the Maven - Users mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Maven create JAR

2010-12-10 Thread Anders Hammar
Yes. Did you try removing the includes part of you config? You're actually
telling the jar-plugin to only include the spring-context.xml file. No
wonder there are no .class files included.

/Anders

On Fri, Dec 10, 2010 at 14:54, madeOfStarStuff solksjae...@hotmail.comwrote:


 Thanks for the reply.  The problem is that NO .class files are being
 included
 in the .jar file.
 --
 View this message in context:
 http://maven.40175.n5.nabble.com/Maven-create-JAR-tp3300215p3300312.html
 Sent from the Maven - Users mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
 For additional commands, e-mail: users-h...@maven.apache.org




Re: Maven create JAR

2010-12-10 Thread Wayne Fay
                            includes
                                    includespring-context.xml/include
                            /includes

As Anders has told you repeatedly now, this include line in your
config tells Maven to only include the following file(s) in my jar
and that is exactly what Maven is doing.

Remove the include, leave only the excludes, and your classes should
magically appear in the jar file.

Wayne