It is a Maven best practice to split a project into several submodules, each one with a small, well-defined purpose. If you're putting different kinds of sources in the same Maven module, you're not using it right. Assuming that in the end you'll end up with a .war, then my advice is to add Bootstrap, jQuery and whatever other libraries you're using as zip dependencies that will be included in the war build.
Let's assume that you can get these libraries available as downloadable Maven dependencies (I'll discuss below your options for accomplishing this), then you would just have to declare them as dependencies for your war artifact:
<dependency>
<groupId>com.twitter.bootstrap</groupId>
<artifactId>twitter-bootstrap</artifactId>
<version>2.0.4</version>
<type>zip</type>
<scope>runtime</scope>
</dependency>
As far as your own code is concerned, that is all the Bootstrap that you need to "include".
How do you get that zip available? Well, the best thing would be to see it published on the central Maven repository, but that's not something that you should do; Twitter should step up and take care of all the Maven users out there.
The next best thing would be to find another public repository that already hosts it well packaged, but I couldn't find one with a nice packaging after a short Google search, maybe you'll have more luck.
The third option is to take things into your own hands, and be the one that creates the proper Maven build for that zip and publish it on your own repository.
One solution I prefer for building such resource zips is to use the maven assembly plugin, and you can use as an inspiration this maven project: put the sources (js, css and image files) in src/main/resources
, and add a simple assembly file that just copies all the files from the resources directory into a zip. Set up a maven repository on a server (a simple HTTP serving machine with sftp access is enough), and do a maven release on that project to upload the artifact on the server.
(You should have a maven repository for releasing your own projects anyway)
Next, you would need to declare your repository in your real project's pom file, add a dependency on the bootstrap artifact, and configure the maven-dependency-plugin to unzip it in a location of your choice:
...
<repositories><repository>
<id>bootstrap-repo</id>
<name>bootstrap public repository</name>
<url>http://repo.yourhost.net/release</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository></repositories>
...
<dependencies><dependency>
<groupId>com.twitter.bootstrap</groupId>
<artifactId>twitter-bootstrap</artifactId>
<version>2.0.4</version>
<type>zip</type>
<scope>runtime</scope>
</dependency></dependencies>
...
<build><plugins><plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack-dependencies</id>
<phase>prepare-package</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<!-- Unpack the Bootstrap library -->
<artifactItem>
<groupId>com.twitter</groupId>
<artifactId>twitter-bootstrap</artifactId>
<type>zip</type>
<outputDirectory>${project.build.directory}/bootstrap</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin></plugins></build>
...
(I'm not sure it would be safe to use com.twitter
as the groupId, since they're not the ones publishing that artifact, so use your own groupId)
Since your own code just declares a dependency on this twitter-bootstrap artifact, you can keep your main GitHub repository clean of third party code. You don't have to commit the project that builds the twitter-bootstrap artifact at all if you don't want your coding statistics to be influenced, although every line of code you write should be committed.
Alternative: maven-antrun-plugin
An alternative to using a mavenized packaging of third party libraries is to extract those files from their official zip distributions using ant tasks in the maven-antrun-plugin to download the zip and extract the files from it.
Or, you can use this trick in the twitter-bootstrap maven project in order to avoid copying their source files at all.