Foren

When building a WAR using the plugins-sdk, java sources are also added?

thumbnail
Stef Heyenrath, geändert vor 14 Jahren.

When building a WAR using the plugins-sdk, java sources are also added?

Junior Member Beiträge: 76 Beitrittsdatum: 03.12.08 Neueste Beiträge
In the build-common-plugin.xml there is a "war" target defined as follows:

<target name="war" depends="compile">
	<mkdir dir="${project.dir}/dist" />

	<if>
		<available file="tmp" />
		<then>
			<property name="docroot.dir" value="tmp" />
		</then>
		<else>
			<property name="docroot.dir" value="docroot" />
		</else>
	</if>

	<delete file="${plugin.file}" />

	<antcall target="clean-portal-dependencies" />

	<if>
		<contains string="${app.server.dir}" substring="glassfish" />
		<then>
			<zip basedir="${docroot.dir}" destfile="${plugin.file}" excludes="**/META-INF/context.xml" />
		</then>
	<else>
			<zip basedir="${docroot.dir}" destfile="${plugin.file}" />
		</else>
	</if>
</target>


Why are *.java files not ignored ? This makes the war file too big if you have a lot of sources !
Marina Glebova, geändert vor 12 Jahren.

RE: When building a WAR using the plugins-sdk, java sources are also added?

New Member Beiträge: 15 Beitrittsdatum: 27.02.12 Neueste Beiträge
Hi Stef! Have you found out the solution of this problem?
thumbnail
David H Nebinger, geändert vor 12 Jahren.

RE: When building a WAR using the plugins-sdk, java sources are also added?

Liferay Legend Beiträge: 14919 Beitrittsdatum: 02.09.06 Neueste Beiträge
Liferay does this for all portlets using the SDK.

You can move your source folder outside of docroot/WEB-INF and modify the build.xml to use the alternate location for compiling.
thumbnail
Hitoshi Ozawa, geändert vor 12 Jahren.

RE: When building a WAR using the plugins-sdk, java sources are also added?

Liferay Legend Beiträge: 7942 Beitrittsdatum: 24.03.10 Neueste Beiträge
Probably because Liferay CE is LGPL so developers are required to distribute their source code with the binary.

One character is just 1 byte. It's very difficult to write a portlet with source that's few megabytes.